Ejemplo n.º 1
0
def test_wigner_4j_matrix_angle_03():
    ang_momentum_l = 4
    cos_beta = [-0.934, 0.4958]
    beta = np.arccos(cos_beta)
    array = np.load("tests/wigner/matrix/l=4_cx=[-0.934, 0.4958].npy")
    wigner = clib.wigner_d_matrices(ang_momentum_l, beta)
    np.testing.assert_almost_equal(array, wigner, decimal=8)
Ejemplo n.º 2
0
def test_wigner_2j_matrix_angle_01():
    ang_momentum_l = 2
    cos_beta = [-0.5498, 0.230]
    beta = np.arccos(cos_beta)
    array = np.load("tests/wigner/matrix/l=2_cx=[-0.5498, 0.230].npy")
    wigner = clib.wigner_d_matrices(ang_momentum_l, beta)
    np.testing.assert_almost_equal(array, wigner, decimal=8)
def test_single_2j_rotation_00():
    ang_momentum_l = 2
    R_in = np.asarray([0 + 0.5j, 0, 0 + 0.1j, 0, 0 - 0.5j], dtype=np.complex128)
    indexes = np.arange(5) - 2.0

    for _ in range(10):
        euler_angle = np.random.rand(3) * 2.0 * np.pi

        # single rotation
        R_out = clib.single_wigner_rotation(ang_momentum_l, euler_angle, R_in)

        exp_im_alpha = np.exp(-1j * indexes * euler_angle[0])
        R_out_p = R_in * exp_im_alpha
        wigner = clib.wigner_d_matrices(ang_momentum_l, np.asarray([euler_angle[1]]))
        R_out_p = np.dot(wigner.reshape(5, 5), R_out_p)
        exp_im_gamma = np.exp(-1j * indexes * euler_angle[2])
        R_out_p *= exp_im_gamma

        np.testing.assert_almost_equal(R_out, R_out_p, decimal=8)
Ejemplo n.º 4
0
def test_wigner_2j_matrix_angle_00():
    ang_momentum_l = 2
    beta = np.arccos(0.5)
    array = np.load("tests/wigner/matrix/l=2_cx=0.5.npy")
    wigner = clib.wigner_d_matrices(ang_momentum_l, np.asarray([beta]))
    np.testing.assert_almost_equal(array, wigner, decimal=8)