hqs_nmr.solver.implementations.local_SU2_conserved_routines

Methods to calculate a spectrum taking into account local SU2 symmetries and Sz conservation.

Functions

calc_correlator_function_from_effective_spin_system(...)

Evaluate the correlator function exploiting Sz conservation and local SU2 symmetry.

calc_correlator_function_using_symmetry_variable_spin_number(...)

Calculate an NMR spectrum for an effective spin system using Sz and local SU2 conservation.

calc_groundstate_energy_using_symmetry(...)

Calculate the ground state energy by iteratively going through all S^2 and Sz sectors.

determine_energy_shift_using_symmetry(...)

Calculate the energy shift if beta > 0.

diagonalize_Sz_and_S2_conserved_hamiltonian(...)

Diagonalize hamiltonian in one Sz / S^2 sector.

lowest_energy_Sz_and_S2_conserved_hamiltonian(...)

Find lowest energy of Hamiltonian in one Sz / S^2 sector.

hqs_nmr.solver.implementations.local_SU2_conserved_routines.calc_correlator_function_from_effective_spin_system(spin_contributions: list[int], effective_spin_system: EffectiveSpinSystem, gyromagnetic_ratios: np.ndarray, omegas: np.ndarray, eta: float, beta: float, magnetic_shift: float, energy_shift: float, solver_settings: NMRSolverSettings) np.ndarray

Evaluate the correlator function exploiting Sz conservation and local SU2 symmetry.

Parameters:
  • spin_contributions – List of indices of the spin contributions to calculate.

  • effective_spin_system – Effective spin system for which to calculate the spectral function.

  • gyromagnetic_ratios – Array of the gyromagnetic factors per site.

  • omegas – Desired frequencies.

  • eta – Explicit broadening of the peaks.

  • beta – Inverse temperature. 0 means infinite temperature.

  • magnetic_shift – Magnetic shift of the hamiltonian.

  • energy_shift – Constant energy offset.

  • solver_settings – NMRSolverSettings object containing information for the actual solver routine.

Returns:

Array with the site-resolved spectral function for the specified spin indices.

hqs_nmr.solver.implementations.local_SU2_conserved_routines.calc_correlator_function_using_symmetry_variable_spin_number(calc_greens_function: bool, spin_indices: list[int], effective_spin_system: EffectiveSpinSystem, gyromagnetic_ratios: ndarray, omegas: ndarray, eta: float, beta: float, energy_shift: float, magnetic_shift: float, threshold_matrix_elements: float) ndarray

Calculate an NMR spectrum for an effective spin system using Sz and local SU2 conservation.

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.

  • effective_spin_system – Object containing all the information on an effective spin system.

  • gyromagnetic_ratios – Array of the gyromagnetic factors per site.

  • omegas – Desired frequencies.

  • eta – Explicit broadening of the peaks.

  • beta – Inverse temperature. 0 means infinite temperature.

  • energy_shift – Constant energy offset.

  • magnetic_shift – Magnetic shift of the Hamiltonian.

  • threshold_matrix_elements – Threshold until which the Matrix elements are evaluated.

Returns:

An array of the correlator function for each frequency.

hqs_nmr.solver.implementations.local_SU2_conserved_routines.calc_groundstate_energy_using_symmetry(effective_spin_system: EffectiveSpinSystem) float

Calculate the ground state energy by iteratively going through all S^2 and Sz sectors.

Parameters:

effective_spin_system – Object containing all the information on an effective spin system.

Returns:

The ground state energy.

hqs_nmr.solver.implementations.local_SU2_conserved_routines.determine_energy_shift_using_symmetry(effective_spin_system: EffectiveSpinSystem, beta: float) float

Calculate the energy shift if beta > 0.

Parameters:
  • effective_spin_system – Object containing all the information on a given effective spin system.

  • beta – Inverse temperature.

Returns:

The energy shift if beta > 0, otherwise zero.

hqs_nmr.solver.implementations.local_SU2_conserved_routines.diagonalize_Sz_and_S2_conserved_hamiltonian(statemap: StateMap, J_coupling: ndarray, Jz: ndarray, higher_spin_state_list: tuple[HigherSpinState, ...], beta: float = 0.0) tuple[ndarray, ndarray]

Diagonalize hamiltonian in one Sz / S^2 sector.

Parameters:
  • statemap – State map of the Sz / S^2 sector.

  • J_coupling – J coupling matrix (possibly reduced due to local SU(2) symmetry).

  • Jz – Matrix with magnetic fields.

  • higher_spin_state_list – List of higher spins.

  • beta – Inverse temperature

Returns:

eigenvalues and eigenvectors in this sector

Return type:

Tuple[np.ndarray, np.ndarray]

hqs_nmr.solver.implementations.local_SU2_conserved_routines.lowest_energy_Sz_and_S2_conserved_hamiltonian(statemap: StateMap, J_coupling: ndarray, Jz: ndarray) float

Find lowest energy of Hamiltonian in one Sz / S^2 sector.

Parameters:
  • statemap – State map of the Sz / S^2 sector.

  • J_coupling – J coupling matrix (possibly reduced due to local SU(2) symmetry).

  • Jz – Matrix with magnetic fields.

Returns:

Lowest eigenvalue in this sector.