-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package: | ||
name: "sphecerix" | ||
version: "0.3.0" | ||
version: "0.4.0" | ||
|
||
source: | ||
path: . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.3.0" | ||
__version__ = "0.4.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import unittest | ||
import numpy as np | ||
import sys | ||
import os | ||
from scipy.spatial.transform import Rotation as R | ||
|
||
# add a reference to load the Sphecerix library | ||
sys.path.append(os.path.join(os.path.dirname(__file__), '..')) | ||
|
||
# import functions | ||
from sphecerix import tesseral_wigner_D_improper | ||
|
||
class TestImproperRotation(unittest.TestCase): | ||
""" | ||
Test improper rotation matrices | ||
""" | ||
|
||
def test_improper_s4(self): | ||
""" | ||
Test the result under an improper rotation | ||
""" | ||
# construct 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) | ||
|
||
# assert that determinant is -1 | ||
np.testing.assert_almost_equal(np.linalg.det(D), -1) | ||
|
||
# rotate a point at +x,+y,+z under S4 to -x,-y,+z | ||
# 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])) | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |