Exemplo n.º 1
0
    def __init__(self, molecule, options, basisset):
        # verify that the minimal version is used if CPPE is provided
        # from outside the Psi4 ecosystem
        min_version = "0.3.1"
        if parse_version(cppe.__version__) < parse_version(min_version):
            raise ModuleNotFoundError("CPPE version {} is required at least. "
                                      "Version {}"
                                      " was found.".format(min_version,
                                                           cppe.__version__))
        # setup the initial CppeState
        self.molecule = molecule
        self.options = options
        self.pe_ecp = self.options.pop("pe_ecp", False)
        self.basisset = basisset
        self.mints = core.MintsHelper(self.basisset)

        def callback(output):
            core.print_out(f"{output}\n")

        self.cppe_state = cppe.CppeState(self.options, psi4mol_to_cppemol(self.molecule), callback)
        core.print_out("CPPE Options:\n")
        core.print_out(f"PE(ECP) repulsive potentials = {self.pe_ecp}\n")
        for k in cppe.valid_option_keys:
            core.print_out(f"{k} = {self.cppe_state.options[k]}\n")
        core.print_out("-------------------------\n\n")
        self.cppe_state.calculate_static_energies_and_fields()
        # obtain coordinates of polarizable sites
        self._enable_induction = False
        if self.cppe_state.get_polarizable_site_number():
            self._enable_induction = True
            coords = self.cppe_state.positions_polarizable
            self.polarizable_coords = core.Matrix.from_array(coords)
        self.V_es = None
        if self.pe_ecp:
            self._setup_pe_ecp()
Exemplo n.º 2
0
    def __init__(self, molecule, options, basisset):
        # verify that the minimal version is used if CPPE is provided
        # from outside the Psi4 ecosystem
        min_version = "0.2.0"
        if parse_version(cppe.__version__) < parse_version(min_version):
            raise ModuleNotFoundError("CPPE version {} is required at least. "
                                      "Version {}"
                                      " was found.".format(min_version,
                                                           cppe.__version__))
        # setup the initial CppeState
        self.molecule = molecule
        self.options = options
        self.basisset = basisset
        self.mints = core.MintsHelper(self.basisset)

        def callback(output):
            core.print_out("{}\n".format(output))

        self.cppe_state = cppe.CppeState(self.options, psi4mol_to_cppemol(self.molecule), callback)
        self.cppe_state.calculate_static_energies_and_fields()
        # obtain coordinates of polarizable sites
        self._enable_induction = False
        if self.cppe_state.get_polarizable_site_number():
            self._enable_induction = True
            coords = np.array([site.position for site in self.cppe_state.potentials if site.is_polarizable])
            self.polarizable_coords = core.Matrix.from_array(coords)
        self.V_es = None
Exemplo n.º 3
0
    def _create_cppe_state(self, mol):
        cppe_mol = cppe.Molecule()
        for z, coord in zip(mol.atom_charges(), mol.atom_coords()):
            cppe_mol.append(cppe.Atom(z, *coord))

        def callback(output):
            logger.info(self, output)
        cppe_state = cppe.CppeState(self.options, cppe_mol, callback)
        cppe_state.calculate_static_energies_and_fields()
        return cppe_state
Exemplo n.º 4
0
    def __init__(self, molecule, options, basisset):
        # setup the initial CppeState
        self.molecule = molecule
        self.options = options
        self.basisset = basisset
        self.mints = core.MintsHelper(self.basisset)

        def callback(output):
            core.print_out("{}\n".format(output))

        self.cppe_state = cppe.CppeState(self.options, psi4mol_to_cppemol(self.molecule), callback)
        self.cppe_state.calculate_static_energies_and_fields()
        # obtain coordinates of polarizable sites
        self._enable_induction = False
        if self.cppe_state.get_polarizable_site_number():
            self._enable_induction = True
            coords = np.array([site.position for site in self.cppe_state.potentials if site.is_polarizable])
            self.polarizable_coords = core.Matrix.from_array(coords)
        self.V_es = None