Skip to content

Commit

Permalink
Expanding documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ifilot committed Jun 21, 2023
1 parent ce92e3e commit 66f4b4f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions sphecerix/wignerd.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,27 @@ def tesseral_wigner_D_improper(l, Robj):
------
TypeError
If the Robj object is not of type scipy.spatial.transform.R.
Examples
--------
>>> from sphecerix import tesseral_wigner_D_improper
... from scipy.spatial.transform import Rotation as R
... import numpy as np
...
... # construct (improper) rotation vector
... axis = np.array([1,0,0])
... Robj = R.from_rotvec(axis * np.pi / 2)
...
... # construct wigner D matrix
... D = tesseral_wigner_D_improper(1, Robj)
...
... print(D)
[[ 7.49879891e-33 -1.00000000e+00 1.83697020e-16]
[ 1.00000000e+00 -2.24963967e-32 -1.83697020e-16]
[-1.83697020e-16 -1.83697020e-16 -1.00000000e+00]]
Construct the Wigner-D matrix for the tesseral p-orbitals for an improper
rotation by 90 degrees around the cartesian x-axis.
"""
# verify that Robj is a rotation object
if not isinstance(Robj, R):
Expand Down
1 change: 1 addition & 0 deletions tests/test_improper_rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def test_improper_s4(self):
# note that the ordering in the vector (using increasing value of m)
# is [y,z,x]
np.testing.assert_almost_equal(D @ np.array([1,1,1]), np.array([-1,1,-1]))
print(D)

if __name__ == '__main__':
unittest.main()

0 comments on commit 66f4b4f

Please sign in to comment.