def test_to_scf(self): '''Test from_scf and to_scf''' tmpfcidump = tempfile.NamedTemporaryFile(dir=lib.param.TMPDIR) fcidump.from_scf(mf, tmpfcidump.name) mf1 = fcidump.to_scf(tmpfcidump.name) mf1.init_guess = mf.make_rdm1() mf1.kernel() self.assertTrue(abs(mf1.e_tot - mf.e_tot).max() < 1e-9) self.assertTrue(numpy.array_equal(mf.orbsym, mf1.orbsym))
from pyscf.cc import ccsd_t from pyscf import symm from pyscf.tools import fcidump #mol = gto.M(atom='Li 0. 0. 0.', basis='cc-pcvtz') mol = gto.Mole() mol.atom = 'Li 0. 0. 0.' mol.basis = 'cc-pcvtz' mol.charge = 0 mol.spin = 1 mol.build() FCIDUMP='B.ezfio.FCIDUMP' # # Hamiltonians of FCIDUMP file can be load # ctx = fcidump.read(FCIDUMP) # # Construct an SCF object using the quantities defined in FCIDUMP # (pyscf-1.7.4 or newer) # mf = fcidump.to_scf(FCIDUMP, molpro_orbsym=True) mf.mol.verbose = 4 mf.run() #mf.MP2().run() mycc = cc.CCSD(mf).run() et=mycc.ccsd_t()
'B1' : 4, 'B2' : 3, 'B3' : 2}, 'Cs' : { "A'" : 1, 'A"' : 2}, 'C2' : { 'A' : 1, 'B' : 2}, 'Ci' : { 'Ag' : 1, 'Au' : 2}, 'C1' : { 'A' : 1,}} orbsym = [MOLPRO_ID[mol.groupname][i] for i in symm.label_orb_symm(mol, mol.irrep_name, mol.symm_orb, c)] fcidump.from_integrals('fcidump.example5', h1e, eri, c.shape[1], mol.nelectron, ms=0, orbsym=orbsym) # # Hamiltonians of FCIDUMP file can be load # ctx = fcidump.read('fcidump.example1') ctx = fcidump.read('fcidump.example5', molpro_orbsym=True) # # Construct an SCF object using the quantities defined in FCIDUMP # (pyscf-1.7.4 or newer) # mf = fcidump.to_scf('fcidump.example5', molpro_orbsym=True) mf.mol.verbose = 4 mf.run() mf.MP2().run()
''' Writing FCIDUMP file for given integrals or SCF orbitals ''' from functools import reduce import numpy from pyscf import gto, scf, ao2mo, cc from pyscf.cc import ccsd_t from pyscf import symm from pyscf.tools import fcidump mol = gto.M(atom='H 0 0 0; H 0 0 0.7', basis='cc-pvtz') # # Hamiltonians of FCIDUMP file can be load # ctx = fcidump.read('H2_0.7.ezfio.FCIDUMP') # # Construct an SCF object using the quantities defined in FCIDUMP # (pyscf-1.7.4 or newer) # mf = fcidump.to_scf('H2_0.7.ezfio.FCIDUMP', molpro_orbsym=True) mf.mol.verbose = 4 mf.run() mf.MP2().run() mycc = cc.CCSD(mf) mycc.kernel() e_ee, c_ee = mycc.eeccsd(nroots=5)