avcopan / scfexchange

1 stars 0 forks source link

Define methods to get the AO/MO core Hamiltonian. #11

Closed avcopan closed 7 years ago

avcopan commented 7 years ago

Specifically, I want a core Hamiltonian method with the option of introducing a perturbation. Something like this:

    def get_ao_1e_core_hamiltonian(self, ..., electric_field=None):
        """Get the core Hamiltonian integrals.

        Args:
            electric_field (np.ndarray): A three-component vector specifying the
                magnitude of an external static electric field.  Its dot product
                with the dipole integrals will be added to the core Hamiltonian.
        """
        t = self.get_ao_1e_kinetic(...)
        v = self.get_ao_1e_potential(...)
        h = t + v
        if hasattr(electric_field, 'shape') and electric_field.shape == (3,):
            d = self.get_ao_1e_dipole(...)
            h += np.tensordot(d, electric_field, axes=(0, 0))
        return h

and

    def get_mo_1e_core_hamiltonian(self, ..., electric_field=None):
        ...
        h_ao = self.integrals.get_ao_1e_core_hamiltonian(..., electric_field=electric_field)
        ...
avcopan commented 7 years ago

The MO core Hamiltonian function should include a boolean keyword argument with_core_repulsion. When True, the mean field of the core electrons will be added to the core Hamiltonian. This should be convenient when writing post-HF programs with the frozen-core approximation.