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

TREXIO + MCSCF wavefunction #92

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

NastaMauger
Copy link
Contributor

@NastaMauger NastaMauger commented Dec 20, 2024

Hello,

In this PR, you will find modifications that allow users to register an MCSCF function in the TREXIO format.

I am uncertain if additional data must be stored for TREXIO to function correctly with other software and to return the corresponding wave function produced by PySCF before registering it into TREXIO. However, the corresponding HDF5 file generated using the following code:

mcscf = mcscf.casci_symm.CASCI(rhf, norb, nelec)
mcscf.fcisolver = selected_ci_spin0_symm.SelectedCI(rhf)

mcscf.kernel()
trexio_file = 'data_mcscf.hdf5'
pyscf_trexio.to_trexio(mcscf, trexio_file)

pyscf_trexio.det_to_trexio(mcscf, norb, nelec, trexio_file)
eri = mol.intor('int2e')
pyscf_trexio.write_eri(eri, trexio_file)

seems to register the data correctly.

Please let me know if further modifications or improvements are necessary. I am also uncertain whether the one-electron MO group is essential, as mentione here. I would also appreciate any feedback on whether the write_eri function needs to be modified to handle CASCI/CASSCF, particularly for the corresponding active space

Best

@q-posev
Copy link

q-posev commented Jan 2, 2025

Thank you @NastaMauger !

I noticed that you do not register the CI determinants as part of your new mcscf_to_trexio. Is it intended?

@q-posev
Copy link

q-posev commented Jan 2, 2025

I guess the best test of the validity of the produced multi-configurational TREXIO wavefunction is via an attempt to import and use it in some software that handles such wave functions (e.g. QP2)? @NastaMauger @scemama

@@ -434,10 +464,6 @@ def det_to_trexio(mcscf, norb, nelec, filename, backend='h5', ci_threshold=0., c
with trexio.File(filename, 'u', back_end=_mode(backend)) as tf:
if trexio.has_determinant(tf):
trexio.delete_determinant(tf)
trexio.write_mo_num(tf, mo_num)
trexio.write_electron_up_num(tf, len(a))
Copy link

Choose a reason for hiding this comment

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

Why is this removed? We need the number of up and down electrons to perform the CI determinants "correctness" check before writing them in the file.

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