Quantum
Functions for Quantum computing and related operations, especially those related to the classical-quantum hybrid methods such as QSCI/SQD.
NuclearToolkit.construct_Jmat — Methodfunction construct_Jmat
Function to construct the J^2 operator, more specifically J-J+ to evaluate <J^2> = <J-J+> + Jz(Jz+1) Since all the configurations for protons and neutrons are associated with the total angular momentum projection Mp, Mn and the Mp+Mn is to be conserved, one only needs to consider the first term of the J^2 operator, which is given via:
\[\hat{J}_{\pm} = \sum_{km} \sqrt{j(j+1) - m(m\pm 1)} a^{\dagger}_{k,m\pm 1} a_{k,m}\]
where k is the index of the single-particle state, j is the corresponding angular momentum, and m is the z-component of the angular momentum.
NuclearToolkit.eval_HCM_2b_diag — Methodonly a^†i a^†j aj ai terms (pp/nn) can contribute
NuclearToolkit.eval_JmJp_diag — Method-◯●●◯- =(J+)> -◯●◯●- =(J-)> -◯●●◯-
NuclearToolkit.eval_JmJp_nd — MethodFor hamming distance 4 (2 protons and 2 neutrons) cases, identifying the place of cre/ani operations are rather trivial. However, for T=1 channels, one needs to be careful about
NuclearToolkit.get_possible_ijkls! — MethodReturns possible m-scheme indices (i, j, k, l) for the given channel and difference bitstrings.
For hamming distance 2, it is a bit tricky since we need to consider spectator indices.
NuclearToolkit.hcm_1body — Method<sps(n,l,j,tz)|| Hcm_1b || sps(n,l,j,tz)> diagonal part of the HCM 1-body term
NuclearToolkit.hcm_2body — Method<sps1, sps2|| Hcm2b ||sps3, sps_4>
NuclearToolkit.nabla_j — Method<nlj|| ∇*b || nlj>
Note that j1 and j2 are doubled.
NuclearToolkit.radius_j — Method<nlj|| r || nlj>
NuclearToolkit.eval_Hij_nondiag_02_20 — MethodEvaluate the Hamiltonian matrix element H_ij for some non-diagonal cases. The 02&20 means that either the proton or neutron part have hamming distance of 2, and the other part has hamming distance of 0. (0, 2) => n1b, nn, pn, nnn, ppn, pnn, (2, 0) => p1b, pp, pn, ppp, ppn, pnn
Note: The way to evaluate phase factor coming from anti-commutation relations here is a bit tricky. Since we already know one of the components in both bra and ket is identical, which is referred to as spectator in the code. Let us give an example: A configuration in 8He within p shell, < 000000 ⊗ 100111 | H | 000000 ⊗ 101110 >. Under the operators with (0, 2) hamming distances, 2nd, 3rd, and 6th neutron orbits (counting from the right most bit), can be a spectator. The involved operators will be a^†1 a^†2 a2 a4, a^†1 a^†3 a3 a4, a^†1 a^†6 a4 a6, respectively. We firstly evaluate the phase factor coming from the "target"
NuclearToolkit.eval_Hij_nondiag_04_40 — Methoda^†p a^†q ar as where {p, q} ^ {r, s} = ∅
NuclearToolkit.lanczos — Methodlanczos(Hamil_mat, dim, get_evecs, to; itnum=300, tol=1e-9, debug_mode=0)Function to compute the lowest eigenvalue of the Hamiltonian using the Lanczos method.
Constructing a Krylov subspace $\mathcal{K}_m(H,v) = \mathrm{span}\{v, Hv, H^2v, \cdots, H^{m-1}v\}$, and the tridiagonal matrix $T_m = V_m^T H V_m$ where $V_m = [v_1, v_2, \cdots, v_m]$ and $v_{m+1} = H v_m - \alpha_m v_m - \beta_m v_{m-1}$, the Lanczos method iteratively constructs the matrix $T_m$ and diagonalizes it to obtain the smallest eigenvalue of $H$.
Arguments
Hamil_mat: Hamiltonian matrix, either aMatrix{Float64}or aDict{UInt64, Float64}.dim: Dimension of the basis, i.e. number of configurationsget_evecs: Iftrue, save the exact wave function to a HDF5 fileto: TimerOutput object
Optional arguments
itnum: Number of Lanczos iterationstol: Tolerance for convergencedebug_mode: the level of debug information
NuclearToolkit.operate_H_on_vec! — Methodoperate_H_on_vec!(w, Hamil_mat::Dict{UInt64, Float64}, v)Sparse version of the function to compute the matrix-vector product of the Hamiltonian matrix in the form of Dict{UInt64, Float64} and a vector.
NuclearToolkit.operate_H_on_vec! — Methodoperate_H_on_vec!(w, Hamil_mat::Array{Float64, 2}, v)Function to compute the matrix-vector product of the Hamiltonian matrix and a vector.
NuclearToolkit.qsci_main — MethodHrank: rank of the Hamiltonian operator (e.g., 2 for two-body interaction) currently not much used, but may be useful for future extensions.
NuclearToolkit.reOrthogonalize! — MethodreOrthogonalize!(w, vks, i)Re-orthogonalize the vector w with respect to the previous vectors:
\[w := w - \sum_{j=1}^{i} \langle w, v_j \rangle v_j\]
NuclearToolkit.read_bitstr — MethodRead a p-n combined bitstring, and evaluate Nocc, parity,