Development of computer codes for calculating the molecular g-matrix using the state-interaction (SI) procedure.
This repository contains Python programs developed to compute magnetic g-matrices through the state-interaction (SI) approach.
The workflow consists of two main post-processing stages:
- Parsing Q-Chem outputs to extract relevant electronic structure data (state energies, spin–orbit couplings, and angular momentum matrix elements) [1]
- Computing the g-matrix based on the SI effective Hamiltonian formalism.
Electronic structure calculations are performed with a developer version of Q-Chem 6.0, which provides all the quantities required by the SI scheme. The evaluation of the g-matrix is carried out with in-house codes integrated within PyQChem and ezMagnet frameworks.
The SI procedure constructs and diagonalizes an effective Hamiltonian whose:
- diagonal elements correspond to the non-relativistic state energies, and
- off-diagonal elements contain the spin–orbit coupling (SOC) matrix elements.
The resulting spin–orbit-coupled states are linear combinations of the non-relativistic states.
Two implementations are available:
- Bolvin’s approach, for systems with doublet multiplicity [2]
- Tatchen’s method, for arbitrary spin multiplicities [3]
This framework enables a detailed rationalization of g-shifts, analyzing how excitation energies, SOCs, and orbital angular momenta jointly determine magnetic anisotropy.
- Computation of the molecular g-tensor from Q-Chem output files.
- Support for RAS-CI, TDDFT and EOM calculations.
- JSON-based intermediate representation of extracted electronic data.
- Modular structure for integration into larger workflows (e.g., PyQChem, ezMagnet).
Python ≥ 3.8 and the following packages: numpy json decimal pymatgen
(Other built-in modules such as warnings, sys, hashlib, and operator are used internally.)
| File | Description |
|---|---|
parser_eom.py |
Parses Q-Chem EOM-CC outputs and generates a .json input for g-tensor calculation. |
parser_rasci.py |
Parses Q-Chem RAS-CI outputs and generates a .json input for g-tensor calculation. |
gtensor.py |
Computes the g-tensor from the generated .json data file. |
Simple command-line workflow:
# For EOM outputs
python parser_eom.py example_eom.out
python gtensor.py example_eom.json > example_eom_results.out
# For RAS-CI outputs
python parser_rasci.py example_ras.out
python gtensor.py example_ras.json > example_ras_results.out- [1] A. Krylov et al., Q-Chem 6.0 (developer version)
- [2] Bolvin, H. (2006). ChemPhysChem: A European Journal of Chemical Physics and Physical Chemistry, 7(7), 1575-1589.
- [3] Tatchen, J., Kleinschmidt, M., & Marian, C. M. (2009). The Journal of chemical physics, 130(15).
Antonio Cebreiro
📍 Molecular Electronic Structure Group at the Donostia International Physics Centre (DIPC)
This project is distributed for research and educational use. Please cite appropriately if used in scientific publications.