hqs_nmr.hamiltonian_tools
Tools to obtain and manipulate a NMR Hamiltonian.
Functions
| 
 | Cluster the molecule into spin-dependent cluster. | 
| Extract the NMR parameters of a cluster from the NMR parameters of the molecule. | |
| Extract the coupling matrices from a Struqture spin Hamiltonian. | |
| 
 | Identify magnetically equivalent spins and return them as groups. | 
| Gyromagnetic ratios of each spin, normalized w.r.t. | |
| 
 | Convert a Struqture spin Hamiltonian to its matrix representation. | 
- hqs_nmr.hamiltonian_tools.extract_coupling(H: PauliHamiltonian) tuple[ndarray, ndarray, ndarray]
- Extract the coupling matrices from a Struqture spin Hamiltonian. - Parameters:
- H – Struqture Spin Hamiltonian. 
- Returns:
- Array with S^z term with prefactor 2, array with the S^z-S^z coupling, array with the S^+-S^- coupling. 
 
- hqs_nmr.hamiltonian_tools.extract_cluster_nmr_parameters(molecule_parameters: NMRParameters, cluster_indices: list[int]) NMRParameters
- Extract the NMR parameters of a cluster from the NMR parameters of the molecule. - Parameters:
- molecule_parameters – The molecular isotopes, shifts and J-coupling values. 
- cluster_indices – Indices of the cluster. 
 
- Returns:
- An object storing the NMR data of the cluster Hamiltonian. 
 
- hqs_nmr.hamiltonian_tools.sh_to_matrix(H: PauliHamiltonian) ndarray[tuple[Any, ...], dtype[complexfloating]]
- Convert a Struqture spin Hamiltonian to its matrix representation. - Parameters:
- H – Struqture Spin Hamiltonian 
- Returns:
- The Spin Hamiltonian as a dense matrix (numpy array). 
 
- hqs_nmr.hamiltonian_tools.cluster_molecule(molecule_parameters: NMRParameters, gyromagnetic_ratios: dict[Isotope, float], field: float, solver_settings: NMRSolverSettings, reference_isotope: Isotope) list[Dict[str, Any]]
- Cluster the molecule into spin-dependent cluster. - Parameters:
- molecule_parameters – The molecular isotopes, shifts and J-coupling values. 
- gyromagnetic_ratios – Dictionary of gyromagnetic ratios in rad / (T s). 
- field – Magnetic field in T. 
- solver_settings – NMRSolverSettings object containing information on the clustering and solver methods. 
- reference_isotope – Isotope specified as Isotope(mass, symbol) to define the frequency (w=gamma*field) of the rotating frame. Defaults to Isotope(1, ‘H’). 
 
- Returns:
- List with a dictionary defining each spin-dependent cluster. 
 
- hqs_nmr.hamiltonian_tools.magnetically_equivalent_spins(molecule_parameters: NMRParameters, calculation_parameters: NMRCalculationParameters, tolerance_couplings: float = 1.0, tolerance_shifts: float = 1.0, verbose: int = 0) list[ndarray]
- Identify magnetically equivalent spins and return them as groups. - Parameters:
- molecule_parameters – The molecular isotopes, shifts and J-coupling values. 
- calculation_parameters – Object storing all parameters specifying how a calculation will run. 
- tolerance_couplings – Tolerance for the J-couplings in the group identifier in percent. Defaults to 1. 
- tolerance_shifts – Tolerance for the shifts in the group identifier in percent. Defaults to 1. 
- verbose – Verbosity level of output. Defaults to 0. 
 
- Returns:
- A list of integer arrays with the indices of spins in the individual groups. 
 
- hqs_nmr.hamiltonian_tools.normalized_spin_dependent_gyromagnetic_ratios(molecule_parameters: NMRParameters, gyromagnetic_ratios: dict[Isotope, float] = {(1, 'H'): 267522128.0, (13, 'C'): 67282840.0, (15, 'N'): -27126180.4, (19, 'F'): 251814800.0, (31, 'P'): 108394000.0}, reference_isotope: Isotope = (1, 'H')) ndarray
- Gyromagnetic ratios of each spin, normalized w.r.t. the gyromagnetic ratio of hydrogen. - Parameters:
- molecule_parameters – The molecular isotopes, shifts and J-coupling values. 
- gyromagnetic_ratios – Dictionary of gyromagnetic ratios in rad / (T s). Defaults to GyromagneticRatios. 
- reference_isotope – Isotope used for normalization of the gyromagnetic ratios appearing in the molecule. Defaults to DEFAULT_REFERENCE_ISOTOPE. 
 
- Returns:
- Scaled gyromagnetic ratios of each spin.