(SOLVED) Loading a (buggy?) geometry.


Clicked A Few Times
When attempting to do the following geometry, I noticed that the unit cell is loaded incorrectly in my build. I tried switching around which axis the acute angle was, and got the following results. In brief, the geometry is not loaded correctly and has spurious y-values added for many of the atoms. The direction of the offset in the unit cell vectors is not consistent either (compare the second and third outputs, which both put the angled component into a3).

My compilation is 6.1.1 with no external BLAS/LAPACK. The 64-to-32 transformation makes no difference, nor does dropping the numbers after the atoms. Do you have any idea why this may be appearing here? I've noticed occasional anomalies in the geometry loading on other builds, but nothing like this. Thanks for the help diagnosing this bug.

My base geometry:
geometry        center  noautosym       noautoz print
        system  crystal
                lat_a   3.50500
                lat_b   2.47841
                lat_c   35.00000
                alpha   90.0d0
                beta    90.0d0
                gamma   54.736d0
        end
        U1      0.00    0.00    0.42487
        U2      0.50    0.00    0.35406
        U3      0.00    0.00    0.28325
        U4      0.50    0.00    0.21244
        U5      0.00    0.00    0.14162
        U6      0.50    0.00    0.07081
        U7      0.00    0.00    0.00000
end

which yields the following:
  No.       Tag          Charge          X              Y              Z
 ---- ---------------- ---------- -------------- -------------- --------------
    1 U1                  92.0000     0.00000000     0.00000000    14.87045000
    2 U2                  92.0000     1.43091714     1.01179661    12.39210000
    3 U3                  92.0000     0.00000000     0.00000000     9.91375000
    4 U4                  92.0000     1.43091714     1.01179661     7.43540000
    5 U5                  92.0000     0.00000000     0.00000000     4.95670000
    6 U6                  92.0000     1.43091714     1.01179661     2.47835000
    7 U7                  92.0000     0.00000000     0.00000000     0.00000000
 
      Lattice Parameters 
      ------------------ 
 
      lattice vectors in angstroms (scale by  1.889725989 to convert to a.u.)
 
      a1=<   2.862   2.024   0.000 >
      a2=<   0.000   2.478   0.000 >
      a3=<   0.000   0.000  35.000 >
      a=       3.505 b=      2.478 c=      35.000
      alpha=  90.000 beta=  90.000 gamma=  54.736
      omega=   248.2
 
      reciprocal lattice vectors in a.u.
 
      b1=<   1.162   0.000   0.000 >
      b2=<  -0.949   1.342   0.000 >
      b3=<   0.000   0.000   0.095 >


Using the same settings except with beta and gamma switched yields:
  No.       Tag          Charge          X              Y              Z
 ---- ---------------- ---------- -------------- -------------- --------------
    1 U1                  92.0000     8.58537573     0.00000000    12.14172997
    2 U2                  92.0000     8.90701345     0.00000000    10.11815594
    3 U3                  92.0000     5.72365118     0.00000000     8.09458191
    4 U4                  92.0000     6.04528890     0.00000000     6.07100787
    5 U5                  92.0000     2.86172455     0.00000000     4.04714807
    6 U6                  92.0000     3.18336228     0.00000000     2.02357403
    7 U7                  92.0000     0.00000000     0.00000000     0.00000000
 
      Lattice Parameters 
      ------------------ 
 
      lattice vectors in angstroms (scale by  1.889725989 to convert to a.u.)
 
      a1=<   3.505   0.000   0.000 >
      a2=<   0.000   2.478   0.000 >
      a3=<  20.207   0.000  28.578 >
      a=       3.505 b=      2.478 c=      35.000
      alpha=  90.000 beta=  54.736 gamma=  90.000
      omega=   248.2
 
      reciprocal lattice vectors in a.u.
 
      b1=<   0.949   0.000  -0.671 >
      b2=<   0.000   1.342   0.000 >
      b3=<   0.000   0.000   0.116 >

and with alpha and gamma switched gives me:
  No.       Tag          Charge          X              Y              Z
 ---- ---------------- ---------- -------------- -------------- --------------
    1 U1                  92.0000     0.00000000     8.58537573    12.14172997
    2 U2                  92.0000     1.75250000     7.15451345    10.11815594
    3 U3                  92.0000     0.00000000     5.72365118     8.09458191
    4 U4                  92.0000     1.75250000     4.29278890     6.07100787
    5 U5                  92.0000     0.00000000     2.86172455     4.04714807
    6 U6                  92.0000     1.75250000     1.43086228     2.02357403
    7 U7                  92.0000     0.00000000     0.00000000     0.00000000
 
      Lattice Parameters 
      ------------------ 
 
      lattice vectors in angstroms (scale by  1.889725989 to convert to a.u.)
 
      a1=<   3.505   0.000   0.000 >
      a2=<   0.000   2.478   0.000 >
      a3=<   0.000  20.207  28.578 >
      a=       3.505 b=      2.478 c=      35.000
      alpha=  54.736 beta=  90.000 gamma=  90.000
      omega=   248.2
 
      reciprocal lattice vectors in a.u.
 
      b1=<   0.949   0.000   0.000 >
      b2=<   0.000   1.342  -0.949 >
      b3=<   0.000   0.000   0.116 >

Forum Vet
I am not 100% sure I am following all the details of this bug report.
I have analyzed the output you are getting when gamma=54.736 and I see the coordinates in the cartesian frame being printed correctly.
As you can see from the output lines for the lattice vectors, a2 (a.k.a. b lattice vector) coincides with the y cartesian axis,
while a1 (a.k.a. a lattice vector) has both x and y components. Therefore, because of this orientation of the
cartesian axis with respect to the original crystallographic axis, you are getting the coordinates printed in the output file.
For example, the atomic positions for the second atom
U2      0.50    0.00    0.35406
correspond to
1.43091714 1.01179661 12.39210000
Let's neglect the simple z coordinates and focus on x and y. The point (0.5,0.) is on the a1 lattice vector.
With some simple trigonometry, you can see that the cartesian coordinate will correspond to (0.5*a1*sin(gamma), 0.5*a1*cos(gamma))

Cheers, Edo

Clicked A Few Times
OK, based on Edo's response to my confusion, I went back to the maths to see where I may be thinking about this incorrectly.

One peculiarity of NWChem seems to be that the geometry is always aligned along the y-axis via the a2 vector. These test cases illustrate this apparent outcome (all for lat_a = lat_b = lat_c = 1.0):
      Lattice Parameters 
      ------------------ 
      a1=<   0.707   0.707   0.000 >
      a2=<   0.000   1.000   0.000 >
      a3=<   0.000   0.000   1.000 >
      a=       1.000 b=      1.000 c=       1.000
      alpha=  90.000 beta=  90.000 gamma=  45.000



      Lattice Parameters 
      ------------------ 
      a1=<   1.000   0.000   0.000 >
      a2=<   0.000   1.000   0.000 >
      a3=<   0.707   0.000   0.707 >
      a=       1.000 b=      1.000 c=       1.000
      alpha=  90.000 beta=  45.000 gamma=  90.000



      Lattice Parameters 
      ------------------ 
      a1=<   1.000   0.000   0.000 >
      a2=<   0.000   1.000   0.000 >
      a3=<   0.000   0.707   0.707 >
      a=       1.000 b=      1.000 c=       1.000
      alpha=  45.000 beta=  90.000 gamma=  90.000



      Lattice Parameters 
      ------------------ 
      a1=<   1.000   0.000   0.000 >
      a2=<   0.000   1.000   0.000 >
      a3=<   0.707   0.707   0.000 >
      a=       1.000 b=      1.000 c=       1.000
      alpha=  45.000 beta=  45.000 gamma=  90.000



      Lattice Parameters 
      ------------------ 
      a1=<   0.707   0.707   0.000 >
      a2=<   0.000   1.000   0.000 >
      a3=<  -0.707   0.707   0.000 >
      a=       1.000 b=      1.000 c=       1.000
      alpha=  45.000 beta=  90.000 gamma=  45.000



      Lattice Parameters 
      ------------------ 
      a1=<   0.707   0.707   0.000 >
      a2=<   0.000   1.000   0.000 >
      a3=<   1.000   0.000   0.000 >
      a=       1.000 b=      1.000 c=       1.000
      alpha=  90.000 beta=  45.000 gamma=  45.000



      Lattice Parameters 
      ------------------ 
      a1=<   0.707   0.707   0.000 >
      a2=<   0.000   1.000   0.000 >
      a3=<   0.293   0.707   0.644 >
      a=       1.000 b=      1.000 c=       1.000
      alpha=  45.000 beta=  45.000 gamma=  45.000


What was throwing me was that I intuitively expected a1 to remain the base, rather than a2, so when I have a non-right-angle gamma, I expected to see the change in a2, not a1. In my case, this means that I have to figure a1 from a2, instead of the other way around, as a2 will apparently align with the y-axis no matter what in NWChem.

Thanks a lot, Edo.


Forum >> NWChem's corner >> Running NWChem