Skip to content

Fill both orderings of the inter-site terms in to_spatial - #190

Open
ARYAMANN7279 wants to merge 2 commits into
theochem:mainfrom
ARYAMANN7279:fix/to-spatial-both-orderings
Open

ARYAMANN7279 wants to merge 2 commits into
theochem:mainfrom
ARYAMANN7279:fix/to-spatial-both-orderings

Conversation

@ARYAMANN7279

Copy link
Copy Markdown

to_spatial only fills the inter-site entries v[p,q,p,q] (and the v[p,p,q,q] pairing entries) for q > p, and relies on expand_sym to add the rest. With the default sym=1 nothing is added, so the spatial two-body integral of HamPPP has only half of the gamma terms. The spin-orbital integrals are complete, and so is the spatial result for sym=4 or 8, but not for sym=1 or 2. 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 gamma was 1.9 Eh off for sym=1, and exact for the spin-orbital integrals.

The change loops over all q != p. expand_sym assigns the symmetric partners, so the results for sym=4 and 8 are the same as before. The new test test_ppp_spatial.py builds a 3-site PPP model, converts the spatial integrals to a Fock-space Hamiltonian with H = 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 four sym values and three electron counts. It fails for sym=1, 2 without the change.

Not changed here: the spatial v is half of the usual chemists' (pq|rs) (e.g. v_pppp = U/2, as test_hub2 expects), 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.

AryamannSrivastava and others added 2 commits November 25, 2026 07:07
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.

This branch has not been deployed

No deployments
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.

1 participant