Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include nuclear repulsion energy in energy functions #14

Closed
Schoyen opened this issue Jul 11, 2019 · 5 comments
Closed

Include nuclear repulsion energy in energy functions #14

Schoyen opened this issue Jul 11, 2019 · 5 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Schoyen
Copy link
Collaborator

Schoyen commented Jul 11, 2019

If the specified quantum system has a non-zero nuclear repulsion energy (or, a constant term in the Hamiltonian which as of now is named "nuclear repulsion energy") this has to be added to the energy outside the energy calculations by the user if they want to get the full expression. It would be nice to include the constant term in all the energy expressions in the coupled cluster classes so the user does not have to constantly remember to add this term. Perhaps the simplest would be to include this in the reference energy calculations (e.g., here), viz.

class CoupledCluster(metaclass=abc.ABCMeta):

    # ...

    def compute_reference_energy(self):
        """Computes reference energy
        Returns
        -------
        np.array
            Reference energy
        """

        return compute_reference_energy(
            self.f, self.u, self.o, self.v, np=self.np
        ) + self.system.nuclear_repulsion_energy

    # ....
@Schoyen Schoyen added enhancement New feature or request help wanted Extra attention is needed labels Jul 11, 2019
@haakoek
Copy link
Collaborator

haakoek commented Jul 11, 2019

Agree

@Schoyen
Copy link
Collaborator Author

Schoyen commented Mar 17, 2020

This should be seen in relation with #34. The nuclear repulsion energy should be computed in the reference energy and will therefore be moved to quantum-systems as a constant addition to the appropriate reference energy function.

@haakoek
Copy link
Collaborator

haakoek commented Apr 14, 2021

I think the nuclear repulsion energy should be added in quantum systems compute_reference energy. However, keep in mind that for orbital adaptive methods such as OMP, OCC and OACC, the reference energy changes as the basis changes.

Thus, we have to keep in mind, espacially in time-dependent calculations (if we want to check conservation of energy in the field-free case or after a pulse) that IF we compute the reference energy it is with respect to the updated basis.

If I recall correctly, the way we have set up the time-dependence for the orbital adaptive methods we do not necessarily change the integrals in system.

@Schoyen
Copy link
Collaborator Author

Schoyen commented Apr 14, 2021

I agree! Now the functions compute_reference_energy in SpatialOrbitalSystem and GeneralOrbitalSystem compute the reference energy for the basis set in the system. That is, there is no option to pass in a h and u. I think it would make sense to make this function accept an h and a u from the caller similar to the construct_fock_matrix-functions (in SpatialOrbitalSystem and in GeneralOrbitalSystem). This would make it easy to use for both solvers with and without static orbitals.

@Schoyen
Copy link
Collaborator Author

Schoyen commented Apr 16, 2021

Once merged, this will be fixed in #64.

@Schoyen Schoyen closed this as completed Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants