The Thomas Relativistic Electronic Structure Calculation
(TRESC) package is designed to compute the electronic structure of non-periodic
polyatomic systems within the Born-Oppenheimer approximation. It supports
Hartree-Fock and Kohn-Sham self-consistent field (HF/KS-SCF) calculations based
on a two-component (2c) second-order Douglas-Kroll-Hess (DKH2) Hamiltonian for a
given structure.
TRESC exhibits strong performance across both main-group
molecules and transition metal complexes, see /examples. The core computational
engine (called tkernel) is implemented in Fortran 2008 free format.
- HF/KS-SCF calculation is based on spherical-harmonic fragment-contracted Gaussian type orbital.
- Initial guess load from MOLDEN format file (generated by other programs, same or different basis set) or .ao2mo binary file (generated by TRESC HF/KS-SCF earlier, same basis set).
- All potential integrals are computed using the Obara-Saika scheme (2e-integrals can be switched to the Rys Quadrature scheme), and all 2e-integrals are handled using PRISM.
- Symmetric orthogonalisation of overlap matrix by default, canonical orthogonalisation will be used if basis linear dependence reaches the threshold.
- Relativistic spinor integrals based on optimal-parametrized 2nd order Douglas- Kroll-Hess(DKH2) transformation proposed by Hess et al., including DKH2 1e-integrals and DKH2 2e-integrals.
- DKH2 1e-integrals are calculated to the order
$$c^{-4}$$ , which contains scalar realativistic terms and one-electron spin-orbit coupling terms; Gaussian finite nucleus model is considered, affecting the integral value of$$\left<V\right>,\left<pVp\right>, \left<pppVp\right>$$ . - DKH2 2e-integrals are calculated to the order
$$c^{-2}$$ , which contains realativistic Coulomb, Exchange terms and so-called spin-same-orbit coupling terms; all four-center integrals utilize permutation symmetry and Cauchy-Schwarz screening technique. When the RMSDP is sufficiently small, the effect of density matrix will be considered in screening as:$$P_{\max}\sqrt{\left( \mu \nu |\mu \nu \right) \left(\sigma \lambda |\sigma \lambda \right)} \leq threshold$$ . Similar algorithm has been employed in the CP2K program. - Construct Fock matrix via direct way, which is time consuming but less demanding on memory and disk r&w.
- Grid integration are based on the Becke's fuzzy partitioning, the exchange-correlation energy and the partial derivative terms of the exchange-correlation potential are obtained by external library Libxc.
- Support for density functionals: (hybrid) LDAs, (hybrid) GGAs and (hybrid) meta-GGAs excluding long-range corrected functionals and non-local correlation, the results of non-relativistic calculation differ negligibly from the Psi4 program.
- 2c-Hamiltonian causes mixing between alpha and beta orbitals, sometimes we
want this mixing as little as possible (maintaining the initial spin state as
much as possible); in this case, should try
cspin=forcspin=d(the latter is for nearly degenerate frontier orbitals), but these methods may cause variational instability, so be sure to check the convergence of the last few iterations. - DIIS (Pulay mixing), dynamic damping, virtual orbital level shifting can be used to facilitate HF/KS-SCF process.
- Basic linear algebra is computed using LAPACK subroutines.
- 1e and 2e Fock matices construction and grid-based integration support OpenMP parallel computation and all parallel zone are thread safe.
- Outprint
$$\left< s^2 \right> \left( L\ddot{o}wdin \right)$$ , energy and orbital components. - Support dispersion correction via DFT-D4 program (stand-alone) developed by Grimme's group.
For mathematical and algorithmic details, see
docs/Mathematics_and_Algorithms.pdf.
Second Relativized Thomas Precession (SRTP) combines the
Lorentz vector feature of the spin 4-vector
Assuming that frame O' is moving along the x-axis in
frame O, the Lorentz transformation and the newly-defined transformation
lead to different observation.
observation of Lorentz transformation and newly-defined transformation
Its mathematical form can be given directly as a
nonlinear equation
where
Although this newly proposed transformation is
essentially kinematic, it dynamically alters the form of Thomas precession, as
this precession is intrinsically linked to the properties of reference frame
transformations.
Following detailed derivation, the contribution of
Thomas precession to the electronic energy in the low-velocity limit can be
expressed as
where
Then quantization and use Pauli vector rule to modify
Dirac matrices as
This formula yields the modified electron spinor
wavefunction through the DKH transformation. Furthermore, since the SRTP
correction scales as
Currently, SRTP lacks empirical support; however,
interested users can explore this effect by adding the pppVp keyword to the
%Hamiltonian block when performing DKH2 calculations.
A given spinor state
where
TRESC calculates the
where
Vis2c is a Python package designed to visualize scalar
and spinor molecular orbitals, offering three visualization methods based on
different projection spaces and grid partitioning strategies. Grid parameters of
all these methods can be changed in $TRESC/gridsettings.ini.
When TRESC finishes its HF/KS-SCF calculation, canonical
orbitals will be dumped to jobname.molden.d. With it, users can execute the
cub2c.py to generate two GAUSSIAN cube format files (contain grid data of real
and imaginary part of alpha and beta components of the selected orbital) and
then visualise the selected orbital based on the grid data automatically.
The visualisation are as follows:
HOMO-3 of triplet [Ni-C2H4], <s^2>=0.67 , <s_z>=-0.41
The visualization displays both the spin and orbital
phases; the variance in the spin phase reflects the strength of the spin-orbit
coupling (SOC) within the selected orbital. As demonstrated by the frontier
spinor orbitals in the examples/, orbitals with more nodal surfaces near heavy
atoms exhibit stronger SOC and are more susceptible to spin flipping.
Furthermore, executing cub2c.py with the -slice flag
generates cross-sectional slices of both the orbital amplitude and the spin
phase. These visualizations reveal that the amplitude slices are typically
solid, whereas the spin-phase slices appear hollow, indicating that spin
perturbations predominantly occur at the orbital phase boundaries.
spin-phase slice of HOMO-3 of triplet [Ni-C2H4], a distinctive hollow,
umbrella-shaped pattern
While structured grid data facilitates efficient
post-processing and visualization, unstructured grids become necessary in the
following three scenarios:
- Visualizing a specific orbital localized within the inner shell of a particular atom in a large molecule;
- Illustrating detailed phase changes induced by SOC in the vicinity of heavy nuclei;
- Capturing the frame-dragging effect of a rapidly moving molecule;
Vis2c supports visualization using unstructured data,
specifically Becke's fuzzy grids. By utilizing the jobname.molden.d generated
by TRESC, users can execute the mog2c.py to automatically generate the
requisite Becke grid data and visualize the selected orbital.
Momentum space is the dual of real space, where spatial
phase information is transformed into momentum amplitude. Consequently,
pro2c.py avoids complex phase plotting and instead utilizes intuitive
isosurface representations to convey all orbital information. The visualizations
are as follows:
HOMO-3 of triplet [Ni-C2H4], d-orbital in momentum space also has a
quatrefoil shape.
The momentum-space projection of a bound-state orbital is inherently centrally symmetric, exhibiting symmetry about the origin (indicated by the central black dot). Furthermore, mapping to momentum space emphasizes the particle-like nature of electrons; for instance, the conventional spatial phase-matching principle for bonding orbitals is effectively replaced by a momentum-matching principle.
TRESC allows to adjust computation by providing keywords
in each module, now list the keywords currently supported.
basis: choice of basis setgeom: XYZ geometry file in working directorycharge: charge of moleculespin: spin multiplicity of molecule
pVp1e: one-electron pVp integrals (DKH2 spinor)pVp2e: two-electron pVp integrals (DKH2 spinor)pVp: equal to pVp1e + pVp2epppVp: one-electron pppVp integrals (SRTP effect)cutS: threshold of eigenvalue of overlapping matrix for orthogonalisationthreads: number of threads in multi-threaded calculation
guess: initial guess of wavefunctionschwarz: threshold of Cauchy-Schwarz screeningdmschwarz: RMSDP threshold for considering density matrix in Cauchy-Schwarz screeningmaxiter: maximum number of SCF iterationsconvertol: SCF convergence tolerancedamp: SCF damping coefficientdiisdamp: DIIS damping coefficientnodiis: number of initial iterations without DIISsubsp: size of subspace of DIIScutdamp: cut damp when threshold is reachedcutdiis: cut DIIS when threshold is reachedprtlev: minimum AO coefficient output when SCF donecspin: constrained spin multiplicity calculationmolden: dump MOs to MOLDEN files when SCF doneemd4: DFT-D4 dispersion correctionlshift: virtual orbital energy level shift (Eh), better be in range [0.1,1]
Identity of functionals can be found at Libxc
All functionals are available except range-separated and non-local correlation
xid: identity of exchange functionalcid: identity of correlation functionalxcid: identity of exchange-correlation functional
If AVX2 / AVX512 instruction set is supported, please modify the compilation options and compiler directives (e.g. align_size) manually.
If DFT-D4 dispersion correction is involved, make sure you have install DFT-D4.
Deploy build tools by root or sudo user:
sudo apt install ninja-build
sudo apt install cmakeInstall Intel oneAPI HPC Toolkit,
and append the following to ~/.bashrc:
export ONEAPI_ROOT="/path/to/oneapi"
export PATH="$ONEAPI_ROOT/compiler/latest/bin:$PATH"Download the stable release of Libxc and build it (in oneAPI environment) by:
cmake -S . \
-B build \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_FORTRAN=ON \
-DBUILD_TESTING=OFF \
-DBUILD_FPIC=ON \
-DCMAKE_Fortran_COMPILER="${ONEAPI_ROOT}/compiler/latest/bin/ifx" \
-DCMAKE_C_COMPILER="${ONEAPI_ROOT}/compiler/latest/bin/icx" \
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -O3 -xCORE-AVX2"then
cd build && ninjaappend to ~/.bashrc after a successful build:
export LIBXC_ROOT="/path/to/libxc"Change directory to TRESC root and build it by:
chmod +x release.sh && ./release.shYou need to create an environment with
conda create --name vis2c python=3.10 numpy scipy matplotlib \
qcelemental mayavi traits traitsui pyqtgrant all .py in /vis2c executable permissions and replace the shebangs with
the path to the Python interpreter of env vis2c, it will enable you to use
scripts in any scenario. Append to ~/.bashrc when everything is done:
export TRESC="/path/to/TRESC"
export PATH="$TRESC/build:$PATH"
export PATH="$TRESC/vis2c:$PATH"
alias TRESC='tshell.sh'
alias tshell='tshell.sh'- high-performance vectorized code for 2e-integrals
- perturbation calculation;