Skip to content

Commit

Permalink
Changed "get_active_pspace" to "get_active_triples_pspace", which is …
Browse files Browse the repository at this point in the history
…more accurate. Updated all tests accordingly.
  • Loading branch information
kgururangan committed Apr 16, 2024
1 parent b9f2b06 commit f50102c
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 109 deletions.
200 changes: 116 additions & 84 deletions ccpy/utilities/pspace.py

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions tests/chplus/test_eomcct3_chplus.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pathlib import Path
import numpy as np
from ccpy.drivers.driver import Driver
from ccpy.utilities.pspace import get_active_pspace
from ccpy.utilities.pspace import get_active_triples_pspace

TEST_DATA_DIR = str(Path(__file__).parents[1].absolute() / "data")

Expand All @@ -17,7 +17,7 @@ def test_eomcct3_chplus():
# Set the active space
driver.system.set_active_space(nact_occupied=1, nact_unoccupied=3)
# Get the P space lists corresponding to this active space
t3_excitations = get_active_pspace(driver.system, target_irrep=driver.system.reference_symmetry)
t3_excitations = get_active_triples_pspace(driver.system, target_irrep=driver.system.reference_symmetry)
# Run CC(P)
driver.run_ccp(method="ccsdt_p", t3_excitations=t3_excitations)
driver.run_hbar(method="ccsdt_p", t3_excitations=t3_excitations)
Expand All @@ -28,7 +28,7 @@ def test_eomcct3_chplus():
irreps = ["A1", "A1", "A1", "B1", "B1", "A2", "A2"]
# Run EOMCC(P)
for state_index, irrep in zip(roots, irreps):
r3_excitations = get_active_pspace(driver.system, target_irrep=irrep)
r3_excitations = get_active_triples_pspace(driver.system, target_irrep=irrep)
driver.run_eomccp(method="eomccsdt_p", state_index=state_index, t3_excitations=t3_excitations, r3_excitations=r3_excitations)
driver.run_lefteomccp(method="left_ccsdt_p", state_index=state_index, t3_excitations=t3_excitations, r3_excitations=r3_excitations)
# Perform CC(t;3) corrections using T(P), R(P), and L(P) within 2-body approximation
Expand Down
6 changes: 3 additions & 3 deletions tests/chplus/test_eomcct3_full_chplus.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pathlib import Path
import numpy as np
from ccpy.drivers.driver import Driver
from ccpy.utilities.pspace import get_active_pspace
from ccpy.utilities.pspace import get_active_triples_pspace

TEST_DATA_DIR = str(Path(__file__).parents[1].absolute() / "data")

Expand All @@ -17,7 +17,7 @@ def test_eomcct3_full_chplus():
# Set the active space
driver.system.set_active_space(nact_occupied=1, nact_unoccupied=3)
# Get the P space lists corresponding to this active space
t3_excitations = get_active_pspace(driver.system, target_irrep=driver.system.reference_symmetry)
t3_excitations = get_active_triples_pspace(driver.system, target_irrep=driver.system.reference_symmetry)
# Run CC(P)
driver.run_ccp(method="ccsdt_p", t3_excitations=t3_excitations)
driver.run_hbar(method="ccsdt_p", t3_excitations=t3_excitations)
Expand All @@ -30,7 +30,7 @@ def test_eomcct3_full_chplus():
irreps = ["A1", "A1", "A1", "B1", "B1", "A2", "A2"]
# Run EOMCC(P)
for state_index, irrep in zip(roots, irreps):
r3_excitations = get_active_pspace(driver.system, target_irrep=irrep)
r3_excitations = get_active_triples_pspace(driver.system, target_irrep=irrep)
driver.run_eomccp(method="eomccsdt_p", state_index=state_index, t3_excitations=t3_excitations, r3_excitations=r3_excitations)
driver.run_lefteomccp(method="left_ccsdt_p", state_index=state_index, t3_excitations=t3_excitations, r3_excitations=r3_excitations)
# Perform the full CC(t;3) corrections using T(P), R(P), and L(P)
Expand Down
4 changes: 2 additions & 2 deletions tests/f2/test_cct3_p_f2.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np
from pyscf import scf, gto
from ccpy.drivers.driver import Driver
from ccpy.utilities.pspace import get_active_pspace
from ccpy.utilities.pspace import get_active_triples_pspace

def test_cct3_f2():
geometry = [["F", (0.0, 0.0, -2.66816)], ["F", (0.0, 0.0, 2.66816)]]
Expand All @@ -25,7 +25,7 @@ def test_cct3_f2():
driver = Driver.from_pyscf(mf, nfrozen=2)
driver.system.print_info()
driver.system.set_active_space(nact_occupied=5, nact_unoccupied=1)
t3_excitations = get_active_pspace(driver.system, target_irrep="AG")
t3_excitations = get_active_triples_pspace(driver.system, target_irrep="AG")

driver.run_ccp(method="ccsdt_p", t3_excitations=t3_excitations)
driver.run_hbar(method="ccsd")
Expand Down
2 changes: 1 addition & 1 deletion tests/h2o/test_creom23_h2o.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
CR-EOMCC(2,3) for the asymmetrically stretched water molecule along
the H2O -> OH + H bond-breaking PEC corresponding to R = 3.6, taken
the H2O -> OH + H bond-breaking PEC at the point R(OH) = 3.6 bohr, taken
from X. Li and J. Paldus, J. Chem. Phys. 133, 024102 (2010). The
basis set used is the "TZ" basis set, corresponding to cc-pVTZ with
all polarization functions removed, resulting in a small basis that
Expand Down
22 changes: 11 additions & 11 deletions tests/h2o/test_eomcct3_h2o.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
CR-EOMCC(2,3) for the asymmetrically stretched water molecule along
the H2O -> OH + H bond-breaking PEC corresponding to R = 3.6, taken
Excited-state CC(t;3) for the asymmetrically stretched water molecule along
the H2O -> OH + H bond-breaking PEC at the point R(OH) = 3.6 bohr, taken
from X. Li and J. Paldus, J. Chem. Phys. 133, 024102 (2010). The
basis set used is the "TZ" basis set, corresponding to cc-pVTZ with
all polarization functions removed, resulting in a small basis that
Expand All @@ -11,7 +11,7 @@
from pathlib import Path
import numpy as np
from ccpy.drivers.driver import Driver
from ccpy.utilities.pspace import get_active_pspace
from ccpy.utilities.pspace import get_active_triples_pspace

TEST_DATA_DIR = str(Path(__file__).parents[1].absolute() / "data")

Expand All @@ -23,8 +23,8 @@ def test_cct3_a1_singlets_h2o():
nfrozen=1,
)
driver.system.set_active_space(nact_occupied=3, nact_unoccupied=2)
t3_excitations = get_active_pspace(driver.system, target_irrep=driver.system.reference_symmetry)
r3_excitations = get_active_pspace(driver.system, target_irrep="A'")
t3_excitations = get_active_triples_pspace(driver.system, target_irrep=driver.system.reference_symmetry)
r3_excitations = get_active_triples_pspace(driver.system, target_irrep="A'")

driver.run_ccp(method="ccsdt_p", t3_excitations=t3_excitations)
driver.run_hbar(method="ccsdt_p", t3_excitations=t3_excitations)
Expand Down Expand Up @@ -56,8 +56,8 @@ def test_cct3_a2_singlets_h2o():
nfrozen=1,
)
driver.system.set_active_space(nact_occupied=3, nact_unoccupied=2)
t3_excitations = get_active_pspace(driver.system, target_irrep=driver.system.reference_symmetry)
r3_excitations = get_active_pspace(driver.system, target_irrep="A\"")
t3_excitations = get_active_triples_pspace(driver.system, target_irrep=driver.system.reference_symmetry)
r3_excitations = get_active_triples_pspace(driver.system, target_irrep="A\"")

driver.run_ccp(method="ccsdt_p", t3_excitations=t3_excitations)
driver.run_hbar(method="ccsdt_p", t3_excitations=t3_excitations)
Expand Down Expand Up @@ -89,8 +89,8 @@ def test_cct3_a1_triplets_h2o():
nfrozen=1,
)
driver.system.set_active_space(nact_occupied=3, nact_unoccupied=2)
t3_excitations = get_active_pspace(driver.system, target_irrep=driver.system.reference_symmetry)
r3_excitations = get_active_pspace(driver.system, target_irrep="A'")
t3_excitations = get_active_triples_pspace(driver.system, target_irrep=driver.system.reference_symmetry)
r3_excitations = get_active_triples_pspace(driver.system, target_irrep="A'")

driver.run_ccp(method="ccsdt_p", t3_excitations=t3_excitations)
driver.run_hbar(method="ccsdt_p", t3_excitations=t3_excitations)
Expand Down Expand Up @@ -122,8 +122,8 @@ def test_cct3_a2_triplets_h2o():
nfrozen=1,
)
driver.system.set_active_space(nact_occupied=3, nact_unoccupied=2)
t3_excitations = get_active_pspace(driver.system, target_irrep=driver.system.reference_symmetry)
r3_excitations = get_active_pspace(driver.system, target_irrep="A\"")
t3_excitations = get_active_triples_pspace(driver.system, target_irrep=driver.system.reference_symmetry)
r3_excitations = get_active_triples_pspace(driver.system, target_irrep="A\"")

driver.run_ccp(method="ccsdt_p", t3_excitations=t3_excitations)
driver.run_hbar(method="ccsdt_p", t3_excitations=t3_excitations)
Expand Down
10 changes: 5 additions & 5 deletions tests/h6/test_acct3_h6.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import numpy as np
from pyscf import gto, scf
from ccpy.drivers.driver import Driver
from ccpy.utilities.pspace import get_active_pspace
from ccpy.utilities.pspace import get_active_triples_pspace

def h6_geometry(r):
theta = [2.0*np.pi/6 * n for n in range(6)]
Expand Down Expand Up @@ -45,7 +45,7 @@ def test_acct3_h6():
driver = Driver.from_pyscf(mf, nfrozen=0)
driver.system.print_info()
driver.system.set_active_space(nact_occupied=3, nact_unoccupied=3)
t3_excitations = get_active_pspace(driver.system, target_irrep=driver.system.reference_symmetry)
t3_excitations = get_active_triples_pspace(driver.system, target_irrep=driver.system.reference_symmetry)
driver.run_ccp(method="accsdt_p", acparray=[1., 0., 1., 0., 0.], t3_excitations=t3_excitations)
driver.run_hbar(method="ccsd")
driver.run_leftcc(method="left_ccsd")
Expand All @@ -57,7 +57,7 @@ def test_acct3_h6():
driver = Driver.from_pyscf(mf, nfrozen=0)
driver.system.print_info()
driver.system.set_active_space(nact_occupied=3, nact_unoccupied=3)
t3_excitations = get_active_pspace(driver.system, target_irrep=driver.system.reference_symmetry)
t3_excitations = get_active_triples_pspace(driver.system, target_irrep=driver.system.reference_symmetry)
driver.run_ccp(method="accsdt_p", acparray=[1., 0., 0.5, 0.5, 0.], t3_excitations=t3_excitations)
driver.run_hbar(method="ccsd")
driver.run_leftcc(method="left_ccsd")
Expand All @@ -69,7 +69,7 @@ def test_acct3_h6():
driver = Driver.from_pyscf(mf, nfrozen=0)
driver.system.print_info()
driver.system.set_active_space(nact_occupied=3, nact_unoccupied=3)
t3_excitations = get_active_pspace(driver.system, target_irrep=driver.system.reference_symmetry)
t3_excitations = get_active_triples_pspace(driver.system, target_irrep=driver.system.reference_symmetry)
d3 = driver.system.noccupied_alpha/driver.system.norbitals
d4 = driver.system.nunoccupied_alpha/driver.system.norbitals
driver.run_ccp(method="accsdt_p", acparray=[1., 0., d3, d4, 0.], t3_excitations=t3_excitations)
Expand All @@ -83,7 +83,7 @@ def test_acct3_h6():
driver = Driver.from_pyscf(mf, nfrozen=0)
driver.system.print_info()
driver.system.set_active_space(nact_occupied=3, nact_unoccupied=3)
t3_excitations = get_active_pspace(driver.system, target_irrep=driver.system.reference_symmetry)
t3_excitations = get_active_triples_pspace(driver.system, target_irrep=driver.system.reference_symmetry)
driver.run_ccp(method="accsdt_p", acparray=[1., 0., 0., 1., 0.], t3_excitations=t3_excitations)
driver.run_hbar(method="ccsd")
driver.run_leftcc(method="left_ccsd")
Expand Down

0 comments on commit f50102c

Please sign in to comment.