basis = 'vqz' element = 'Mn' mol = gto.Mole() mol.ecp = {} mol.basis = {} for el in [element, 'O']: mol.ecp[el] = gto.basis.parse_ecp(df[el]['ecp']) mol.basis[el] = gto.basis.parse(df[el][basis]) mol.charge = 0 mol.spin = spins[element + 'O'] mol.build(atom="%s 0. 0. 0.; O 0. 0. %g" % (element, re[element + 'O']), verbose=4) m = ROHF(mol) m.level_shift = 1000.0 dm = m.from_chk("../../../../HF/monoxides/" + element + basis + "0.chk") hf = m.kernel(dm) m.analyze() from pyscf.shciscf import shci mc = shci.SHCISCF(m, 9, 4 + cas[element]) #mc.fcisolver.conv_tol = 1e-14 mc.fcisolver.mpiprefix = "mpirun -np 28" mc.fcisolver.num_thrds = 12 mc.verbose = 4 cas = mc.kernel()[0] from pyscf.icmpspt import icmpspt pt=icmpspt.icmpspt(mc,rdmM=500, PTM=1000,\
el = 'Mn' charge = 0 mol = gto.Mole() mol.ecp = {} mol.basis = {} mol.ecp[el] = gto.basis.parse_ecp(df[el]['ecp']) mol.basis[el] = gto.basis.parse(df[el][basis]) mol.charge = charge if el == 'Cr' or el == 'Cu': mol.spin = spins[el] - charge else: mol.spin = spins[el] + charge mol.build(atom="%s 0. 0. 0." % el, verbose=4) m = ROHF(mol) m.level_shift = 1000.0 dm = m.from_chk("../../../../HF/atoms/" + el + basis + str(charge) + ".chk") hf = m.kernel(dm) m.analyze() from pyscf.shciscf import shci mc = shci.SHCISCF(m, 6, cas[el] - charge) #mc.fcisolver.conv_tol = 1e-14 mc.fcisolver.mpiprefix = "srun -n20" mc.fcisolver.num_thrds = 12 mc.verbose = 4 cas = mc.kernel()[0] from pyscf.icmpspt import icmpspt pt=icmpspt.icmpspt(mc,rdmM=500, PTM=1000,\
if (('2p' in x) and ('O' in x)): O_2p_orbitals.append(i) #There should be 5 3d TM orbitals. Let's check this! assert len(TM_3d_orbitals) == 5 ############################################################################################## if ("U" in method): if ("HF" in method): m = UHF(mol) else: m = UKS(mol) m.xc = method[1:] else: if (method == "ROHF"): m = ROHF(mol) else: m = ROKS(mol) m.xc = method ############################################################################################## dm = np.zeros(m.init_guess_by_minao().shape) #The 3s is always doubly-occupied for the TM atom for s in TM_3s_orbitals: for spin in [0, 1]: dm[spin, s, s] = 1 #The 4s is always at least singly-occupied for the TM atom for s in TM_4s_orbitals: dm[0, s, s] = 1
datacsv[nm] = [] basis = 'vqz' el = 'O' charge = 0 mol = gto.Mole() mol.ecp = {} mol.basis = {} mol.ecp[el] = gto.basis.parse_ecp(df[el]['ecp']) mol.basis[el] = gto.basis.parse(df[el][basis]) mol.charge = charge mol.spin = 2 mol.build(atom="%s 0. 0. 0." % el, verbose=4) m = ROHF(mol) m.level_shift = 1000.0 #dm=m.from_chk("../../../../HF/atoms/"+el+basis+str(charge)+".chk") hf = m.kernel() #dm) m.analyze() from pyscf.shciscf import shci mc = shci.SHCISCF(m, 3, 4) #mc.fcisolver.conv_tol = 1e-14 mc.fcisolver.mpiprefix = "srun -n20" mc.fcisolver.num_thrds = 12 mc.verbose = 4 cas = mc.kernel()[0] from pyscf.icmpspt import icmpspt
import json from pyscf import lib, gto, scf, mcscf, fci, lo, ci, cc from pyscf.scf import ROHF, UHF, ROKS import numpy as np import pandas as pd import matplotlib.pyplot as plt from pyscf2qwalk import print_qwalk_mol from functools import reduce #Gather optimized MOs f = 'b3lyp_mo_symm.pickle' a = np.load(f) flist = [ '../chkfiles/Cuvtz_r1.963925_c0_s-1_B3LYP.chk', '../chkfiles/Cuvtz_r1.963925_c0_s1_B3LYP.chk', '../full_chk/Cuvtz_r1.963925_c0_s1_B3LYP_2Y.chk', '../chkfiles/Cuvtz_r1.963925_c0_s3_B3LYP.chk' ] for chkfile in flist: mol = lib.chkfile.load_mol(chkfile) m = ROHF(mol) m.__dict__.update(lib.chkfile.load(chkfile, 'scf')) #Build MO RDMs s = m.get_ovlp() rho1 = np.diag(m.mo_occ) M = reduce(np.dot, (a.T, s, m.mo_coeff)) dm = reduce(np.dot, (M, rho1, M.T)) print(dm.shape, np.trace(dm))