Z2PackDev / symmetry_representation

Describing and constructing symmetry operations and their representations.
https://symmetry-representation.greschd.ch
Apache License 2.0
6 stars 4 forks source link

Norm of vector is not one #13

Open bfocassio opened 3 years ago

bfocassio commented 3 years ago

Dear @greschd, can you help me fix the following error?

Norm 0.7071067811871818 of vector [ 5.00000000e-01+0.j 5.00000000e-01+0.j 2.45018849e-15+0.j -2.90425236e-15+0.j 2.20266513e-15+0.j -5.55111512e-17+0.j 5.55111512e-17+0.j 1.49186219e-16+0.j -8.32667268e-17+0.j 1.38777878e-17+0.j] for expression 1 created from orbital Orbital(position=array([0. , 0. , 0.5]), function_string='1', function=1, spin=Spin(total=Fraction(1, 2), z_component=Fraction(1, 2))) is not one. Cartesian rotation matrix: [[ 1. -0. 0.] [ 0. 1. 0.] [ 0. 0. 1.]]

What does that mean?

greschd commented 3 years ago

Most likely, this means that one of the orbitals, once transformed by the symmetry, lies (partially) outside of the given basis.

The direct meaning of the error is that the expression, after being transformed and projected onto the basis, has a norm that is different from one.

In other words, the basis used needs to be complete w.r.t. the symmetries, otherwise the symmetry representation won't be unitary.

luckyyus commented 2 years ago

You can modify the definition of the atomic orbitals in symmetry_representation/_get_repr_matrix/_orbital_constants.py by using spherical harmonics. For example, the d orbitals can be written in: ... 'd': ['sqrt(5/16/pi)* (3*z**2-1)', 'sqrt(15/4/pi)* z*x', 'sqrt(15/4/pi)* z*y', 'sqrt(15/16/pi)* (x**2 - y**2)', 'sqrt(15/16/pi)* 2 * x*y' ], ...