hqs_nmr.solver.implementations.reference_solver
A simple direct solver as a reference implementation.
Functions
| 
 | Calculate spectral function using a serial loop. | 
| 
 | Calculate spectral function using a serial loop. | 
| 
 | Calculate a NMR spectrum brute force from a PauliHamiltonian. | 
- hqs_nmr.solver.implementations.reference_solver.calc_correlator_function_serial(vectors: ndarray, Enm: ndarray, Ims: list[PauliOperator], Im: ndarray, eta: ndarray, omegas: ndarray, As: ndarray, spin_contribution_indices: list[int]) None
- Calculate spectral function using a serial loop. - Parameters:
- vectors – Eigenstates of the hamiltonian. 
- Enm – Energy differences between the different eigenenergies (E_n - E_m). 
- Ims – Ladder operators for individual spins (I_l^-). 
- Im – Expectation values of total spin ladder operator (<n|I_total^+|m>). 
- eta – Spin-dependent broadening parameters. 
- omegas – Frequency range. 
- As – Empty array to save in the spin resolved spectral function. 
- spin_contribution_indices – List of indices l of I^+_l for which to evaluate the correlator. 
 
 
- hqs_nmr.solver.implementations.reference_solver.calc_correlator_function_parallel(vectors: ndarray, Enm: ndarray, Ims: list[PauliOperator], Im: ndarray, eta: ndarray, omegas: ndarray, As_fortran: ndarray, spin_contribution_indices: list[int]) None
- Calculate spectral function using a serial loop. - Note: This function will only be called, if the lattice_functions are installed. - Parameters:
- vectors – Eigenstates of the hamiltonian. 
- Enm – Energy differences between the different eigenenergies (E_n - E_m). 
- Ims – Ladder operators for individual spins (I_l^-). 
- Im – Expectation values of total spin ladder operator (<n|I_total^+|m>). 
- eta – Spin-dependent broadening parameters. 
- omegas – Frequency range. 
- As_fortran – Empty array to be overwritten with the spin resolved spectral function. Has to 
- style. (have fortran) 
- spin_contribution_indices – List of indices l of I^+_l for which to evaluate the correlator. 
 
 
- hqs_nmr.solver.implementations.reference_solver.reference_nmr_solver(hamiltonian: PauliHamiltonian, normalized_gyromagnetic_ratios: np.ndarray, omegas: np.ndarray, eta: np.ndarray, spin_contribution_indices: list[int], calculation_parameters: NMRCalculationParameters, calc_parallel: bool = True, **kwargs: dict[str, Any]) np.ndarray
- Calculate a NMR spectrum brute force from a PauliHamiltonian. - Evaluates a correlator function of the form .. math:: sum_n frac{bra{n} I^+ ket{m} bra{m} I^- ket{n}}{omega + E_n - E_m + i eta} where I_^- = sum_l I^-_l. - Parameters:
- hamiltonian – Struqture spin Hamiltonian. 
- normalized_gyromagnetic_ratios – Array of the gyromagnetic factors per site, normalized with respect to the reference isotope. 
- omegas – Desired frequencies. 
- eta – Explicit spin-dependent broadening of the peaks. 
- spin_contribution_indices – List of indices l of I^+_l for which to evaluate the correlator. 
- calculation_parameters – Object storing all calculation parameters including solver-specific settings. 
- calc_parallel – If True, the parallel implementation is used, otherwise the serial one. 
- kwargs – Catch all for general interface. 
 
- Returns:
- An array of the spectral function for the specified spin contributions at each frequency. 
- Raises:
- ValueError – If number of spins does not match the number of gyromagnetic factors.