hqs_nmr.calculate

The main NMR runtime routines.

As a general naming convention we refer to variables just by their name if they are in rad / s. Other units are denoted with an underscore behind the variable name. For example the full width half maximum (fwhm) could be denoted as:

  • fwhm if it is given in rad / s

  • fwhm_Hz if it is given in Hz

  • fwhm_MHz if it is given in MHz

  • fwhm_ppm if it is given in ppm.

Functions

calculate_correlator(molecule_parms, ...)

Calculate the NMR correlator function for a molecule.

calculate_eom_greens_function(...[, indices])

Calculates an EOM Green's function associated with some precalculated Green's function.

calculate_greens_function(molecule_parms, ...)

Calculate the Green's function for a molecule.

calculate_spectrum(molecule_parms, ...)

Calculate the NMR spectrum for a molecule.

evaluate_cluster_correlator(cluster_dict, ...)

Evaluate the correlator for one cluster.

hqs_nmr.calculate.calculate_correlator(molecule_parms: NMRParameters, calculation_parms: NMRCalculationParameters) NMRResultSpectrum1D | NMRResultGreensFunction1D

Calculate the NMR correlator function for a molecule.

Parameters:
  • molecule_parms – The molecular isotopes, shifts and J-coupling values.

  • calculation_parms – Object containing all parameters needed to perform a NMR correlator function calculation.

Returns:

The calculated spectrum or Green’s function if specified in calculation_parms.solver_settings.

hqs_nmr.calculate.calculate_eom_greens_function(result_greens_function: NMRResultGreensFunction1D, indices: tuple[int, int] | list[tuple[int, int]] | None = None) NMRResultGreensFunction1D

Calculates an EOM Green’s function associated with some precalculated Green’s function.

The EOM Green’s function is calculated in the same way as the standard NMR Green’s function only the operators to the left M^-_l have been replaced by the commutator [M^-_l, H_j].

Here H_j is either the sum over all S_i S_j terms or if indices are specified only over the terms associated with those.

Args.:

indices: indices for which to evaluate the expression. result_greens_function: Green’s function which is supposed to be adapted.

Result:

The EOM Green’s function.

hqs_nmr.calculate.calculate_greens_function(molecule_parms: NMRParameters, calculation_parms: NMRCalculationParameters) NMRResultGreensFunction1D

Calculate the Green’s function for a molecule.

Parameters:
  • molecule_parms – The molecular isotopes, shifts and J-coupling values.

  • calculation_parms – Object containing all parameters needed to perform a NMR Green’s function calculation.

Returns:

The result of the NMR Green’s function calculation.

hqs_nmr.calculate.calculate_spectrum(molecule_parms: NMRParameters, calculation_parms: NMRCalculationParameters) NMRResultSpectrum1D

Calculate the NMR spectrum for a molecule.

Parameters:
  • molecule_parms – The molecular isotopes, shifts and J-coupling values.

  • calculation_parms – Object containing all parameters needed to perform a NMR spectrum calculation.

Returns:

The result of the NMR spectrum calculation.

hqs_nmr.calculate.evaluate_cluster_correlator(cluster_dict: Dict[str, Any], omegas: ndarray, gyromagnetic_ratios: dict[Isotope, float], broadening: float, field: float, reference_energy: float, beta: float, solver_settings: NMRSolverSettings) ndarray

Evaluate the correlator for one cluster.

Parameters:
  • cluster_dict – Dictionary with the specifications of the cluster.

  • omegas – Frequencies at which to evaluate the correlator in rad / s.

  • gyromagnetic_ratios – Dictionary of gyromagnetic ratios in radians per second per Tesla.

  • broadening – Artificial broadening in rad / s.

  • field – Magnetic field in T.

  • reference_energy – Reference energy in rad / s.

  • beta – Inverse temperature. 0 means infinite temperature.

  • solver_settings – Setting object storing information of solver and cluster methods.

Returns:

Correlator function on the cluster. Only spin contributions specified in cluster_dict are evaluated.