-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added few more tests: two for IP- and EA-CRCC(2,3) and one for UHF-CC…
…SDT on F2.
- Loading branch information
1 parent
d9f1994
commit f0a2b83
Showing
4 changed files
with
104 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"""EA-EOMCCSD(2h-1p) computation used to describe the spectrum of the | ||
open-shell CH molecule by attaching an electron to closed-shell CH+.""" | ||
|
||
import pytest | ||
from pathlib import Path | ||
import numpy as np | ||
from ccpy import Driver | ||
|
||
TEST_DATA_DIR = str(Path(__file__).parents[1].absolute() / "data") | ||
|
||
@pytest.mark.short | ||
def test_eaeom2_chplus(): | ||
driver = Driver.from_gamess( | ||
logfile=TEST_DATA_DIR + "/chplus/chplus.log", | ||
fcidump=TEST_DATA_DIR + "/chplus/chplus.FCIDUMP", | ||
nfrozen=0, | ||
) | ||
driver.system.print_info() | ||
|
||
driver.run_cc(method="ccsd") | ||
driver.run_hbar(method="ccsd") | ||
driver.run_guess(method="eacisd", multiplicity=-1, nact_occupied=3, nact_unoccupied=8, | ||
roots_per_irrep={"A1": 2, "B1": 2, "B2": 2, "A2": 2}) | ||
driver.run_eaeomcc(method="eaeom2", state_index=[0, 1, 2, 3, 4, 5, 6, 7]) | ||
driver.run_lefteaeomcc(method="left_eaeom2", state_index=[0, 1, 2, 3, 4, 5, 6, 7]) | ||
driver.run_eaccp3(method="creacc23", state_index=[0, 1, 2, 3, 4, 5, 6, 7]) | ||
|
||
# | ||
# Check the results | ||
# | ||
expected_vee = [-0.19558721, -0.16826126, -0.37794266, -0.08109635, -0.37794266, -0.08109635, -0.29285023, -0.19558721] | ||
expected_crcc23 = [-38.2862219438, -38.2467552810, -38.3950222424, -38.0988834026, -38.3950222424, -38.0988834026, -38.3741059608, -38.2881834536] | ||
for i, (vee, veep3) in enumerate(zip(expected_vee, expected_crcc23)): | ||
assert np.allclose(driver.vertical_excitation_energy[i], vee, atol=1.0e-07, rtol=1.0e-07) | ||
assert np.allclose(driver.system.reference_energy + driver.correlation_energy + driver.vertical_excitation_energy[i] + driver.deltap3[i]["D"], veep3, atol=1.0e-07, rtol=1.0e-07) | ||
|
||
if __name__ == "__main__": | ||
test_eaeom2_chplus() |
This file contains 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
spherical | ||
|
||
**** | ||
C 0 | ||
S 9 1.00 | ||
6.665000D+03 6.920000D-04 | ||
1.000000D+03 5.329000D-03 | ||
2.280000D+02 2.707700D-02 | ||
6.471000D+01 1.017180D-01 | ||
2.106000D+01 2.747400D-01 | ||
7.495000D+00 4.485640D-01 | ||
2.797000D+00 2.850740D-01 | ||
5.215000D-01 1.520400D-02 | ||
1.596000D-01 -3.191000D-03 | ||
S 9 1.00 | ||
6.665000D+03 -1.460000D-04 | ||
1.000000D+03 -1.154000D-03 | ||
2.280000D+02 -5.725000D-03 | ||
6.471000D+01 -2.331200D-02 | ||
2.106000D+01 -6.395500D-02 | ||
7.495000D+00 -1.499810D-01 | ||
2.797000D+00 -1.272620D-01 | ||
5.215000D-01 5.445290D-01 | ||
1.596000D-01 5.804960D-01 | ||
S 1 1.00 | ||
1.596000D-01 1.000000D+00 | ||
S 1 1.00 | ||
0.0469000 1.0000000 | ||
P 1 1.00 | ||
1.517000D-01 1.000000D+00 | ||
P 1 1.00 | ||
0.0404100 1.0000000 | ||
D 1 1.00 | ||
5.500000D-01 1.0000000 | ||
**** | ||
|
This file contains 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import numpy as np | ||
from pyscf import scf, gto | ||
from ccpy import Driver | ||
|
||
def test_ccsdt_f2(): | ||
geometry = [["F", (0.0, 0.0, -2.66816)], | ||
["F", (0.0, 0.0, 2.66816)]] | ||
mol = gto.M( | ||
atom=geometry, | ||
basis="cc-pvdz", | ||
charge=0, | ||
spin=0, | ||
symmetry="D2H", | ||
cart=True, | ||
unit="Bohr", | ||
) | ||
mf = scf.UHF(mol) | ||
mf.kernel() | ||
driver = Driver.from_pyscf(mf, nfrozen=2, uhf=True) | ||
driver.system.print_info() | ||
driver.run_cc(method="ccsdt") | ||
|
||
assert np.allclose(driver.system.reference_energy + driver.correlation_energy, -199.058201, rtol=1.0e-07, atol=1.0e-07) | ||
|
||
if __name__ == "__main__": | ||
test_ccsdt_f2() |
This file contains 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