hqs_nmr.solver.implementations.Sz_conserved_routines
Routines to calculate a spectrum, if only the Sz conservation is taken into account.
Functions
| Calculate spectral function for one individual spin. | |
| Calculate specified spin contributions of an NMR spectrum. | |
| 
 | Calculate ground state by iterating over all Sz sectors. | 
| 
 | Determine the energy shift corresponding to the overall groundstate energy. | 
| Builds and diagonalizes the Hamiltonian in one Sz sector. | |
| 
 | Evaluate expressions of the form <n|O|m>, where O is some operator. | 
| 
 | Builds the Hamiltonian in one Sz sector and finds the lowest eigenvalue. | 
| 
 | Sets the operator I^-. | 
- hqs_nmr.solver.implementations.Sz_conserved_routines.determine_energy_shift(Jz: ndarray, hJz: ndarray, hJp: ndarray, beta: float = 0.0) float
- Determine the energy shift corresponding to the overall groundstate energy. - Note that the ground state energy is only calculated if beta is larger than zero. - Parameters:
- Jz – Array with S^z terms. dim: (number_spins). 
- hJz – Array with the S^z S^z coupling. dim: (number_spins x number_spins). 
- hJp – Array with the S^+ S^- coupling. dim: (number_spins x number_spins). 
- beta – Inverse temperature. Defaults to 0.0. 
 
- Returns:
- The ground state energy if beta > 0, otherwise zero. 
 
- hqs_nmr.solver.implementations.Sz_conserved_routines.calc_groundstate_energy(Jz: ndarray, hJz: ndarray, hJp: ndarray) float
- Calculate ground state by iterating over all Sz sectors. - Parameters:
- Jz – Array with S^z terms. dim: (number_spins). 
- hJz – Array with the S^z S^z coupling. dim: (number_spins x number_spins). 
- hJp – Array with the S^+ S^- coupling. dim: (number_spins x number_spins). 
 
- Returns:
- The ground state energy. 
 
- hqs_nmr.solver.implementations.Sz_conserved_routines.lowest_energy_in_Sz_sector(statemap: StateMap, Jz: ndarray, hJz: ndarray, hJp: ndarray) float
- Builds the Hamiltonian in one Sz sector and finds the lowest eigenvalue. - Parameters:
- statemap – State map of the Sz sector. 
- Jz – Array with S^z terms. dim: (number_spins). 
- hJz – Array with the S^z S^z coupling. dim: (number_spins x number_spins). 
- hJp – Array with the S^+ S^- coupling. dim: (number_spins x number_spins). 
 
- Returns:
- Returns the smallest algebraic eigenvalue. 
 
- hqs_nmr.solver.implementations.Sz_conserved_routines.set_I_minus_operator(J_minus: ndarray, statemap: StateMap, statemap_minus: StateMap) csr_matrix_eigen
- Sets the operator I^-. - Parameters:
- J_minus – Array with I^- terms. dim: (number_spins). 
- statemap – State map of the current Sz sector. 
- statemap_minus – State map of the Sz sector after applying I^-. 
 
- Returns:
- Returns the I^- operator applied to the sites specified in J_minus. 
 
- hqs_nmr.solver.implementations.Sz_conserved_routines.diagonalize_Sz_conserved_hamiltonian(statemap: StateMap, Jz: ndarray, hJz: ndarray, hJp: ndarray) tuple[ndarray, ndarray]
- Builds and diagonalizes the Hamiltonian in one Sz sector. - Parameters:
- statemap – State map of the Sz sector. 
- Jz – Array with S^z terms. dim: (number_spins). 
- hJz – Array with the S^z S^z coupling. dim: (number_spins x number_spins). 
- hJp – Array with the S^+ S^- coupling. dim: (number_spins x number_spins). 
 
- Returns:
- Returns the Eigenvalues, and Eigenvectors in one Sz sector. 
 
- hqs_nmr.solver.implementations.Sz_conserved_routines.calc_correlator_function_parallel_Sz_conserved(Enm: ndarray, list_expectation_values_left: list[ndarray], expectation_values_right: ndarray, threshold_matrix_elements: float, eta: ndarray, omegas: ndarray, correlator_function_fortran: ndarray) None
- Calculate spectral function for one individual spin. - Parameters:
- Enm – Energy differences between the different eigenenergies. 
- list_expectation_values_left – Expectation values for the ladder operators on the left of the correlator. 
- expectation_values_right – Expectation values of total spin ladder operator 
- threshold_matrix_elements – Threshold until which the Matrix elements are evaluated. 
- eta – Explicit spin-dependent broadening of the peaks. 
- omegas – Frequency range. 
- correlator_function_fortran – Empty array to be overwritten with the spin resolved spectral function. Has to fortran style. 
 
 
- hqs_nmr.solver.implementations.Sz_conserved_routines.evaluate_braket(operator: fermions.ExpressionSpinful, bra: np.ndarray, ket: np.ndarray, statemap_bra: StateMap, statemap_ket: StateMap) np.ndarray
- Evaluate expressions of the form <n|O|m>, where O is some operator. - Parameters:
- operator – Fermion expression for which to evaluate the braket. 
- bra – Bra vectors, stored in matrix. 
- ket – Ket vectors, stored in matrix. 
- statemap_bra – State map for the bra vector. 
- statemap_ket – State map for the ket vector. 
 
 
- hqs_nmr.solver.implementations.Sz_conserved_routines.calc_correlator_function_variable_spin_number(calc_greens_function: bool, spin_indices: list[int], site_resolved_operators: fermions.ExpressionSpinful | list[fermions.ExpressionSpinful], operator_sum: fermions.ExpressionSpinful, Jz: np.ndarray, hJz: np.ndarray, hJp: np.ndarray, omegas: np.ndarray, eta: np.ndarray, magnetic_shift: float, threshold_matrix_elements: float, verbose: int) np.ndarray
- Calculate specified spin contributions of an NMR spectrum. - The spin contributions are calculated exploiting Sz conservation through a direct resolvent approach. - Parameters:
- calc_greens_function – If true the Green’s function is calculated, otherwise the spectral function. 
- spin_indices – List of spin indices for which to calculate the spectral function. 
- site_resolved_operators – List of site-resolved operators or operators on one site. 
- operator_sum – Sum of operators acting on each site. 
- Jz – Array with Sz terms. 
- hJz – Array with the Sz Sz coupling. 
- hJp – Array with the S+ S- coupling. 
- omegas – Desired frequencies. 
- eta – Explicit spin-dependent broadening of the peaks. 
- magnetic_shift – Magnetic shift of the hamiltonian. 
- threshold_matrix_elements – Threshold until which the Matrix elements are evaluated. 
- verbose – Level of verbosity of output. 
 
- Returns:
- An array of the spectral function for each frequency for this cluster.