Skip to content

Add converter for determinants coming from a PySCF CAS-CI or CAS-SCF calculation. - #5005

Merged
prckent merged 10 commits into
QMCPACK:developfrom
amandadumi:pyscftoqmcpack_cas
May 29, 2024
Merged

Add converter for determinants coming from a PySCF CAS-CI or CAS-SCF calculation.#5005
prckent merged 10 commits into
QMCPACK:developfrom
amandadumi:pyscftoqmcpack_cas

Conversation

@amandadumi

Copy link
Copy Markdown
Contributor

Proposed changes

This pull request extends the pyscf converter to support multideterminant wave functions coming from CAS-CI and CAS-SCF calculations.

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

  • New feature
  • Documentation or build script changes

Does this introduce a breaking change?

  • No

What systems has this change been tested on?

Checklist

  • linux workstation
  • mac laptop

_Update the following with a yes where the items apply.

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

@amandadumi
amandadumi requested a review from anbenali May 24, 2024 02:23
@prckent

prckent commented May 24, 2024

Copy link
Copy Markdown
Contributor

Many thanks Amanda.

The test fails locally for me too, so this is not some CI quirk:

Start testing: May 24 10:21 EDT
----------------------------------------------------------
78/2619 Testing: converter_test_LiH_MSD_pyscf
78/2619 Test: converter_test_LiH_MSD_pyscf
Command: "/home/pk7/apps/spack/var/spack/environments/envgccnewmpi/.spack-env/view/bin/python3.11" "/home/pk7/projects/qmc/git_QMCPACK_prckent/build_pr/tests/converter/converter_test.py" "/home/pk7/projects/qmc/git_QMCPACK_prckent/build_pr/tests/converter/test_LiH_MSD_pyscf" "--exe" "/home/pk7/apps/spack/var/spack/environments/envgccnewmpi/.spack-env/view/bin/mpiexec -n 1 --bind-to none /home/pk7/projects/qmc/git_QMCPACK_prckent/build_pr/bin/convert4qmc" "--h5diff" "/home/pk7/apps/spack/var/spack/environments/envgccnewmpi/.spack-env/view/bin/h5diff"
Directory: /home/pk7/projects/qmc/git_QMCPACK_prckent/build_pr/tests/converter
"converter_test_LiH_MSD_pyscf" start time: May 24 10:21 EDT
Output:
----------------------------------------------------------
Unexpected number of inputs files (should be 1):  2
<end of output>
Test time =   0.04 sec
----------------------------------------------------------
Test Fail Reason:
Required regular expression not found. Regex=[  pass
]
"converter_test_LiH_MSD_pyscf" end time: May 24 10:21 EDT
"converter_test_LiH_MSD_pyscf" time elapsed: 00:00:00
----------------------------------------------------------

End testing: May 24 10:21 EDT

@prckent prckent changed the title Add converter for determinants coming from a Pyscf CAS-CI or CAS-SCF calculation. Add converter for determinants coming from a PySCF CAS-CI or CAS-SCF calculation. May 24, 2024
@prckent

prckent commented May 26, 2024

Copy link
Copy Markdown
Contributor

Test this please

@prckent
prckent self-requested a review May 28, 2024 17:35

@prckent prckent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me (LGTM)

I did a determinants only run to check the energy of the wavefunction ( 1000 blocks of 10000 steps, 48 walkers, 8 substeps, 0.5 timestep, 400 warmup) and got a good match:

 LiH.pyscf.out:CASCI E = -7.98378359954454  E(CI) = -1.08000501124573  S^2 = 0.0000000
$qmca -q ev try.s000.scalar.dat 
                            LocalEnergy               Variance           ratio 
try  series 0  -7.983708 +/- 0.000354   6.329815 +/- 0.471319   0.7928 

@prckent

prckent commented May 28, 2024

Copy link
Copy Markdown
Contributor

Test this please

@prckent

prckent commented May 29, 2024

Copy link
Copy Markdown
Contributor

Quick note that I did some tests filtering down to a single determinant. For this case the energy is still very close to the CASCI energy since the excited state determinants don't find much correlation energy in LiH. => It will be good to see this used in some more real world cases and know the energies match.

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.

3 participants