It seems like get_repr_matrix can not compute the orbital-representation of some rotations, like for example the 3-fold rotation {{0,0,1},{1,0,0},{0,1,0}} of d-orbtials. I think the problem can be traced back to _expr_to_vector, where this function tries to in this example represent x^2 ( the z^2 orbital after the 3-fold rotation) as a linear combination of z^2, xz, yz, x^2 - y^2, xy, which is not possible. Although it should obviously be possible to represent the 3-fold rotation in the d-orbital basis.
One could instead implement the orbital representation using a rotation operator https://en.wikipedia.org/wiki/Rotation_operator_(quantum_mechanics).
It seems like get_repr_matrix can not compute the orbital-representation of some rotations, like for example the 3-fold rotation {{0,0,1},{1,0,0},{0,1,0}} of d-orbtials. I think the problem can be traced back to _expr_to_vector, where this function tries to in this example represent x^2 ( the z^2 orbital after the 3-fold rotation) as a linear combination of z^2, xz, yz, x^2 - y^2, xy, which is not possible. Although it should obviously be possible to represent the 3-fold rotation in the d-orbital basis.
One could instead implement the orbital representation using a rotation operator https://en.wikipedia.org/wiki/Rotation_operator_(quantum_mechanics).