Esempio n. 1
0
'''
Applying scalar relativistic effects for CASSCF by decorating the SCF or
CASSCF object with scf.sfx2c function.

See pyscf/examples/scf/21-x2c.py
'''

mol = gto.M(
    verbose = 0,
    atom = '''8  0  0.     0
              1  0  -0.757 0.587
              1  0  0.757  0.587''',
    basis = 'ccpvdz',
)

mf = scf.sfx2c(scf.RHF(mol))
mf.kernel()

mc = mcscf.CASSCF(mf, 6, 8)
mc.kernel()
print('E = %.12f, ref = -76.128478294795' % mc.e_tot)

#
# Decorating CASSCF with scf.sfx2c has the same effects as decorating SCF object
#
mf = scf.RHF(mol)
mf.kernel()

mc = scf.sfx2c(mcscf.CASSCF(mf, 6, 8))
mc.kernel()
print('E = %.12f, ref = -76.128478294795' % mc.e_tot)
Esempio n. 2
0
Applying scalar relativistic effects by decorating the scf object with
scf.sfx2c function.

Similar to the density fitting decoration, the relativistic effects can also
be applied without affecting the existed scf object.
'''

mol = gto.Mole()
mol.build(
    verbose = 0,
    atom = '''8  0  0.     0
              1  0  -0.757 0.587
              1  0  0.757  0.587''',
    basis = 'ccpvdz',
)

mf = scf.sfx2c(scf.RHF(mol))
energy = mf.kernel()
print('E = %.12f, ref = -76.075429084850' % energy)


mol.spin = 1
mol.charge = 1
mol.build(0, 0)

mf = scf.UKS(mol).x2c()  # Using stream style
energy = mf.kernel()
print('E = %.12f, ref = -75.439160951099' % energy)


Esempio n. 3
0
  H   6.56861368828978     -1.33871396574670      6.14286445056596
  H   7.48831993436433     -1.42577562013418      7.51985443522153
  S   9.40594188780477      0.42545761808747      7.87277304102829
  H   8.82966334944139     -0.10099345030206      8.99111747895267
'''
mol.basis = 'tzp-dkh'
mol.charge = -1
mol.spin = 8
mol.build()

#
# X2C correction for relativistic effects
#
# first pass, to generate initial guess
#
mf = scf.sfx2c(scf.UHF(mol))
mf.chkfile = 'hs.chk'
mf.level_shift = 0.1
mf.conv_tol = 1e-2
mf.kernel()
#
# second pass to converge SCF calculation
#
mf = scf.newton(mf)
mf.conv_tol = 1e-12
mf.kernel()

##################################################
#
# Analyze SCF results and make MCSCF initial guess
#
  H   6.56861368828978     -1.33871396574670      6.14286445056596
  H   7.48831993436433     -1.42577562013418      7.51985443522153
  S   9.40594188780477      0.42545761808747      7.87277304102829
  H   8.82966334944139     -0.10099345030206      8.99111747895267
'''
mol.basis = 'tzp-dkh'
mol.charge = -1
mol.spin = 8
mol.build()

#
# X2C correction for relativistic effects
#
# first pass, to generate initial guess
#
mf = scf.sfx2c(scf.UHF(mol))
mf.chkfile = 'hs.chk'
mf.level_shift = 0.1
mf.conv_tol = 1e-2
mf.kernel()
#
# second pass to converge SCF calculation
#
mf = scf.newton(mf)
mf.conv_tol = 1e-12
mf.kernel()




##################################################
Esempio n. 5
0
  the Hessian for the large-basis-density-fitted-scf scheme.
"""

mol = gto.Mole()
mol.build(
    verbose=0,
    atom="""8  0  0.     0
              1  0  -0.757 0.587
              1  0  0.757  0.587""",
    basis="ccpvdz",
)

#
# 1. spin-free X2C-HF with density fitting approximation on 2E integrals
#
mf = scf.density_fit(scf.sfx2c(scf.RHF(mol)))
energy = mf.kernel()
print("E = %.12f, ref = -76.075115837941" % energy)

#
# 2. spin-free X2C correction for density-fitting HF.  Since X2C correction is
# commutable with density fitting operation, it is fully equivalent to case 1.
#
mf = scf.sfx2c(scf.density_fit(scf.RHF(mol)))
energy = mf.kernel()
print("E = %.12f, ref = -76.075115837941" % energy)

#
# 3. Newton method for non-relativistic HF
#
mo_init = mf.eig(mf.get_hcore(), mf.get_ovlp())[1]
Esempio n. 6
0
Applying scalar relativistic effects by decorating the scf object with
scf.sfx2c function.

Similar to the density fitting decoration, the relativistic effects can also
be applied without affecting the existed scf object.
'''

mol = gto.Mole()
mol.build(
    verbose = 0,
    atom = '''8  0  0.     0
              1  0  -0.757 0.587
              1  0  0.757  0.587''',
    basis = 'ccpvdz',
)

mf = scf.sfx2c(scf.RHF(mol))
energy = mf.kernel()
print('E = %.12f, ref = -76.075429084850' % energy)


mol.spin = 1
mol.charge = 1
mol.build(0, 0)

mf = scf.sfx2c(scf.UKS(mol))
energy = mf.kernel()
print('E = %.12f, ref = -75.439160951099' % energy)


Esempio n. 7
0
from pyscf import gto
from pyscf import scf
'''
Applying scalar relativistic effects by decorating the scf object with
scf.sfx2c function.

Similar to the density fitting decoration, the relativistic effects can also
be applied without affecting the existed scf object.
'''

mol = gto.Mole()
mol.build(
    verbose=0,
    atom='''8  0  0.     0
              1  0  -0.757 0.587
              1  0  0.757  0.587''',
    basis='ccpvdz',
)

mf = scf.sfx2c(scf.RHF(mol))
energy = mf.kernel()
print('E = %.12f, ref = -76.075429084850' % energy)

mol.spin = 1
mol.charge = 1
mol.build(0, 0)

mf = scf.sfx2c(scf.UKS(mol))
energy = mf.kernel()
print('E = %.12f, ref = -75.439160951099' % energy)
Esempio n. 8
0
  the Hessian for the large-basis-density-fitted-scf scheme.
'''

mol = gto.Mole()
mol.build(
    verbose = 0,
    atom = '''8  0  0.     0
              1  0  -0.757 0.587
              1  0  0.757  0.587''',
    basis = 'ccpvdz',
)

#
# 1. spin-free X2C-HF with density fitting approximation on 2E integrals
#
mf = scf.density_fit(scf.sfx2c(scf.RHF(mol)))
mf = scf.RHF(mol).x2c().density_fit()  # Stream style
energy = mf.kernel()
print('E = %.12f, ref = -76.075408156180' % energy)

#
# 2. spin-free X2C correction for density-fitting HF.  Since X2C correction is
# commutable with density fitting operation, it is fully equivalent to case 1.
#
mf = scf.sfx2c(scf.density_fit(scf.RHF(mol)))
mf = scf.RHF(mol).density_fit().x2c()  # Stream style
energy = mf.kernel()
print('E = %.12f, ref = -76.075408156180' % energy)

#
# 3. Newton method for non-relativistic HF
Esempio n. 9
0
'''
Applying scalar relativistic effects for CASSCF by decorating the SCF or
CASSCF object with scf.sfx2c function.

See pyscf/examples/scf/21-x2c.py
'''

mol = gto.M(
    verbose=0,
    atom='''8  0  0.     0
              1  0  -0.757 0.587
              1  0  0.757  0.587''',
    basis='ccpvdz',
)

mf = scf.sfx2c(scf.RHF(mol))
mf.kernel()

mc = mcscf.CASSCF(mf, 6, 8)
mc.kernel()
print('E = %.12f, ref = -76.128478294795' % mc.e_tot)

#
# Decorating CASSCF with scf.sfx2c has the same effects as decorating SCF object
#
mf = scf.RHF(mol)
mf.kernel()

mc = scf.sfx2c(mcscf.CASSCF(mf, 6, 8))
mc.kernel()
print('E = %.12f, ref = -76.128478294795' % mc.e_tot)