コード例 #1
0
              [dimer_atom, (0.000000, 0.000000, -b / 2)],
              [dimer_atom, (0.000000, 0.000000, b / 2)],
          ],
          basis={
              dimer_atom: 'ccpvdz',
          },
          symmetry=1)

# Create HF molecule
mf = scf.RHF(mol)
mf.conv_tol = 1e-9
mf.scf()

# Calculate energy of the molecules with frozen core.
# Active spaces chosen to reflect valence active space.
#mch = shci.SHCISCF( mf, norb, nelec ).state_average_([0.333333, 0.33333, 0.33333])
mch = shci.SHCISCF(mf, norb, nelec).state_average_([0.5, 0.5])
mch.fcisolver.sweep_iter = [0, 3]
mch.fcisolver.sweep_epsilon = [1.e-3, 1.e-4]
mch.kernel()

print "Total Time:    ", time.time() - t0

# File cleanup
os.system("rm *.bkp")
os.system("rm *.txt")
os.system("rm shci.e")
os.system("rm *.dat")
os.system("rm FCIDUMP")
os.system("rm tmp*")
コード例 #2
0
    'E1ux': (1, 1),
    'E1uy': (1, 0)
}
solver1.prefix = "solver1"
solver1.epsilon2 = 1.e-7
solver1.stochastic = False

solver2 = shci.SHCI(mol)
solver2.irrep_nelec = {
    'A1g': (2, 1),
    'A1u': (1, 1),
    'E1ux': (1, 0),
    'E1uy': (1, 1)
}
solver2.prefix = "solver2"
solver2.epsilon2 = 1.e-7
solver2.stochastic = False

mycas = shci.SHCISCF(myhf, 8, 8)
mcscf.state_average_mix_(mycas, [solver1, solver2], numpy.ones(2) / 2)
mycas.kernel()

print "Total Time:    ", time.time() - t0

# File cleanup
os.system("rm *.bkp")
os.system("rm *.txt")
os.system("rm shci.e")
os.system("rm *.dat")
os.system("rm FCIDUMP")
コード例 #3
0
# Create HF molecule
mf = scf.RHF(mol)
mf.conv_tol = 1e-9
mf.scf()

# Number of orbital and electrons
norb = 8
nelec = 12
dimer_atom = 'O'

mc = mcscf.CASSCF(mf, norb, nelec)
e_CASSCF = mc.mc1step()[0]

# Create SHCI molecule for just variational opt.
# Active spaces chosen to reflect valence active space.
mch = shci.SHCISCF(mf, norb, nelec)
mch.fcisolver.mpiprefix = 'mpirun -np 8'  # Turns on mpi if none set in
# settings.py.
mch.fcisolver.nPTiter = 0  # Turn off perturbative calc.
mch.fcisolver.sweep_iter = [0, 3]
# Setting large epsilon1 thresholds highlights improvement from perturbation.
mch.fcisolver.sweep_epsilon = [1e-3, 0.5e-3]
e_noPT = mch.mc1step()[0]

# Run a single SHCI iteration with perturbative correction.
mch.fcisolver.stochastic = False  # Turns on deterministic PT calc.
mch.fcisolver.epsilon2 = 1e-8
shci.writeSHCIConfFile(mch.fcisolver, [nelec / 2, nelec / 2], False)
shci.executeSHCI(mch.fcisolver)

# Open and get the energy from the binary energy file shci.e.