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

Basis issue orderings #45

Open
vivacebelles opened this issue Apr 23, 2018 · 5 comments
Open

Basis issue orderings #45

vivacebelles opened this issue Apr 23, 2018 · 5 comments

Comments

@vivacebelles
Copy link

vivacebelles commented Apr 23, 2018

Overall, we'd like to address the ordering of the molecular orbitals, particularly in how the Cartesian order is formatted. The Molden format can be found here. However, there seems to a disconnect in the codes in emulating the same ordering. There is not a way to extend the handwritten code in a suitable manner. So, in order to start off the discussion, an outline of the current status is summarized here. If there is anything that's been misinterpreted or missing, please feel free to add!

While Molden and GAMESS seem to follow the convention, Andy Simmonett has pointed out some inconsistencies through the FHCK file for Psi4. Ed Valeev's libint code also contains code to support basis function ordering, with some minor inconsistencies with the Molden format.

Cartesian coordinates

  • Currently, for s, p, d formats we should be expecting the following from the Molden format:
Molden format (expected) Andy's work [FHCK/Psi4] Ed's work [GAMESS/libint]
S: 0 S: 0 S: 0
P: X, Y, Z P: Z, X, Y P: X, Y, Z
D: XX, YY, ZZ, XY, XZ, YZ D: XX, XY, XZ, YY, YZ, ZZ D: XX, YY, ZZ, XY, YZ, XZ
F: XXX, YYY, ZZZ, XXY, XXZ, XZZ, XYY, YZZ, YZZ, XYZ F: XXX, XXY, XXZ, XYY, XYZ, XZZ, YYY, YYZ, YZZ, ZZZ F: XXX, YYY, ZZZ, XXY, XXZ, XYY, YYZ, XZZ, YZZ, XYZ
G: XXXX, YYYY, ZZZZ, XXYY, XXXZ, XYYY, YYYZ, XZZZ, YZZZ, XXYY, XXZZ, YYZZ, XXYZ, XYYZ, XYZZ G: XXXX, XXXY, XXXZ, XXYY, XXYZ, XXZZ, XYYY, XYYZ, XYZZ, XZZZ, YYYY, YYYZ, YYZZ, YZZZ, ZZZZ G: XXXX, YYYY, ZZZZ, XXXY, XXXZ, XYYY, YYYZ, XZZZ, YZZZ, XXYY, XXZZ, YYZZ, XXYZ, XYYZ, XYZZ

A more organized layout can be seen in this screenshot:
screen shot 2018-04-23 at 1 47 30 pm

  • Part of the issue that can contribute to the non-standardization of the Cartesian formatting is the lexical nature of the various codes. Angular momentum is denoted as "l" in FHCK and "am" in libint's work. In Molden, you can call the Cartesian format by the number of available orbitals in the systems and the term denoting the orbital type. For example, [6D] calls all six d-orbital Cartesian functions (xx, yy, zz, xy, xz, yz)

  • There needs to be a discussion as well in terms of organizing the row order of how the Cartesian functions are to come out.

Iterator example

Once we've come to terms on what the ordering is, the next effort would be developing a small code that would iterate out the desired format across all systems. Daniel Smith (@dgasmith ) wrote this:

def row_cartesian_order(L):
    idx = -1
    for i in range(L + 1):
        l = L - i
        for j in range(i + 1):
            m = i - j
            n = j
            idx += 1
            yield (idx, L, m, n)

and the iterator will print out the Cartesian orders as:

This is the order for s orbitals:
(0, 0, 0, 0)
This is the order for p orbitals:
(0, 1, 0, 0)
(1, 1, 1, 0)
(2, 1, 0, 1)
This is the order for d orbitals:
(0, 2, 0, 0)
(1, 2, 1, 0)
(2, 2, 0, 1)
(3, 2, 2, 0)
(4, 2, 1, 1)
(5, 2, 0, 2)
This is the order for f orbitals:
(0, 3, 0, 0)
(1, 3, 1, 0)
(2, 3, 0, 1)
(3, 3, 2, 0)
(4, 3, 1, 1)
(5, 3, 0, 2)
(6, 3, 3, 0)
(7, 3, 2, 1)
(8, 3, 1, 2)
(9, 3, 0, 3)
This is the order for g orbitals:
(0, 4, 0, 0)
(1, 4, 1, 0)
(2, 4, 0, 1)
(3, 4, 2, 0)
(4, 4, 1, 1)
(5, 4, 0, 2)
(6, 4, 3, 0)
(7, 4, 2, 1)
(8, 4, 1, 2)
(9, 4, 0, 3)
(10, 4, 4, 0)
(11, 4, 3, 1)
(12, 4, 2, 2)
(13, 4, 1, 3)
(14, 4, 0, 4)

Spherical coordinates

In addition to the Cartesian orbital formats, we should pin down what the standard format for the spherical coordinates should be. Currently, the Molden format has this structure for orbitals:

Molden format (expected) * NWChem
S: 0 S: 0
P: 0, +1, -1 P: -1, 0, +1
D: 0, +1, -1, +2, -2 D: -2, -1, 0, +1, +2
F: 0, +1, -1, +2, -2, +3, -3 F: -3, -2, -1, 0, +1, +2, +3
G: 0, +1, -1, +2, -2, +3, -3, +4, -4 G: -4, -3, -2, -1, 0, +1, +2, +3, +4

*Psi4 and libint share Molden's format for spherical coordinates

Edits:
04/27/2018- added in spherical coordinates for computational programs stated by @wadejong and @dgasmith which includes adding NWChem to the mix.
04/23/2018- minor edits to make the table reader-friendly; linked Daniel in at iterator section.

@wadejong
Copy link
Collaborator

wadejong commented Apr 23, 2018 via email

@dgasmith
Copy link
Collaborator

Psi4 uses the Molden format as shown for spherical, looks like libint does as well.

@langner
Copy link

langner commented Apr 24, 2018

Here is the cclib perspective on this topic. Ordering and naming of orbitals has been a major pain point, due to differences between programs and ambiguity. Our approach has been to parse the numbers and names separately and just expose them, sidestepping any interpretation or validation.

@tovrstra
Copy link
Contributor

This is part of the problem discussed in #12. Not only ordering needs to be agreed upon, in some codes sign conventions also differ, alas.

@tovrstra
Copy link
Contributor

Also worth noting is that, despite the documentation of the ordering in the Molden format, several programs (including old versions of PSI4) did not follow these conventions. We've implemented a hacky solution for this, to detect which of the known variations is being used by a file, just to demonstrate how unpleasant it can get:

https://github.com/theochem/iodata/blob/master/iodata/molden.py#L510

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

5 participants