def test_water_cvs_adc2(self): fn = self.run_scf() with tempfile.TemporaryDirectory() as tmpdir: res = atd.dump_reference(fn, "cvs-adc2", tmpdir + "/out.hdf5", n_states_full=2, n_singlets=3, n_triplets=3, print_level=2, core_orbitals=[0, 7]) assert_allclose(res["adc/singlet/eigenvalues"][()], np.array([20.0045422, 20.08771799, 21.82672127])) assert_allclose(res["adc/triplet/eigenvalues"][()], np.array([19.95732865, 20.05239094, 21.82672127]))
def test_water_fc_adc2(self): fn = self.run_scf() with tempfile.TemporaryDirectory() as tmpdir: res = atd.dump_reference(fn, "adc2", tmpdir + "/out.hdf5", n_states_full=2, n_singlets=3, n_triplets=3, print_level=2, frozen_core=[0, 7]) assert_allclose(res["adc/singlet/eigenvalues"][()], np.array([0.47048699, 0.57249152, 0.59374785])) assert_allclose(res["adc/triplet/eigenvalues"][()], np.array([0.40290068, 0.4913562, 0.52852212]))
def test_water_adc2(self): fn = self.run_scf() with tempfile.TemporaryDirectory() as tmpdir: res = atd.dump_reference(fn, "adc2", tmpdir + "/out.hdf5", n_states_full=2, n_singlets=5, n_triplets=3, print_level=2) assert_allclose(res["adc/singlet/eigenvalues"][()], np.array([0.47051314, 0.57255495, 0.59367335, 0.71296882, 0.83969732])) assert_allclose(res["adc/triplet/eigenvalues"][()], np.array([0.40288477, 0.4913253, 0.52854722]))
def test_cn_fc_adc2(self): fn = self.run_scf() with tempfile.TemporaryDirectory() as tmpdir: res = atd.dump_reference(fn, "adc2", tmpdir + "/out.hdf5", n_states_full=2, n_states=5, print_level=2, frozen_core=[0, 10]) assert_allclose(res["adc/state/eigenvalues"][:3], np.array([0.1419152, 0.1419152, 0.17400268]))
def test_cn_adc2(self): fn = self.run_scf() with tempfile.TemporaryDirectory() as tmpdir: res = atd.dump_reference(fn, "adc2", tmpdir + "/out.hdf5", n_states_full=2, n_states=6, print_level=2) assert_allclose( res["adc/state/eigenvalues"][()], np.array([ 0.14185414, 0.14185414, 0.1739203, 0.28945843, 0.299935, 0.299935 ]))
def test_cn_cvs_adc2(self): fn = self.run_scf() with tempfile.TemporaryDirectory() as tmpdir: res = atd.dump_reference(fn, "cvs-adc2", tmpdir + "/out.hdf5", n_states_full=2, n_states=5, print_level=2, core_orbitals=[0, 10]) assert_allclose( res["adc/state/eigenvalues"][()], np.array([ 14.74651745, 14.84335613, 14.84335613, 15.01768321, 15.01768321 ]))
## adcc-testdata is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with adcc-testdata. If not, see <http://www.gnu.org/licenses/>. ## ## --------------------------------------------------------------------- import os import adcctestdata as atd from pyscf import gto, scf if not os.path.isfile("hf3.hdf5"): mol = gto.M( atom='H 0 0 0;' 'F 0 0 2.5', basis='6-31G', unit="Bohr", spin=2 # =2S, ergo triplet ) mf = scf.UHF(mol) mf.conv_tol = 1e-14 mf.grad_conv_tol = 1e-10 mf.kernel() atd.dump_pyscf(mf, "hf3.hdf5") atd.dump_reference("hf3.hdf5", "adc2", "hf3_sf_adc2.hdf5", n_states_full=2, n_spin_flip=5, print_level=100)
import adcctestdata as atd from pyscf import gto, scf if not os.path.isfile("water.hdf5"): mol = gto.M(atom=""" O 0 0 0 H 0 0 1.795239827225189 H 1.693194615993441 0 -0.599043184453037 """, basis='def2-tzvp', unit="Bohr") mf = scf.RHF(mol) mf.conv_tol = 1e-13 mf.conv_tol_grad = 1e-12 mf.diis = scf.EDIIS() mf.diis_space = 3 mf.max_cycle = 500 mf.kernel() atd.dump_pyscf(mf, "water.hdf5") atd.dump_reference("water.hdf5", "adc2", "water_fc_adc2.hdf5", n_states_full=2, n_singlets=5, n_triplets=3, print_level=100, frozen_core=[0, 43])
import adcctestdata as atd from pyscf import gto, scf if not os.path.isfile("water.hdf5"): mol = gto.M(atom=""" O 0 0 0 H 0 0 1.795239827225189 H 1.693194615993441 0 -0.599043184453037 """, basis='def2-tzvp', unit="Bohr") mf = scf.RHF(mol) mf.conv_tol = 1e-13 mf.conv_tol_grad = 1e-12 mf.diis = scf.EDIIS() mf.diis_space = 3 mf.max_cycle = 500 mf.kernel() atd.dump_pyscf(mf, "water.hdf5") atd.dump_reference("water.hdf5", "cvs-adc2", "water_cvs_adc2.hdf5", n_states_full=2, n_singlets=5, n_triplets=3, print_level=100, core_orbitals=[0, 43])
## along with adcc-testdata. If not, see <http://www.gnu.org/licenses/>. ## ## --------------------------------------------------------------------- import os import adcctestdata as atd from pyscf import gto, scf if not os.path.isfile("water_uhf.hdf5"): mol = gto.M( atom=""" O 0 0 0 H 0 0 1.795239827225189 H 1.693194615993441 0 -0.599043184453037 """, basis='cc-pvdz', unit="Bohr" ) mf = scf.UHF(mol) mf.conv_tol = 1e-13 mf.conv_tol_grad = 1e-12 mf.diis = scf.EDIIS() mf.diis_space = 3 mf.max_cycle = 500 mf.kernel() atd.dump_pyscf(mf, "water_uhf.hdf5") atd.dump_reference("water_uhf.hdf5", "adc2", "water_uhf_adc2.hdf5", n_states_full=2, n_states=8, print_level=100)
## ## --------------------------------------------------------------------- import os import adcctestdata as atd from pyscf import gto, scf if not os.path.isfile("cn.hdf5"): mol = gto.M( atom=""" C 0 0 0 N 0 0 2.2143810738114829 """, basis='cc-pvdz', unit="Bohr", spin=1, verbose=4, ) mf = scf.UHF(mol) mf.conv_tol = 1e-11 mf.conv_tol_grad = 1e-10 mf.diis = scf.EDIIS() mf.diis_space = 3 mf.max_cycle = 500 mf.kernel() atd.dump_pyscf(mf, "cn.hdf5") atd.dump_reference("cn.hdf5", "adc2", "cn_adc2.hdf5", n_states_full=3, n_states=5, print_level=100)
import os import adcctestdata as atd from pyscf import gto, scf if not os.path.isfile("water.hdf5"): mol = gto.M(atom=""" O 0 0 0 H 0 0 1.795239827225189 H 1.693194615993441 0 -0.599043184453037 """, basis='def2-tzvp', unit="Bohr") mf = scf.RHF(mol) mf.conv_tol = 1e-13 mf.conv_tol_grad = 1e-12 mf.diis = scf.EDIIS() mf.diis_space = 3 mf.max_cycle = 500 mf.kernel() atd.dump_pyscf(mf, "water.hdf5") atd.dump_reference("water.hdf5", "adc2", "water_adc2.hdf5", n_states_full=2, n_singlets=5, n_triplets=3, print_level=100)
fullmethod = method if "cvs" in spec: fullmethod = "cvs-" + method prefix = "" if spec != "gen": prefix = spec.replace("-", "_") + "_" adc_tree = prefix.replace("_", "-") + method mp_tree = prefix.replace("_", "-") + "mp" dumpfile = "{}_reference_{}{}.hdf5".format(case, prefix, method) if not os.path.isfile(dumpfile): atd.dump_reference(hfdata, fullmethod, dumpfile, mp_tree=mp_tree, adc_tree=adc_tree, n_states_full=2, **kwargs) def dump_h2o_sto3g(): # H2O restricted # All methods for general and CVS kwargs = {"n_singlets": 10, "n_triplets": 10} overwrite = { "adc2": { "n_singlets": 9, "n_triplets": 10 }, } dump_all("h2o_sto3g", kwargs, overwrite, spec="gen")