mcodev31 / libmsym

molecular point group symmetry lib
MIT License
73 stars 33 forks source link

example.c failed to generate SALCs for d4d molecule #38

Open L1yuu opened 2 months ago

L1yuu commented 2 months ago

Hello, I am using libmsym's C interface to generate SALCs for wave function analysis. But when I tried to generate SALCs for D(2n)d (n >= 2) with example.c, the program will abort with error message: "Error generating subspaces: Could not determine partner functions in 2 dimensional space". Is this a bug?

Full program output:

Comment: d4d
Molecule has center of mass [0.000000; 0.000000; 0.000000] and a radius of 2.371502
Found point group [0] D4d with 17 subgroups:
         [0] D4d
         -------
         [1] S8
         [2] C4
         [3] C2
         [4] Cs
         [5] Cs
         [6] Cs
         [7] Cs
         [8] C2
         [9] C2
         [10] C2
         [11] C2
         [12] C4v
         [13] D4
         [14] C2v
         [15] C2v
         [16] D2
         [17] D2

Choose point group to use [0-17]:0

Would you like to add basis functions? [y/N]:y
Basis functions can be added to entire molecule [0] or any of 1 symmetrically equivalent sets:
         [0] Entire molecule
         [1] 8S

Choose set of elements [0-1]:0

Select principal quantum number (n) [1-21]:1

Select angular momentum quantum number (l) [0-0]:0
Will add 8 real spherical harmonics basis functions with n=1 l=0 m=[0,0] to entire molecule

Would you like to add more basis functions? [y/N]:N
Adding 8 basis functions

Would you like to print the symmetry elements? [y/N]:N
Error Error generating subspaces: Could not determine partner functions in 2 dimensional space

the d4d molecule coordinate file

8
d4d
 S                 -1.63794679    1.63794679   -0.50821455
 S                 -2.31640657    0.00000000    0.50821455
 S                 -0.00000000    2.31640657    0.50821455
 S                 -1.63794679   -1.63794679   -0.50821455
 S                  1.63794679    1.63794679   -0.50821455
 S                  0.00000000   -2.31640657    0.50821455
 S                  2.31640657    0.00000000    0.50821455
 S                  1.63794679   -1.63794679   -0.50821455
mcodev31 commented 2 months ago

This looks like a bug yes. The splitting operation is not generating a basis for the space in E2. I think I have an idea why, but it's been almost a decade since I wrote this code and I'm in a completely different field now, so need a little more time to examine.

mcodev31 commented 2 months ago

I have pushed a fix for this. It was ready last week, but I had some authentication issues, then life happened.

For those interested: Subduction is used as a splitting field in order to separate degenerate irreps, and a "splitting operation" is used to rotate within the degenerate space to create a similarly oriented basis. The issue was with the splitting operation selected for D2nd. It was the primary op (like most groups) but you can see if you look at those groups it will just invert the basis vector and hence it can't be used to generate that space.

Edit: The new splitting operation for D2nd is now S4n, other groups remain the same.