-
Notifications
You must be signed in to change notification settings - Fork 8
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
NAO functionality, FCIDUMP & spherical->cartesian converter #30
Conversation
Merge with updated upstream
Merge with upstream repository.
OK @scemama, ping me when you are done. We need to upload also test files to the |
out_index = np.array([i+1 for i in range(n_act)]) | ||
|
||
# If the orbitals are spin-dependent, the order alpha-beta-alpha-beta... | ||
# should be used for ouput (as it is expected e.g. by NECI) |
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.
Here, the FCIDUMP file that you will produce will not correspond any more to the TREXIO file. If there is already a CI wave function inside the file, the signs of the CI coefficients will be wrong because the phase of the determinants will change.
I don't think that the convention chosen by NECI is universal, because when you use the non-interleaved ordering, you can organize easily the integral tensor in blocks.
It would be better to have a command line option that enables swapping orbitals, which would be false by default. When the orbitals are swapped, we should print a warning on the screen to inform the user that the orbital indices in the FCIDUMP don't correspond to those of the 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.
Are we fixing this here or in another MR?
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.
I would prefer that we fix it here because it is important.
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.
So I wait for the fix before reviewing
@scemama I just remembered that As a temporary workaround for the text back end - remove the sparse data files manually in the converter. You should be able to get the file back end from the |
OK. Let's not do this in this PR. For the moment, we can leave if trexio.has_ao_2e_int_eri(inp):
print("Warning: Two-electron integrals are not converted")
trexio.delete_ao_2e_int_eri(out)
if trexio.has_ao_2e_int_eri_lr(inp):
trexio.delete_ao_2e_int_eri_lr(out) as it was before. I will try to find a solution in TREXIO for the text backend, and then we can make the change in trexio_tools. |
It does not make sense. The way it was before is wrong and broken. It was removing the dataset ( if trexio.has_ao_2e_int(inp):
print("Warning: Two-electron integrals are not converted")
trexio.delete_ao_2e_int(out) And remove manually sparse dataset files in case of text back end. |
OK, I didn't get it. So if we do: if trexio.has_ao_2e_int(inp):
print("Warning: Two-electron integrals are not converted")
trexio.delete_ao_2e_int(out) and don't remove the files, the TREXIO file will be correct, and there will just be unused files present in the directory, but the group will not be accessible anymore. Correct? |
@scemama sorry for the confusion. Look at the current code (and also what you suggested above): if trexio.has_ao_2e_int_eri(inp):
print("Warning: Two-electron integrals are not converted")
trexio.delete_ao_2e_int_eri(out)
if trexio.has_ao_2e_int_eri_lr(inp):
trexio.delete_ao_2e_int_eri_lr(out) The Now even if we use the existing function |
@q-posev OK, so let's make the code correct by removing the group, and then we will fix the text back-end to remove the files. |
The two points discussed above have been addressed. |
Thanks @joguenzl ! I can merge this PR as is, we have a problem in the CI due to a bug in PySCF->TREXIO converter, but this will be fixed elsewhere. |
This pull request contains a number of smaller changes.
The converter from TREXIO to FCIDUMP is implemented into the Python codebase. The Fortran implementation is removed since it did not handle core orbitals correctly and is now obsolete. The new implementation was tested extensively with FCIQMC calculations.
The conversion script from spherical harmonics to cartesian angular functions is changed. The counting of orbitals in the target format is altered so that it works if the values in the ao_shell array are not monotonous, which is an implied assumption in the current implementation. Futhermore, basis_shell_factor and basis_r_power are modified during the conversion. This breaks compatibility with older code, but is to my understanding necessary as discussed in part with @scemama. This was tested with DMC calculations using QMCkl and QMC=Chem on NAO basis sets.
Functionality for NAO basis sets is added to check_basis. check_basis is made to print the diagonal entries at the end since those are the most important ones.
Some of the commits are about a converter script to generate a TREXIO file from FHI-aims output. This converter has since been made obsolete because FHI-aims now directly generates TREXIO output. It is kept in the commit history should it be of relevance
for future testing.
A TREXIO file containing the water molecule in a NAO basis set (in spherical harmonics) is provided in the attached archive for testing: water-nao-tier2.zip