This repo contains a script to calculate the transformation matrix for real
spherical harmonics (
I.e., the rotated real spherical harmonics (
Where
The rotation matrix (
where
For technical details, see: J. Phys. Chem. 1996, 100, 15, 6342–634
- numpy
from rotsph import rotsph
import numpy as np
# basis rotation matrix
r=np.matrix([[1,0,1],[0,1,0],[-1,0,1]])
# for f orbtials, we use "3".
R = rotsph.get_R_mat(3,r)
print(R)
In normal DFT codes, orbital projections are usually done with real atomic orbitals that are oriented on the canonical Cartesian axes. However, this may not be compatible with the crystal symmetries and may render difficulties in bonding analysis.
The transfomration matrix generated here can be used to construct optimally oriented local orbitals and can be applied to the canonical projection coefficients to get the projection coefficients on the rotated frame. I.e., get projection coefficients obtained by projecting wavefunctions on to atomic orbitals on the rotated frame.
This feature has been implemented (see example/manual_rotation) and an routine that performes automatic search of the best Euler angles is also implemented (see example/automatic_rotation).
One key difference between this rotation based method and the diagonalization
based method (e.g., diag_basis
in QuantumEspresso)
is that here the relative orbital orientation is completely fixed. This is
because the diagonalization based method has
@software{rotsph,
author = {Chengcheng Xiao},
title = {rotsph: a code to calculate the rotation matrix of real spherical harmonics},
url = {https://github.com/Chengcheng-Xiao/RotSph},
year = {2024}
}
RotSph is released under the MIT license.