test_projection_and_cold_runs_can_disagree fails on GH200: the projected ladder lands in the exact triplet
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
Research direction
Start with tests/test_project_ladder.py::ProjectionIsNotEquivalentToIndependentRuns::test_projection_and_cold_runs_can_disagree and run the issue’s just test command to reproduce the platform-dependent assertion. Review setUpClass, the proposed FCI root calculation, and the class docstring, then update the test to verify that the ramp matches an exact FCI root and spin value without assuming the singlet sector. Done means the test passes on GH200 while preserving the checks that the cold run reaches the septet and the ramp reaches a lower eigenstate.
Written by the indexing model from the issue text.
Description
🤖 AI text below 🤖
What happened, and what did you expect?
tests/test_project_ladder.py::ProjectionIsNotEquivalentToIndependentRuns::test_projection_and_cold_runs_can_disagree fails on JUPITER (GH200, aarch64). It fails every time, and it is the only failure in the suite:
> self.assertAlmostEqual(e_ramp, self.exact, delta=1e-9)
E AssertionError: -107.43018699420406 != -107.43702368448281 within 1e-09 delta (0.006836690278746005 difference)
The 16 → 64 projected ladder converges to the exact lowest triplet (S² = 2), not the singlet ground state. The cold run still lands in the septet as expected. FCI spectrum of the cell (Sz = 0):
| E (Ha) | S² | which run lands here |
|---|---|---|
| -107.4370236845 | 0 | ramp, as the test expects |
| -107.4301869942 | 2 | ramp, on this machine |
| -107.4161313907 | 6 | |
| -107.3828892179 | 12 | cold run (both machines) |
The first two checks in the test (cold and ramp differ by more than 1 mHa, and the ramp is the lower of the two) still pass. Only e_ramp == exact and ramp_s2 < 1e-6 fail.
This is not threading or a random initial state. The test already pins pyscf to one thread when it builds the Hamiltonian. It does not pin scipy's OpenBLAS (pthreads, 64 threads here). Even so:
- Four runs with default threads and four with
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1produced the same integrals hash and the same triplet, to the last bit. - The engine's start is deterministic (the block-H warmup, and noise from a fixed hash seed). The triplet is already chosen at M = 16, and the projection only keeps it.
The cell sits on a basin boundary at the level of floating-point rounding. Nudging h1e by symmetric random noise flips the outcome:
perturbation of h1e |
M = 16 → M = 64 |
|---|---|
| none | triplet → triplet |
| 1e-14 (three different nudges) | near-singlet → exact singlet |
| 1e-12 | near-singlet → exact singlet |
| 1e-10 | triplet → triplet |
So whether the test passes depends on the last bits of the integrals that pyscf and BLAS produce on a given platform. Pinning threads makes them reproducible on one machine but not across machines.
A different bond length doesn't help. I scanned R = 1.8 to 2.6 Å (STO-3G, CAS(6,6)), with ten perturbations from 1e-14 to 1e-8 for each R:
- Every R from 1.9 up has the same knife edge for the ramp: singlet or triplet, and at 2.3 Å once a quintet.
- At 1.8 Å the cold run no longer gets trapped.
- The cold run's septet trap is robust at every R from 1.9 up.
How to reproduce it
On a GH200 node, main at 9c815d0 (exa-dmrg 0.1.0b1, Python 3.11.18, numpy 2.4.6, scipy 1.17.1 with scipy-openblas, pyscf 2.15.1, CUDA 13.0, driver 610.57.04):
just test "tests/test_project_ladder.py::ProjectionIsNotEquivalentToIndependentRuns::test_projection_and_cold_runs_can_disagree"
To see the knife edge, add 1e-14 symmetric noise to ham["h1e"] before _session(ham): the test then passes.
Severity
Low - minor issue. The engine is not wrong: both runs converge to exact eigenstates. The test's assumption that the projected ladder reaches the singlet ground state does not hold across platforms.
Proposed fix
Keep the cell. Assert what holds in both basins, and what the class docstring says is the point: the two runs converge to different exact eigenstates, and projection is not equivalent to independent runs. Don't assert which spin sector the ramp picks.
- In
setUpClass, compute the lowest few FCI roots with their S² (fci.direct_spin1.FCI().kernel(..., nroots=4)andfci.spin_op.spin_square0). - Keep the cold run's checks: it lands on the septet root (
cold_s2 > 1, ande_coldequals that root within 1e-8). - Replace
assertAlmostEqual(e_ramp, self.exact, delta=1e-9)andassertLess(ramp_s2, 1e-6)with:e_rampequals one of the FCI roots within 1e-8, andramp_s2matches that root's S²: an exact eigenstate, not a stuck intermediate;- that root is lower than the cold run's root (this is already checked as
e_ramp < e_cold).
- Update the class docstring. "A projected ladder from M=16 reaches exact CI" becomes "reaches a lower exact eigenstate (the singlet ground state, or the lowest triplet, depending on the last bits of the integrals)".
Sketch:
@classmethod
def setUpClass(cls):
cls.ham = _hamiltonian("N 0 0 0; N 0 0 2.0", "sto-3g", 6, 6)
solver = fci.direct_spin1.FCI()
e, cs = solver.kernel(cls.ham["h1e"], cls.ham["eri"], cls.ham["ncas"],
cls.ham["nelecas"], ecore=cls.ham["ecore"], nroots=4)
cls.roots = [(float(ei), fci.spin_op.spin_square0(c, cls.ham["ncas"], cls.ham["nelecas"])[0])
for ei, c in zip(e, cs)]
def _root(self, e, s2):
match = [r for r in self.roots if abs(r[0] - e) < 1e-8 and abs(r[1] - s2) < 1e-4]
self.assertTrue(match, "E = %.10f, <S^2> = %.4f is not an exact FCI root" % (e, s2))
return match[0]
The DMRG measure_s2() values agree with the FCI ones to better than 1e-10 here (2.0000000000, 11.99999999996), so a 1e-4 tolerance on S² is generous.
Another option would be to make the integrals bit-identical across platforms, for example by rounding h1e/eri. That doesn't work: rounding moves the boundary instead of removing it, and the 1e-10 row above shows the outcome flips back and forth at every scale.
- Dominant language
- C++
- Stars
- 3
- Forks
- 0
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 29
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Algorithmiq/exa-dmrg
-
Add CITATION.cff once the paper is outPossibly taken @FabioTarocco claimed this 1 day ago. Opendocumentation request
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Algorithmiq/exa-dmrg#106 · 2 assignees ·
Maintainers usually reply within 2 days
-
bug cpp
Difficulty 5/5 Over a week Newbie friendliness 35/100
Algorithmiq/exa-dmrg#157 ·
Maintainers usually reply within 2 days
-
Shorten the tests of the wheels in cibuildwheelPossibly taken @robertodr claimed this 1 day ago. Openci request
Algorithmiq/exa-dmrg#155 · 1 comment · 1 assignee ·
Maintainers usually reply within 2 days
-
Coverage jobs failPossibly taken @robertodr claimed this 1 day ago. Openbug
Algorithmiq/exa-dmrg#148 · 1 assignee ·
Maintainers usually reply within 2 days
-
ci idea
Difficulty 4/5 3-5 days Newbie friendliness 32/100
Algorithmiq/exa-dmrg#138 ·
Maintainers usually reply within 2 days
All issues in Algorithmiq/exa-dmrg
Similar issues
-
lfortran -E exits with status 0 after a C preprocessor error (#error, wrong macro argument count)Openbug low priority preprocessor
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
difficulty:easy enhancement prio:low
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NatronGitHub/openfx-misc#502 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 2 days
-
status:needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PX4/PX4-Autopilot#30130 · 1 comment ·
Maintainers usually reply within 1 day