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

convert h5 orbs from spherical to Cartesian #4364

Open
wants to merge 20 commits into
base: develop
Choose a base branch
from

Conversation

kgasperich
Copy link
Contributor

Proposed changes

Added a utility to convert pyscf h5 orbitals from spherical to Cartesian AO basis.

I still need to check the normalization for the different shells, but all of the framework is in place.

The PyscfToQmcpack converter doesn't seem to correctly handle cases where different atoms of the same element have different basis sets, so I didn't account for that in this converter either (it will be simple to update this converter when PyscfToQmcpack is updated).

What type(s) of changes does this code introduce?

  • New feature

Does this introduce a breaking change?

  • No

Update the following with a yes where the items apply. If you're unsure about any of them, don't hesitate to ask. This is
simply a reminder of what we are going to look for before merging your code.

  • Yes. This PR is up to date with current the current state of 'develop'
  • No. Code added or changed in the PR has been clang-formatted
  • No. This PR adds tests to cover any new code, or to catch a bug that is being fixed
  • No. Documentation has been added (if appropriate)

print(m)
return m

s2cdict = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some documentation about what the numbers mean in this structure?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I'm still moving some factors around, but I plan to add more documentation

Copy link
Contributor Author

@kgasperich kgasperich Dec 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a description there.

It's not my ideal solution (I should just add a function to generate these for arbitrary l/m), but I wanted to get something working first, and this was simple.
I squared everything so that I could keep an array of values with terminating decimal expansions.

I haven't noticed any issues with accumulation of floating-point errors yet, but I should probably consider whether that might become a problem for high enough angular momenta.
(This actually led me to your jupyter notebooks yesterday: I grepped for factorial while trying to decide whether to take a product of ratios prod(a_i/b_i) or a ratio of products prod(a_i)/prod(b_i) and found a comment that mentioned the GaussianOrbitals notebook from the qmc_algorithms repo)

Copy link
Contributor

@anbenali anbenali Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prckent @kgasperich

I tested this and it works and solves the #5205 issue. Can we merge it?

@kgasperich
Copy link
Contributor Author

kgasperich commented Apr 19, 2023

I think the only thing left to do here is to clean up the tests.
Here is a summary of the testing steps:

  1. run small pyscf calculation in each of several basis sets (sp, sd, sf, sg, ...) [Done*]
    1. *need to change the string back to 'pdfghi' here;
      it was shortened to save time while the test workflow is ironed out
  2. for each basis, call converter to generate cartesian hdf5 input [Done*]
    1. *as above, need to add sf sg sh si back to the loop
  3. for each basis, use convert4qmc to generate xml inputs from hdf5 [needs to be added as cmake test]
  4. run short VMC with same seed for sph and cart inputs [needs to be added as cmake test]
  5. verify that sph/cart outputs agree [needs to be done in a cleaner way (maybe with check_scalars.py) and added as a cmake test]

@anbenali anbenali marked this pull request as ready for review October 18, 2024 16:45
@anbenali anbenali changed the title [WIP] convert h5 orbs from spherical to Cartesian convert h5 orbs from spherical to Cartesian Oct 18, 2024
@ye-luo
Copy link
Contributor

ye-luo commented Oct 20, 2024

Could you expand the documentation mentioning spherical vs Cartesian and this tool that helps converting under LCAO to make this tool visible.

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

Successfully merging this pull request may close these issues.

5 participants