Ejemplo n.º 1
0
    def __init__(self, mol, options_or_potfile):
        self.mol = mol
        self.stdout = mol.stdout
        self.verbose = mol.verbose
        self.max_memory = mol.max_memory

        self.frozen = False
        # FIXME: Should the solvent in PE model by default has the character
        # of rapid process?
        self.equilibrium_solvation = False

##################################################
# don't modify the following attributes, they are not input options
        if isinstance(options_or_potfile, str):
            options = cppe.PeOptions()
            options.potfile = options_or_potfile
        else:
            options = options_or_potfile

        if not isinstance(options, cppe.PeOptions):
            raise TypeError("Invalid type for options.")

        self.options = options
        self.cppe_state = self._create_cppe_state(mol)
        self.potentials = self.cppe_state.potentials
        self.V_es = None

        # e (the dielectric correction) and v (the additional potential) are
        # updated during the SCF iterations
        self.e = None
        self.v = None
        self._dm = None

        self._keys = set(self.__dict__.keys())
Ejemplo n.º 2
0
 def test_pol_embed_scf(self):
     mol = gto.Mole()
     mol.atom = '''
     C          8.64800        1.07500       -1.71100
     C          9.48200        0.43000       -0.80800
     C          9.39600        0.75000        0.53800
     C          8.48200        1.71200        0.99500
     C          7.65300        2.34500        0.05500
     C          7.73200        2.03100       -1.29200
     H         10.18300       -0.30900       -1.16400
     H         10.04400        0.25200        1.24700
     H          6.94200        3.08900        0.38900
     H          7.09700        2.51500       -2.01800
     N          8.40100        2.02500        2.32500
     N          8.73400        0.74100       -3.12900
     O          7.98000        1.33100       -3.90100
     O          9.55600       -0.11000       -3.46600
     H          7.74900        2.71100        2.65200
     H          8.99100        1.57500        2.99500
     '''
     mol.basis = "STO-3G"
     mol.build()
     pe_options = cppe.PeOptions()
     pe_options.potfile = os.path.join(dname, "pna_6w.potential")
     print(pe_options.potfile)
     pe = pol_embed.PolEmbed(mol, pe_options)
     mf = solvent.PE(scf.RHF(mol), pe)
     mf.conv_tol = 1e-10
     mf.kernel()
     ref_pe_energy = -0.03424830892844
     ref_scf_energy = -482.9411084900
     assert_allclose(ref_pe_energy, mf.with_solvent.e, atol=1e-6)
     assert_allclose(ref_scf_energy, mf.e_tot, atol=1e-6)
Ejemplo n.º 3
0
def get_pe_options():
    if core.get_option('SCF', 'PCM'):
        raise ValidationError("""Error: 3-layer QM/PE/PCM not implemented.\n""")
    potfile_name = core.get_option('PE', 'POTFILE')
    pol_embed_options = cppe.PeOptions()
    pol_embed_options.potfile = potfile_name
    pol_embed_options.induced_thresh = core.get_option('PE', 'INDUCED_CONVERGENCE')
    pol_embed_options.iso_pol = core.get_option('PE', 'ISOTROPIC_POL')

    pol_embed_options.do_diis = core.get_option('PE', 'DIIS')
    pol_embed_options.maxiter = core.get_option('PE', 'MAXITER')
    pol_embed_options.pe_border = core.get_option('PE', 'BORDER')

    if pol_embed_options.pe_border:
        pol_embed_border_options = cppe.PeBorderOptions()
        pe_btype = core.get_option('PE', 'BORDER_TYPE').upper()
        if pe_btype == "REMOVE":
            pol_embed_border_options.border_type = core.PeBorderOptions.BorderType.rem
        elif pe_btype == "REDIST":
            pol_embed_border_options.border_type = core.PeBorderOptions.BorderType.redist
        pol_embed_border_options.rmin = core.get_option('PE', 'BORDER_RMIN')
        if core.get_option('PE', 'BORDER_RMIN_UNIT').upper() == "AA":
            pol_embed_border_options.rmin *= 1.0 / constants.bohr2angstroms
        pol_embed_border_options.redist_order = core.get_option('PE', 'BORDER_REDIST_ORDER')
        pol_embed_border_options.nredist = core.get_option('PE', 'BORDER_N_REDIST')
        pol_embed_border_options.redist_pol = core.get_option('PE', 'BORDER_REDIST_POL')

        pol_embed_options.border_options = pol_embed_border_options
    return pol_embed_options
Ejemplo n.º 4
0
3
AA
O     3.53300000    2.99600000    0.88700000      1
H     4.11100000    3.13200000    1.63800000      2
H     4.10500000    2.64200000    0.20600000      3
@MULTIPOLES
ORDER 0
3
1     -0.67444000
2      0.33722000
3      0.33722000
@POLARIZABILITIES
ORDER 1 1
3
1      5.73935000     0.00000000     0.00000000     5.73935000     0.00000000     5.73935000
2      2.30839000     0.00000000     0.00000000     2.30839000     0.00000000     2.30839000
3      2.30839000     0.00000000     0.00000000     2.30839000     0.00000000     2.30839000
EXCLISTS
3 3
1   2  3
2   1  3
3   1  2''')
        f.flush()
        pe_options = cppe.PeOptions()
        pe_options.potfile = f.name
        #pe = pol_embed.PolEmbed(mol, pe_options)
        #mf = PE(mf, pe).run()
        mf = PE(mf, pe_options).run()
        print(mf.e_tot - -112.35232445743728)
        print(mf.with_solvent.e - 0.00020182314249546455)