yield i, min(i + step, end) if __name__ == '__main__': from pyscf import scf from pyscf import gto from pyscf import mp mol = gto.M( verbose=1, #output = 'out_h2o', atom=''' o 0 0 0 o 0 0 1.20752 ''', basis={ 'H': gto.uncontract_basis(gto.basis.load('321g', 'H')), 'O': gto.uncontract_basis(gto.basis.load('321g', 'O')), }, #light_speed = 10 ) #---------------------------------------------- # DC #---------------------------------------------- mf = scf.DHF(mol) mf.conv_tol = 1e-14 print(mf.scf()) # -75.640153125 _tmpfile = tempfile.NamedTemporaryFile() erifile = _tmpfile.name nmo = mf.mo_coeff.shape[1]
#!/usr/bin/env python # # Author: Qiming Sun <*****@*****.**> # ''' Enable Breit Gaunt interaction for Dirac-Hartree-Fock solver ''' from pyscf import gto, scf mol = gto.M( verbose=5, atom=''' Cl 0 0 0 H 0 1.9 0''', basis={ 'Cl': gto.uncontract_basis(gto.basis.load('ccpvdz', 'Cl')), 'H': 'ccpvdz' }, ) mf = scf.DHF(mol) print('E(Dirac-Coulomb) = %.15g, ref = -461.443188093533' % mf.kernel()) mf.with_gaunt = True print('E(Dirac-Coulomb-Gaunt) = %.15g, ref = -461.326149787363' % mf.kernel()) mf.with_breit = True print('E(Dirac-Coulomb-Breit) = %.15g, ref = -461.334922770344' % mf.kernel())
# """ Dirac-Hartree-Fock without time-reversal Kramers pair """ from pyscf import gto, scf, lib mol = gto.M( atom=""" Cl 0 0 0 H 0 1.9 0""", basis="ccpvdz", ) mf = scf.DHF(mol) mf.kernel() # # Uncontract basis of Cl, keep basis of H contracted # mol = gto.M( atom=""" Cl 0 0 0 H 0 1.9 0""", basis={"Cl": gto.uncontract_basis(gto.basis.load("ccpvdz", "Cl")), "H": "ccpvdz"}, ) lib.param.LIGHT_SPEED = 90.0 # Change light speed globally mf = scf.DHF(mol) mf.kernel()
''' Dirac-Hartree-Fock without time-reversal Kramers pair ''' from pyscf import gto, scf mol = gto.M( atom = ''' Cl 0 0 0 H 0 1.9 0''', basis = 'ccpvdz', ) mf = scf.DHF(mol) mf.kernel() # # Uncontract basis of Cl, keep basis of H contracted # mol = gto.M( atom = ''' Cl 0 0 0 H 0 1.9 0''', basis = {'Cl': gto.uncontract_basis(gto.basis.load('ccpvdz', 'Cl')), 'H' : 'ccpvdz'}, light_speed = 90. ) mf = scf.DHF(mol) mf.kernel()