-
Notifications
You must be signed in to change notification settings - Fork 2
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
Tuto det #1
base: master
Are you sure you want to change the base?
Tuto det #1
Conversation
I realized that PySCF registers the ERI in the MO group of TREXIO. Since I even wonder if it might be better to add a parameter to the
Let me know your thoughts. |
|
||
# Save results in TREXIO format | ||
trexio_file = 'rhf.hdf5' | ||
to_trexio(mf, trexio_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please define where all your functions come from. If you try to run your Jupyter notebook as it is right now - the execution will fail because to_trexio
and a bunch of other TREXIO-related functions will not be found.
Since this is a tutorial for newcomers - we try to be more pedagogic and give more details so that the user always knows where the functions come from. In your case, for example, one can do:
from pyscf.tools import trexio as pyscf_trexio
pyscf_trexio.to_trexio(...)
|
||
## Importing TREXIO | ||
|
||
TREXIO is avialble throught the pyscf-forge repository (https://github.com/pyscf/pyscf-forge). After installing PySCF-FORGE, you can access the TREXIO library within PySCF using the following import statement: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the text for typos (e.g. avialble
here)
The ```det_to_trexio``` function registers the number of MO, number of alpha and beta electrions, total number of determinants, coefficients and the determinants in bitfield format. | ||
|
||
## Applying a Threshold for Determinants | ||
You can filter determinants by their coefficients, saving only those that exceed a specified threshold: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not recommended as you might produce an inconsistent wave function data (see Anthony's comment elsewhere). Please remove this section.
import trexio | ||
|
||
filename = 'data_for_qp2.hdf5' | ||
trexio_file = trexio.File(filename, mode='w', back_end=trexio.TREXIO_HDF5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use a context handling here, e.g.
with trexio.File(filename, mode='w', back_end=trexio.TREXIO_HDF5) as trexio_file:
#Index of the current state: 0 is the GS
trexio_file.set_state(0)
#Total number of states
trexio.write_state_num(trexio_file,1)
This way, you do not need to manually close the file via .close()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @NastaMauger !
I left a few comments. My main concern is that at present, the notebook is not functional as it is missing:
- A practical example of the PySCF Molecule/SCF setup. Perhaps you can provide some simple small molecule like H2O (or some other molecule that you use for your tests) as an example here?
- The imported functions are not defined and so if you try to run the notebook - you will get a bunch of errors stemming from the fact that the functions could not be found. Since this is a tutorial for newcomers who do not necessarily know the
pyscf-forge
source code - more details are needed.
Hello,
Here is the tutorial for PySCF + TREXIO with the determinants feature.
Let me know if any further modifications are needed.
Best