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

Pariser parr #129

Merged
merged 20 commits into from
Jul 22, 2024
Merged

Pariser parr #129

merged 20 commits into from
Jul 22, 2024

Conversation

giovanni-br
Copy link
Collaborator

Fixing CI errors.

atom1_name, site1 = get_atom_type(atom1)
atom2_name, site2 = get_atom_type(atom2)

if site1 < num_sites and site2 < num_sites:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we need this check. Can't we have value of the site to be equal to number of sites? Let's say site 6 for the total of 6 sites?

@RichRick1
Copy link
Collaborator

The gh actions are failing because there is no file affinity.json. Changing the filename from affinity.Json to affinity.json should help

@PaulWAyers
Copy link
Member

Can you specify where the data came from? Some of the values are not quite what I would have expected, but perhaps due to the source. Negative electron affinities are OK here, probably, I guess....it's a matter of taste as to what to do with negative electron affinities.

@giovanni-br
Copy link
Collaborator Author

Can you specify where the data came from? Some of the values are not quite what I would have expected, but perhaps due to the source. Negative electron affinities are OK here, probably, I guess....it's a matter of taste as to what to do with negative electron affinities.

I took this data from https://en.wikipedia.org/wiki/Electron_affinity_(data_page). I am not sure about the truthfulness of the data...

@PaulWAyers
Copy link
Member

That's fine. With that documented (via pull request and eventual package documentation) we are in good shape. We can make an executive decision on negative electron affinities later. Realistically, they mostly occur for elements that are not very interesting for PPP theory.

@giovanni-br
Copy link
Collaborator Author

giovanni-br commented Jul 4, 2024

That's fine. With that documented (via pull request and eventual package documentation) we are in good shape. We can make an executive decision on negative electron affinities later. Realistically, they mostly occur for elements that are not very interesting for PPP theory.

Nice! I've already drafted some documentation that explains this: https://github.com/theochem/ModelHamiltonian/blob/PariserParr/examples/rauk.ipynb

@RichRick1
Copy link
Collaborator

@PaulWAyers do you have any other resource in mind that we can use for electron affinities?

@PaulWAyers
Copy link
Member

Not really. This is good enough for this purpose. We could use AtomDB but I think it's not worth the effort for this. Users can always propose their own constants if they want to. We should just be clear where we got the data from and on what day we downloaded it.

Copy link
Collaborator

@RichRick1 RichRick1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! I especially like the last test when we test the energy spectrum of hamiltonian. However, there are some comments regarding the consistency of docstrings and parameter order. Also, some tests that I wouldn't expect to work are working. I left more detailed explanations in the in-line comments


Parameters
----------
connectivity_ppp: Union[list, np.ndarray]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to make sure that docstring consistent with the parameters. For example, there is no parameter connectivity_ppp in the input parameters.

List of tuples specifying sites and bonds
np.ndarray of shape (n_sites, n_sites)
between sites for the PPP model.
connectivity_heisenberg: np.ndarray
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make the docstring consistent with the the input parameters

scipy.sparse.csr_matrix or np.ndarray
"""
two_body_ppp = self.ocupation_part.generate_two_body_integral(
basis, dense, sym)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like order of parameters for generating two body hamiltonian for PPP and Heisenberg hamiltonians are inconsistent. We need to change order of Heisenberg model parameters and then change it in this line


heisenberg = HamHeisenberg(J_eq=J_eq, J_ax=J_ax, mu=0, connectivity=connectivity)
heisenberg_zero = heisenberg.generate_zero_body_integral()
hpp = HamPPP(connectivity=connectivity, alpha=alpha, beta=beta, gamma=np.zeros((2, 2)), charges=None, sym=None, u_onsite=[1, 1])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test feels a bit fishy to me. The connectivity implies 6 site model. However, we provide gamma for 2 site system, and the same happening with u_onsite. I would expect this test to break. We need to investigate what's going on here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this breaks! I have committed the changes.

heisenberg = HamHeisenberg(J_eq=J_eq, J_ax=J_ax, mu=0, connectivity=connectivity)
heisenberg_one_body = heisenberg.generate_one_body_integral(basis='spatial basis', dense=True)

hpp = HamPPP(connectivity=connectivity, alpha=alpha, beta=beta, gamma=np.zeros((2, 2)), charges=None, sym=None, u_onsite=u_onsite)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another test, in which gamma is inconsistent with number of sites.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's because we are not checking if the size of gamma is correct in the two body term functions

Copy link
Collaborator

@RichRick1 RichRick1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me! Thanks for fixing the issue with PPP dict

@RichRick1 RichRick1 merged commit 1e594f9 into theochem:PariserParr Jul 22, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants