Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with i<k|(r-Rc)Xp|n> while interfacing to stda program #50

Closed
mdewergi opened this issue Jan 12, 2021 · 8 comments
Closed

problem with i<k|(r-Rc)Xp|n> while interfacing to stda program #50

mdewergi opened this issue Jan 12, 2021 · 8 comments

Comments

@mdewergi
Copy link

mdewergi commented Jan 12, 2021

I am trying to modernize the stda program by removing its old integral deck, replacing it by libcint, also allowing new types of integrals that were not available. This is working perfectly fine for the overlap, dipole moment, and <i|nabla|j> integrals for which I can reproduce values obtained by our integral deck (see https://github.com/grimme-lab/stda/blob/master/intslvm.f and https://github.com/grimme-lab/stda/blob/master/intpack.f90).

But I have some issues with i<k|(r-Rc)Xp|n> type of integrals while using exactly the same interface, just replacing the name of the subroutine by cint1e_cg_irxp_cart. Note that everything is done with cartesian basis functions and that I have well defined Rc in env.

For integrals on the same atom, few elements have the reverse sign while others are ok for this skew-symmetric matrix.
For <d| |d> integrals, <dyy| |dxy>, <dzz| |dxz>, and <dzz| |dyz> signs are swapped with their counterpart.
For <f| |f> integrals, I have the same issue with <fzzz| |fxxy>, <fyyy| |fxxz>, <fyyy| |fyyx>, <fzzz| |fyyx>, <fyyy| |fxzz>, <fzzz| |fxzz>, <fzzz| |fyzz>, <fyyz| |fxzz>, <fyyz| |fxyz>, <fxzz| |fxyz>, and <fyzz| |fxyz>. All others are ok.

In addition to this, for integrals between two different atoms, I obtained different values than with our integral deck for <s| |fxxx>, <s| |fyyy>, <s| |fzzz>, <p| |fxxx>, <p| |fyyy>, <p| |fzzz>, <dxx| |dxx>, <dyy| |dyy>, <dzz| |dzz>, and almost all <f| |f>. Note that for <dxx| |dxx>, <dyy| |dyy>, and <dzz| |dzz> the sign is also wrong.

Those are what I was able to identify with small models.

Here are some examples:

1° case
For H- with one set of d orbitals:

[Atoms] Angs
  H      1    1      0.00000000      0.00000000      0.00000000
[GTO]
1    0
d    1    1.000000
   2.06200000E+00    1.00000000E+00
--------------           1 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
--------------           2 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
--------------           3 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
--------------           4 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
--------------           5 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
--------------           6 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
--------------           7 --------------magnetic_moment
old              0.00000             0.00000            -1.15470
new              0.00000             0.00000            -1.15470
--------------           8 --------------magnetic_moment
old              0.00000             0.00000             1.15470
new              0.00000             0.00000            -1.15470
**********************
--------------           9 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
--------------          10 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
--------------          11 --------------magnetic_moment
old              0.00000             1.15470             0.00000
new              0.00000             1.15470             0.00000
--------------          12 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
--------------          13 --------------magnetic_moment
old              0.00000            -1.15470             0.00000
new              0.00000             1.15470             0.00000
**********************
--------------          14 --------------magnetic_moment
old             -1.00000             0.00000             0.00000
new             -1.00000             0.00000             0.00000
--------------          15 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
--------------          16 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
--------------          17 --------------magnetic_moment
old             -1.15470             0.00000             0.00000
new             -1.15470             0.00000             0.00000
--------------          18 --------------magnetic_moment
old              1.15470             0.00000             0.00000
new             -1.15470             0.00000             0.00000
**********************
--------------          19 --------------magnetic_moment
old              0.00000             1.00000             0.00000
new              0.00000             1.00000             0.00000
--------------          20 --------------magnetic_moment
old              0.00000             0.00000            -1.00000
new              0.00000             0.00000            -1.00000
--------------          21 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000

These are the upper triangle of the skew-symmetric matrix where d orbitals are ordered as dxx dyy dzz dxy dxz dyz. Thus, 8, 13, and 18 are <dyy| |dxy>, <dzz| |dxz>, and <dzz| |dyz>, respectively.

2° case
Same system with one set of f functions.

[Atoms] Angs
  H      1    1      0.00000000      0.00000000      0.00000000
[GTO]
1    0
f    1    1.000000
   1.39700000E+00    1.00000000E+00
 --------------           1 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------           2 --------------magnetic_moment
old              0.00000             0.00000            -0.60000
new              0.00000             0.00000            -0.60000
 --------------           3 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------           4 --------------magnetic_moment
old              0.00000             0.60000             0.00000
new              0.00000             0.60000             0.00000
 --------------           5 --------------magnetic_moment
old             -0.60000             0.00000             0.00000
new             -0.60000             0.00000             0.00000
 --------------           6 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------           7 --------------magnetic_moment
old              0.00000             0.00000            -1.34164
new              0.00000             0.00000            -1.34164
 --------------           8 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------           9 --------------magnetic_moment
old              0.44721             0.00000             0.00000
new             -0.44721             0.00000             0.00000
 **********************
 --------------          10 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          11 --------------magnetic_moment
old              0.00000             1.34164             0.00000
new              0.00000             1.34164             0.00000
 --------------          12 --------------magnetic_moment
old             -0.44721             0.00000             0.00000
new              0.44721             0.00000             0.00000
 **********************
 --------------          13 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          14 --------------magnetic_moment
old             -1.00000             0.00000             0.00000
new             -1.00000             0.00000             0.00000
 --------------          15 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          16 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          17 --------------magnetic_moment
old              0.00000             0.00000             1.34164
new              0.00000             0.00000            -1.34164
 **********************
 --------------          18 --------------magnetic_moment
old              0.00000            -0.44721             0.00000
new              0.00000             0.44721             0.00000
 **********************
 --------------          19 --------------magnetic_moment
old              0.00000             0.00000            -1.00000
new              0.00000             0.00000            -1.00000
 --------------          20 --------------magnetic_moment
old              0.00000            -0.33333             0.00000
new              0.00000            -0.33333             0.00000
 --------------          21 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          22 --------------magnetic_moment
old              0.00000             0.44721             0.00000
new              0.00000             0.44721             0.00000
 --------------          23 --------------magnetic_moment
old             -1.34164             0.00000             0.00000
new             -1.34164             0.00000             0.00000
 --------------          24 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          25 --------------magnetic_moment
old             -0.33333             0.00000             0.00000
new             -0.33333             0.00000             0.00000
 --------------          26 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          27 --------------magnetic_moment
old              0.00000             1.00000             0.00000
new              0.00000             1.00000             0.00000
 --------------          28 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          29 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          30 --------------magnetic_moment
old              0.00000             0.00000             0.44721
new              0.00000             0.00000            -0.44721
 **********************
 --------------          31 --------------magnetic_moment
old              0.00000            -1.34164             0.00000
new              0.00000             1.34164             0.00000
 **********************
 --------------          32 --------------magnetic_moment
old              0.00000             0.00000             0.33333
new              0.00000             0.00000             0.33333
 --------------          33 --------------magnetic_moment
old              0.00000             1.00000             0.00000
new              0.00000             1.00000             0.00000
 --------------          34 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          35 --------------magnetic_moment
old              0.00000            -0.33333             0.00000
new              0.00000             0.33333             0.00000
 **********************
 --------------          36 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          37 --------------magnetic_moment
old              0.00000             0.00000            -0.44721
new              0.00000             0.00000            -0.44721
 --------------          38 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          39 --------------magnetic_moment
old              1.34164             0.00000             0.00000
new             -1.34164             0.00000             0.00000
 **********************
 --------------          40 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          41 --------------magnetic_moment
old              0.33333             0.00000             0.00000
new              0.33333             0.00000             0.00000
 --------------          42 --------------magnetic_moment
old              0.00000             0.00000            -0.33333
new              0.00000             0.00000            -0.33333
 --------------          43 --------------magnetic_moment
old             -1.00000             0.00000             0.00000
new             -1.00000             0.00000             0.00000
 --------------          44 --------------magnetic_moment
old              0.00000             0.00000            -1.00000
new              0.00000             0.00000            -1.00000
 --------------          45 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          46 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          47 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          48 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          49 --------------magnetic_moment
old              0.00000             1.15470             0.00000
new              0.00000             1.15470             0.00000
 --------------          50 --------------magnetic_moment
old              0.00000             0.00000            -1.15470
new              0.00000             0.00000            -1.15470
 --------------          51 --------------magnetic_moment
old             -1.15470             0.00000             0.00000
new             -1.15470             0.00000             0.00000
 --------------          52 --------------magnetic_moment
old              0.00000             0.00000             1.15470
new              0.00000             0.00000            -1.15470
 **********************
 --------------          53 --------------magnetic_moment
old              1.15470             0.00000             0.00000
new             -1.15470             0.00000             0.00000
 **********************
 --------------          54 --------------magnetic_moment
old              0.00000            -1.15470             0.00000
new              0.00000             1.15470             0.00000
 **********************
 --------------          55 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000

The f functions are ordered as fxxx, fyyy, fzzz, fxxy, fxxz, fyyx, fyyz, fxzz, fyzz, and fxyz. As for the case above, the upper diagonal is printed and problematic elements are <fzzz| |fxxy>, <fyyy| |fxxz>, <fyyy| |fyyx>, <fzzz| |fyyx>, <fyyy| |fxzz>, <fzzz| |fxzz>, <fzzz| |fyzz>, <fyyz| |fxzz>, <fyyz| |fxyz>, <fxzz| |fxyz>, and <fyzz| |fxyz>.

3° case
For CH4 with s functions on H and one set of f functions for the carbon.

[Atoms] Angs
  C      1    6     -0.00000000      0.00000000      0.00000000
  H      2    1     -0.61776480      0.61776480      0.61776480
  H      3    1      0.61776480     -0.61776480      0.61776480
  H      4    1      0.61776480      0.61776480     -0.61776480
  H      5    1     -0.61776480     -0.61776480     -0.61776480
[GTO]
1    0
f    1    1.000000
   1.41900000E+00    1.00000000E+00 

2    0
s    1    1.000000
   7.97700000E-01    1.00000000E+00 

3    0
s    1    1.000000
   7.97700000E-01    1.00000000E+00 

4    0
s    1    1.000000
   7.97700000E-01    1.00000000E+00 

5    0
s    1    1.000000
   7.97700000E-01    1.00000000E+00 
 --------------           1 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------           2 --------------magnetic_moment
old              0.00000             0.00000            -0.60000
new              0.00000             0.00000            -0.60000
 --------------           3 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------           4 --------------magnetic_moment
old              0.00000             0.60000             0.00000
new              0.00000             0.60000             0.00000
 --------------           5 --------------magnetic_moment
old             -0.60000             0.00000             0.00000
new             -0.60000             0.00000             0.00000
 --------------           6 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------           7 --------------magnetic_moment
old              0.00000             0.00000            -1.34164
new              0.00000             0.00000            -1.34164
 --------------           8 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------           9 --------------magnetic_moment
old              0.44721             0.00000             0.00000
new             -0.44721             0.00000             0.00000
 **********************
 --------------          10 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          11 --------------magnetic_moment
old              0.00000             1.34164             0.00000
new              0.00000             1.34164             0.00000
 --------------          12 --------------magnetic_moment
old             -0.44721             0.00000             0.00000
new              0.44721             0.00000             0.00000
 **********************
 --------------          13 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          14 --------------magnetic_moment
old             -1.00000             0.00000             0.00000
new             -1.00000             0.00000             0.00000
 --------------          15 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          16 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          17 --------------magnetic_moment
old              0.00000             0.00000             1.34164
new              0.00000             0.00000            -1.34164
 **********************
 --------------          18 --------------magnetic_moment
old              0.00000            -0.44721             0.00000
new              0.00000             0.44721             0.00000
 **********************
 --------------          19 --------------magnetic_moment
old              0.00000             0.00000            -1.00000
new              0.00000             0.00000            -1.00000
 --------------          20 --------------magnetic_moment
old              0.00000            -0.33333             0.00000
new              0.00000            -0.33333             0.00000
 --------------          21 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          22 --------------magnetic_moment
old              0.00000             0.44721             0.00000
new              0.00000             0.44721             0.00000
 --------------          23 --------------magnetic_moment
old             -1.34164             0.00000             0.00000
new             -1.34164             0.00000             0.00000
 --------------          24 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          25 --------------magnetic_moment
old             -0.33333             0.00000             0.00000
new             -0.33333             0.00000             0.00000
 --------------          26 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          27 --------------magnetic_moment
old              0.00000             1.00000             0.00000
new              0.00000             1.00000             0.00000
 --------------          28 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          29 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          30 --------------magnetic_moment
old              0.00000             0.00000             0.44721
new              0.00000             0.00000            -0.44721
 **********************
 --------------          31 --------------magnetic_moment
old              0.00000            -1.34164             0.00000
new              0.00000             1.34164             0.00000
 **********************
 --------------          32 --------------magnetic_moment
old              0.00000             0.00000             0.33333
new              0.00000             0.00000             0.33333
 --------------          33 --------------magnetic_moment
old              0.00000             1.00000             0.00000
new              0.00000             1.00000             0.00000
 --------------          34 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          35 --------------magnetic_moment
old              0.00000            -0.33333             0.00000
new              0.00000             0.33333             0.00000
 **********************
 --------------          36 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          37 --------------magnetic_moment
old              0.00000             0.00000            -0.44721
new              0.00000             0.00000            -0.44721
 --------------          38 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          39 --------------magnetic_moment
old              1.34164             0.00000             0.00000
new             -1.34164             0.00000             0.00000
 **********************
 --------------          40 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          41 --------------magnetic_moment
old              0.33333             0.00000             0.00000
new              0.33333             0.00000             0.00000
 --------------          42 --------------magnetic_moment
old              0.00000             0.00000            -0.33333
new              0.00000             0.00000            -0.33333
 --------------          43 --------------magnetic_moment
old             -1.00000             0.00000             0.00000
new             -1.00000             0.00000             0.00000
 --------------          44 --------------magnetic_moment
old              0.00000             0.00000            -1.00000
new              0.00000             0.00000            -1.00000
 --------------          45 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          46 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          47 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          48 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          49 --------------magnetic_moment
old              0.00000             1.15470             0.00000
new              0.00000             1.15470             0.00000
 --------------          50 --------------magnetic_moment
old              0.00000             0.00000            -1.15470
new              0.00000             0.00000            -1.15470
 --------------          51 --------------magnetic_moment
old             -1.15470             0.00000             0.00000
new             -1.15470             0.00000             0.00000
 --------------          52 --------------magnetic_moment
old              0.00000             0.00000             1.15470
new              0.00000             0.00000            -1.15470
 **********************
 --------------          53 --------------magnetic_moment
old              1.15470             0.00000             0.00000
new             -1.15470             0.00000             0.00000
 **********************
 --------------          54 --------------magnetic_moment
old              0.00000            -1.15470             0.00000
new              0.00000             1.15470             0.00000
 **********************
 --------------          55 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          56 --------------magnetic_moment
old              0.00000             0.21382            -0.21382
new              0.00000             0.20626            -0.20626
***********************
 --------------          57 --------------magnetic_moment
old             -0.21382             0.00000            -0.21382
new             -0.20626            -0.00000            -0.20626
***********************
 --------------          58 --------------magnetic_moment
old              0.21382             0.21382             0.00000
new              0.20626             0.20626             0.00000
***********************
 --------------          59 --------------magnetic_moment
old             -0.15374            -0.13497            -0.01877
new             -0.15374            -0.13497            -0.01877
 --------------          60 --------------magnetic_moment
old              0.15374             0.01877             0.13497
new              0.15374             0.01877             0.13497
 --------------          61 --------------magnetic_moment
old              0.13497             0.15374            -0.01877
new              0.13497             0.15374            -0.01877
 --------------          62 --------------magnetic_moment
old              0.01877             0.15374            -0.13497
new              0.01877             0.15374            -0.13497
 --------------          63 --------------magnetic_moment
old             -0.13497             0.01877            -0.15374
new             -0.13497             0.01877            -0.15374
 --------------          64 --------------magnetic_moment
old             -0.01877             0.13497            -0.15374
new             -0.01877             0.13497            -0.15374
 --------------          65 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new             -0.00000            -0.00000             0.00000
 --------------          66 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          67 --------------magnetic_moment
old              0.00000             0.21382             0.21382
new              0.00000             0.20626             0.20626
***********************
 --------------          68 --------------magnetic_moment
old             -0.21382             0.00000             0.21382
new             -0.20626            -0.00000             0.20626
***********************
 --------------          69 --------------magnetic_moment
old             -0.21382            -0.21382             0.00000
new             -0.20626            -0.20626             0.00000
***********************
 --------------          70 --------------magnetic_moment
old             -0.15374            -0.13497             0.01877
new             -0.15374            -0.13497             0.01877
 --------------          71 --------------magnetic_moment
old             -0.15374            -0.01877             0.13497
new             -0.15374            -0.01877             0.13497
 --------------          72 --------------magnetic_moment
old              0.13497             0.15374             0.01877
new              0.13497             0.15374             0.01877
 --------------          73 --------------magnetic_moment
old             -0.01877            -0.15374            -0.13497
new             -0.01877            -0.15374            -0.13497
 --------------          74 --------------magnetic_moment
old             -0.13497             0.01877             0.15374
new             -0.13497             0.01877             0.15374
 --------------          75 --------------magnetic_moment
old             -0.01877             0.13497             0.15374
new             -0.01877             0.13497             0.15374
 --------------          76 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          77 --------------magnetic_moment
old             -0.02810            -0.02810             0.00000
new             -0.02810            -0.02810             0.00000
 --------------          78 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          79 --------------magnetic_moment
old              0.00000            -0.21382            -0.21382
new              0.00000            -0.20626            -0.20626
***********************
 --------------          80 --------------magnetic_moment
old              0.21382             0.00000             0.21382
new              0.20626            -0.00000             0.20626
***********************
 --------------          81 --------------magnetic_moment
old              0.21382            -0.21382             0.00000
new              0.20626            -0.20626             0.00000
***********************
 --------------          82 --------------magnetic_moment
old              0.15374            -0.13497             0.01877
new              0.15374            -0.13497             0.01877
 --------------          83 --------------magnetic_moment
old              0.15374            -0.01877             0.13497
new              0.15374            -0.01877             0.13497
 --------------          84 --------------magnetic_moment
old              0.13497            -0.15374            -0.01877
new              0.13497            -0.15374            -0.01877
 --------------          85 --------------magnetic_moment
old              0.01877            -0.15374            -0.13497
new              0.01877            -0.15374            -0.13497
 --------------          86 --------------magnetic_moment
old             -0.13497            -0.01877            -0.15374
new             -0.13497            -0.01877            -0.15374
 --------------          87 --------------magnetic_moment
old              0.01877             0.13497             0.15374
new              0.01877             0.13497             0.15374
 --------------          88 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000            -0.00000             0.00000
 --------------          89 --------------magnetic_moment
old              0.02810             0.00000             0.02810
new              0.02810             0.00000             0.02810
 --------------          90 --------------magnetic_moment
old              0.00000            -0.02810            -0.02810
new              0.00000            -0.02810            -0.02810
 --------------          91 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000
 --------------          92 --------------magnetic_moment
old              0.00000            -0.21382             0.21382
new              0.00000            -0.20626             0.20626

***********************
 --------------          93 --------------magnetic_moment
old              0.21382             0.00000            -0.21382
new              0.20626            -0.00000            -0.20626
***********************
 --------------          94 --------------magnetic_moment
old             -0.21382             0.21382             0.00000
new             -0.20626             0.20626             0.00000
***********************
 --------------          95 --------------magnetic_moment
old              0.15374            -0.13497            -0.01877
new              0.15374            -0.13497            -0.01877
 --------------          96 --------------magnetic_moment
old             -0.15374             0.01877             0.13497
new             -0.15374             0.01877             0.13497
 --------------          97 --------------magnetic_moment
old              0.13497            -0.15374             0.01877
new              0.13497            -0.15374             0.01877
 --------------          98 --------------magnetic_moment
old             -0.01877             0.15374            -0.13497
new             -0.01877             0.15374            -0.13497
 --------------          99 --------------magnetic_moment
old             -0.13497            -0.01877             0.15374
new             -0.13497            -0.01877             0.15374
 --------------         100 --------------magnetic_moment
old              0.01877             0.13497            -0.15374
new              0.01877             0.13497            -0.15374
 --------------         101 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new             -0.00000             0.00000             0.00000
 --------------         102 --------------magnetic_moment
old              0.00000             0.02810            -0.02810
new              0.00000             0.02810            -0.02810
 --------------         103 --------------magnetic_moment
old             -0.02810             0.00000             0.02810
new             -0.02810             0.00000             0.02810
 --------------         104 --------------magnetic_moment
old              0.02810            -0.02810             0.00000
new              0.02810            -0.02810             0.00000
 --------------         105 --------------magnetic_moment
old              0.00000             0.00000             0.00000
new              0.00000             0.00000             0.00000

Same problem for f functions as above and in addition we have issues with <s| |fxxx>, <s| |fyyy>, and <s| |fzzz> integrals.

Other issues can be revealed in the same way. Can you help me with this?
Many thanks,
Marc

@sunqm
Copy link
Owner

sunqm commented Jan 12, 2021 via email

@mdewergi
Copy link
Author

Thank you for your answer but this is not a problem of ordering because I have already taken care to convert libcint orbital ordering to stda one. This is also why overlap, dipole moment in both length and velocity representations are computed correctly and that I am able to compute oscillator strengths and polarizabilities also correctly.

Here, if I take the first example for the x component. The matrix should be :
[[ 0. , 0. , 0. , 0. , -0. , 0. ],
[ 0. , 0. , 1. , 0. , 0. , 0. ],
[ 0. , -1. , 0. , 0. , 0. , 0. ],
[ 0. , 0. , 0. , 0. , 1.155, 0. ],
[-0. , 0. , 0. , -1.155, 0. , -1.155],
[ 0. , 0. , 0. , 0. , 1.155, 0. ]]
where both sign are reversed with respect to what you obtained.
This is what our integral subroutine are giving.

@sunqm
Copy link
Owner

sunqm commented Jan 13, 2021 via email

@mdewergi
Copy link
Author

Thanks a lot for helping me with this! I have checked this and this is not at the level of the vector product that the difference occurs.
The difference is already there when computing i<k|rp|n>.
Still with the same example for the x component, with libcint, y_pz is

0.000 | 0.000 | 0.000 | 0.000 | 0.167 | 0.000
0.000 | 0.000 | 0.167 | 0.000 | 0.000 | 0.000
0.000 | -0.167 | 0.000 | 0.000 | 0.000 | 0.000
0.000 | 0.000 | 0.000 | 0.000 | 0.500 | 0.000
-0.167 | 0.000 | 0.000 | -0.500 | 0.000 | 0.167
0.000 | 0.000 | 0.000 | 0.000 | -0.167 | 0.000

and for z_py

0.000 | 0.000 | 0.000 | 0.000 | 0.167 | 0.000
0.000 | 0.000 | -0.167 | 0.000 | 0.000 | 0.000
0.000 | 0.167 | 0.000 | 0.000 | 0.000 | 0.000
0.000 | 0.000 | 0.000 | 0.000 | -0.167 | 0.000
-0.167 | 0.000 | 0.000 | 0.167 | 0.000 | 0.5
0.000 | 0.000 | 0.000 | 0.000 | -0.5 | 0.000

But with stda subroutines, elements in bold have the sign reversed.

@sunqm
Copy link
Owner

sunqm commented Jan 14, 2021 via email

@mdewergi
Copy link
Author

Unfortunately, I cannot compute <\nabla i|j> with our more than 20 years old stda integral deck (already used before stda), at least in a straightforward manner. I am just comparing results between both integral decks not mixing them. My motivation for this is because when I use only libcint only, optical rotations and rotary strengths are wrong. Meaning that e.g. CH4 has a non-zero optical rotation value. The interfacing is pretty simple in a way since I only need to feed data to the library and extract integrals with values in the right order. Then it transforms them to the MO basis to uses it. Since it is working well for the overlap and the dipole moments (for real systems, with r and nabla operators, both length and velocity representations), there is no reason it should not work for the magnetic moment.

Here, the difference is that the magnetic moment is skew-symmetric and not symmetric. But this should not be affected by the interfacing. Yesterday, I did a lot of testing and printing, again. In the int1e_irp subroutine, the sign is actually given by the nabla part, g1 computed by G1E_D_J.

I thought a bit about this and in fact, to be sure we are right, we can reformulate the problem for the first example as this:
With libcint, I obtain this matrix for the x component:
[[ 0. , 0. , 0. , 0. , -0. , 0. ],
[ 0. , 0. , 1. , 0. , 0. , 0. ],
[ 0. , -1. , 0. , 0. , 0. , 0. ],
[ 0. , 0. , 0. , 0. , 1.155, 0. ],
[-0. , 0. , 0. , -1.155, 0. , 1.155],
[ 0. , 0. , 0. , 0. , -1.155, 0. ]]

while with stda, I have
[[ 0. , 0. , 0. , 0. , -0. , 0. ],
[ 0. , 0. , 1. , 0. , 0. , 0. ],
[ 0. , -1. , 0. , 0. , 0. , 0. ],
[ 0. , 0. , 0. , 0. , 1.155, 0. ],
[-0. , 0. , 0. , -1.155, 0. , -1.155],
[ 0. , 0. , 0. , 0. , 1.155, 0. ]]

In other words, libcint gives

i<dyy|(r-R)Xp|dyz>=-<dzz| |dyz>=<dyz| |dzz>=-<dyz| |dyy>

while stda gives

i<dyy|(r-R)Xp|dyz>=<dzz| |dyz>=-<dyz| |dzz>=-<dyz| |dyy>

So, if I look to orbital symmetries, they are all in the same yz plan where going from <dyy| |dyz> to <dzz| |dyz>, dyy has rotated of 90° to result to dzz. For libcint, doing so changes the integral sign while for stda, this is not the case. So the question is which one is right and for what reason the other one gives the reverse sign?

Of course, this is not answering other examples for which some of the values are different.

@sunqm
Copy link
Owner

sunqm commented Jan 15, 2021 via email

@mdewergi
Copy link
Author

Yes you are right i<dzz|rxp|dyz> is positive while i<dyy|rxp|dyz> is negative.
There should be a strange convention in the stda program that I cannot put my hand on...

@sunqm sunqm closed this as completed Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants