Repository navigation
Fill both orderings of the inter-site terms in to_spatial - #190
Open
ARYAMANN7279 wants to merge 2 commits into
Open
ARYAMANN7279 wants to merge 2 commits into
ARYAMANN7279 wants to merge 2 commits into
Conversation
to_spatial only set v[p,q,p,q] and v[p,p,q,q] for q > p and relied on expand_sym for the rest, so with sym=1 the spatial two-body integral of HamPPP had half of the gamma terms. Loop over all q != p and add a test against exact diagonalization.
for more information, see https://pre-commit.ci
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
to_spatialonly fills the inter-site entriesv[p,q,p,q](and thev[p,p,q,q]pairing entries) forq > p, and relies onexpand_symto add the rest. With the defaultsym=1nothing is added, so the spatial two-body integral ofHamPPPhas only half of thegammaterms. The spin-orbital integrals are complete, and so is the spatial result forsym=4or8, but not forsym=1or2. The Hubbard model is not affected, because it only has the on-site terms.I found this by building the PPP Hamiltonian directly from the formula in the docs in a small Fock space and comparing the lowest energies with the ones from the integrals. A 4-site PPP model with
gammawas 1.9 Eh off forsym=1, and exact for the spin-orbital integrals.The change loops over all
q != p.expand_symassigns the symmetric partners, so the results forsym=4and8are the same as before. The new testtest_ppp_spatial.pybuilds a 3-site PPP model, converts the spatial integrals to a Fock-space Hamiltonian withH = e0 + sum h a+ a + sum v a+ a+ a a, and compares the lowest energy with the one from the PPP definition, for all foursymvalues and three electron counts. It fails forsym=1, 2without the change.Not changed here: the spatial
vis half of the usual chemists'(pq|rs)(e.g.v_pppp = U/2, astest_hub2expects), so the integrals can be used in PySCF only after multiplying by 2 and transposing to(pr|qs). This might be worth a note in the docs.