Skip to content

Functions to interpret basis sets: label-to-basis-index and basis-index-to-label #257

Open

Description

@tovrstra

(This was part of #146.)

Quoting @PaulWAyers: It would be useful to have a label-to-basis-index and basis-index-to-label functionality, similar to PySCF. It would not need to be implemented exactly like this, but it would be nice to have functionality that, for a given basis function (say, the 17th) would tell you its type, contraction coefficients, exponents, center etc. (e.g., that it was the 3rd dz^2 basis function on the second atomic center). Similarly, it would be nice to be able to ask for a specific type of basis function (e.g., the 3rd dz^2 on a specified atom) and return the basis index.

Activity

  1. ARYAMANN7279 commented on Oct 9, 2026

    @ARYAMANN7279

    I'd like to take this one. Both directions come out of a single walk over shells, since conventions[(angmom, kind)] already gives the ordered labels, so there is no naming convention to invent. Working locally: a BasisFunction namedtuple plus iter_basis_functions, get_basis_function(index) and find_basis_index(label, icenter, occurrence), checked against 5 of the test fixtures where the number of walked functions matches nbasis and the first dimension of the MO coefficients. It comes to 54 lines of code but 99 with docstrings, over the 50-line guideline, so I would rather split it in two with index-to-label first. Does that split work, and should find_basis_index match a sign-flipped label like -c3 exactly, or strip the minus?

  2. PaulWAyers commented on Oct 10, 2026

    @PaulWAyers
    Member
    • It's good to split it but 54 + 45 lines is not crazy, so it's not mandatory.
    • I'm curious what @tovrstra , @msricher and @FarnazH think, but I think that it would be nice, but inessential, to keep track of the sign convention for the basis functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions