-
Notifications
You must be signed in to change notification settings - Fork 50
Implemented the ECP part and added several missing factors in the TREXIO interface. #68
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
Merged
+239
−18
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
163c2e5
Implemented ECPs
kousuke-nakano 63c677b
Implemented the ECP part and added several missing factors in the TRE…
kousuke-nakano 3556fd5
make mol.atom_charge(i) a list also for an atom.
kousuke-nakano 6949296
Implemented PBC for Gamma point (real wavefunction).
kousuke-nakano 7408933
Merge branch 'pyscf:master' into master
kousuke-nakano db9cde9
Revert "Implemented PBC for Gamma point (real wavefunction)."
kousuke-nakano bbdda7f
Merge branch 'master' into master
kousuke-nakano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,114 @@ | ||
| import pyscf | ||
| from pyscf.tools import trexio | ||
|
|
||
| def test_mol(): | ||
| filename = 'test.h5' | ||
| mol = pyscf.M(atom='H 0 0 0; F 0 0 1', basis='6-31g**') | ||
| def test_mol_ae_6_31g(): | ||
| filename = 'test_mol_ae_6_31g_sphe.h5' | ||
| mol = pyscf.M(atom='H 0 0 0; F 0 0 1', basis='6-31g**', cart=False) | ||
| ref = mol.intor('int1e_ovlp') | ||
| trexio.to_trexio(mol, filename) | ||
| mol = trexio.mol_from_trexio(filename) | ||
| s1 = mol.intor('int1e_ovlp') | ||
| assert abs(ref - s1).max() < 1e-12 | ||
|
|
||
| filename = 'test_mol_ae_6_31g_cart.h5' | ||
| mol = pyscf.M(atom='H 0 0 0; F 0 0 1', basis='6-31g**', cart=True) | ||
| ref = mol.intor('int1e_ovlp') | ||
| trexio.to_trexio(mol, filename) | ||
| mol = trexio.mol_from_trexio(filename) | ||
| s1 = mol.intor('int1e_ovlp') | ||
| assert abs(ref - s1).max() < 1e-12 | ||
|
|
||
| def test_mf(): | ||
| filename = 'test1.h5' | ||
| mol = pyscf.M(atom='H 0 0 0; F 0 0 1', basis='6-31g*') | ||
| def test_mol_ccecp_ccpvqz(): | ||
| filename = 'test_mol_ccecp_ccpvqz_sphe.h5' | ||
| mol = pyscf.M(atom='H 0 0 0; F 0 0 1', basis='ccecp-cc-pVQZ', ecp='ccECP', cart=False) | ||
| # ref = mol.intor('int1e_ovlp') | ||
| trexio.to_trexio(mol, filename) | ||
| ''' Todo: mol_from_trexio for ecp is yet implemented. | ||
| mol = trexio.mol_from_trexio(filename) | ||
| s1 = mol.intor('int1e_ovlp') | ||
| assert abs(ref - s1).max() < 1e-12 | ||
| ''' | ||
|
|
||
| filename = 'test_mol_ccecp_ccpvqz_cart.h5' | ||
| mol = pyscf.M(atom='H 0 0 0; F 0 0 1', basis='ccecp-cc-pVQZ', ecp='ccECP', cart=True) | ||
| # ref = mol.intor('int1e_ovlp') | ||
| trexio.to_trexio(mol, filename) | ||
| ''' Todo: mol_from_trexio for ecp is yet implemented. | ||
| mol = trexio.mol_from_trexio(filename) | ||
| s1 = mol.intor('int1e_ovlp') | ||
| assert abs(ref - s1).max() < 1e-12 | ||
| ''' | ||
|
|
||
| ''' Todo: it does not work due to the internal contraction in PySCF | ||
| def test_mol_ae_ccpvdz(): | ||
| filename = 'test_mol_ae_ccpvdz_sphe.h5' | ||
| mol = pyscf.M(atom='H 0 0 0; F 0 0 1', basis='ccpvdz', cart=False) | ||
| ref = mol.intor('int1e_ovlp') | ||
| trexio.to_trexio(mol, filename) | ||
| mol = trexio.mol_from_trexio(filename) | ||
| s1 = mol.intor('int1e_ovlp') | ||
| assert abs(ref - s1).max() < 1e-12 | ||
|
|
||
| filename = 'test_mol_ae_ccpvdz_cart.h5' | ||
| mol = pyscf.M(atom='H 0 0 0; F 0 0 1', basis='ccpvdz', cart=True) | ||
| ref = mol.intor('int1e_ovlp') | ||
| trexio.to_trexio(mol, filename) | ||
| mol = trexio.mol_from_trexio(filename) | ||
| s1 = mol.intor('int1e_ovlp') | ||
| assert abs(ref - s1).max() < 1e-12 | ||
| ''' | ||
|
|
||
| def test_mf_ae_6_31g(): | ||
| filename = 'test_mf_ae_6_31g_sphe.h5' | ||
| mol = pyscf.M(atom='H 0 0 0; F 0 0 1', basis='6-31g*', cart=False) | ||
| mf = mol.RHF().run() | ||
| print(mf.mo_coeff) | ||
| trexio.to_trexio(mf, filename) | ||
| mf1 = trexio.scf_from_trexio(filename) | ||
| assert abs(mf1.mo_coeff - mf.mo_coeff).max() < 1e-12 | ||
| trexio.write_eri(mf._eri, filename) | ||
| eri = trexio.read_eri(filename) | ||
| assert abs(mf._eri - eri).max() < 1e-12 | ||
|
|
||
| filename = 'test_mf_ae_6_31g_cart.h5' | ||
| mol = pyscf.M(atom='H 0 0 0; F 0 0 1', basis='6-31g*', cart=True) | ||
| mf = mol.RHF().run() | ||
| print(mf.mo_coeff) | ||
| trexio.to_trexio(mf, filename) | ||
| mf1 = trexio.scf_from_trexio(filename) | ||
| assert abs(mf1.mo_coeff - mf.mo_coeff).max() < 1e-12 | ||
| trexio.write_eri(mf._eri, filename) | ||
| eri = trexio.read_eri(filename) | ||
| assert abs(mf._eri - eri).max() < 1e-12 | ||
|
|
||
| def test_mf_ccecp_ccpvqz(): | ||
| filename = 'test_mf_ccecp_ccpvqz_sphe.h5' | ||
| mol = pyscf.M(atom='H 0 0 0; F 0 0 1', basis='ccecp-cc-pVQZ', ecp='ccECP', cart=False) | ||
| mf = mol.RHF().run() | ||
| trexio.to_trexio(mf, filename) | ||
| ''' Todo: scf_from_trexio for ecp is yet implemented. | ||
| mf1 = trexio.scf_from_trexio(filename) | ||
| assert abs(mf1.mo_coeff - mf.mo_coeff).max() < 1e-12 | ||
| trexio.write_eri(mf._eri, filename) | ||
| eri = trexio.read_eri(filename) | ||
| assert abs(mf._eri - eri).max() < 1e-12 | ||
| ''' | ||
|
|
||
| filename = 'test_mf_ccecp_ccpvqz_cart.h5' | ||
| mol = pyscf.M(atom='H 0 0 0; F 0 0 1', basis='ccecp-cc-pVQZ', ecp='ccECP', cart=True) | ||
| mf = mol.RHF().run() | ||
| trexio.to_trexio(mf, filename) | ||
| ''' Todo: scf_from_trexio for ecp is yet implemented. | ||
| mf1 = trexio.scf_from_trexio(filename) | ||
| assert abs(mf1.mo_coeff - mf.mo_coeff).max() < 1e-12 | ||
| trexio.write_eri(mf._eri, filename) | ||
| eri = trexio.read_eri(filename) | ||
| assert abs(mf._eri - eri).max() < 1e-12 | ||
| ''' | ||
|
|
||
| if __name__ == "__main__": | ||
| #test_mol_ae_6_31g() | ||
| #test_mol_ccecp_ccpvqz() | ||
| #test_mol_ae_ccpvdz() | ||
| #test_mf_ae_6_31g() | ||
| test_mf_ccecp_ccpvqz() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.