AMLab-Amsterdam / lie_learn

Computations involving Lie groups and harmonic analysis
MIT License
190 stars 47 forks source link

rotation convention mismatch with scipy.spatial.transform.Rotation #21

Open babiking opened 2 years ago

babiking commented 2 years ago

https://github.com/AMLab-Amsterdam/lie_learn/blob/07469085ac0fd4550fd26ff61cb10bb1e92cead1/lie_learn/representations/SO3/pinchon_hoggan/pinchon_hoggan_dense.py#L67

lie-learn output a Y-X-Y Euler 3D rotation within pinchon_hoggan_dense module, but not Z-Y-Z as it should be.

p.s. for wigner-D-matrix, when rotation degree L = 1, D(1, g) is a rotation matrix, i.e. R(g). Through a simple unit-test, I found the following 2 implementations are equivalent (i.e. D == R):

alpha, beta, gamma = np.random.rand(3) 2.0 np.pi

No.1 from lie_learn.representations.SO3.wigner_d import wigner_D_matrix D = wigner_D_matrix(1, alpha, beta, gamma)

No.2 from scipy.spatial.transform import Rotation R = Rotation.from_euler('YXY', [alpha, beta, gamma], degrees=False).as_matrix()

so, lie-learn mismatches with scipy on rotation convention?