Align tutorial parameter files with their scripts and the tutorial text - #134
Align tutorial parameter files with their scripts and the tutorial text#134marcusr2ML wants to merge 1 commit into
Conversation
The plain-text parm files and the .py/.ipynb scripts that are supposed to
describe the same simulation had drifted apart, so the two halves of several
tutorials no longer ran the same thing.
DMRG follows the tutorial text:
- CONSERVED_QUANTUMNUMBERS is now "N,Sz" everywhere in dmrg-03..06, matching
what the pages show. This covers the seven parm files plus four artefacts
that still said "Sz": dmrg-04-gaps/{spin_one_gap,spin_one_gap_multiple,
spin_one_half_gap_multiple}.py and dmrg-05-local-observables/spin_one.
- Drop dmrg-03's checked-in my_lattice.xml. It declared 16 vertices, but
dmrg-03 asks for a 32-site chain and dmrg-05 for 66; both pages tell the
reader to generate it with build_lattice.py, so the stale copy could only
override them with the wrong lattice. Added to .gitignore.
Everything else follows the scripts:
- ed-02 parm2a/2b sweep L = 4..14, matching tutorial2a/2b.py. The extra
sizes are what make the gap extrapolation work.
- mc-02 parm2a/2b use THERMALIZATION=10000 and a flat SWEEPS=500000.
- mc-03 parm3a drops a redundant repeated SWEEPS line; parm3b no longer
drops to 5000 sweeps at h=1.5.
- mc-04 parm4 sets local_S and drops REPRESENTATION="SSE" and W.
- mc-06 parm6a takes CUTOFF=1000 and leaves the temperature grid to
evaluateQWL; parm6d runs both L=4 (CUTOFF 500) and L=6 (CUTOFF 1000).
- mc-07 parm7b uses a flat SWEEPS=150000 and scans T=2.24..2.35 at every
size; parm7a's L=16 block now stages its sweeps at the same
temperature as L=4 and L=8.
Outright bugs:
- ed-05 parm_nnn-pt and parm_nnn-heisenberg declared a plain "chain lattice",
which has no next-nearest-neighbour bonds. J1 was silently ignored
and both runs degenerated into an ordinary Heisenberg chain. Now
"nnn chain lattice", as the .py files already had it.
- ed-01 tutorial1a.py had a stray = inside a dictionary key, registering the
diagonal correlations under the wrong observable name.
- mc-08 tutorial8d.py was a copy of tutorial8c.py with BETA = L instead of
2L, so the aspect ratio was not held fixed and the finite-size
crossing landed in the wrong place. It now reproduces parm8d, its
actual namesake: the fine J2 scan over 0.31..0.32. Pointing it at
parm8c as first suggested would have made it a duplicate of
tutorial8c.py. Also fixed 'W' : l/2, which is a float on Python 3,
in tutorial8b.py and tutorial8c.py.
Notebooks:
- DMRG-04_Correlations.ipynb: the spin-1 cell used SWEEPS 4 while its own
parameter block and both files in dmrg-06-correlations use 6.
- DMRG-02_Gaps.ipynb: NUMBER_EIGENVALUES was set twice in one dict literal.
No change was needed for N_HISTOGRAM_ORDERS: hybsim.cpp reads that name and
N_ORDER appears nowhere in the DMFT code, so the tutorials were already right.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Requesting a review from @afeiguin specifically for the dmrg tutorial changes. |
Independent verification of this PR's claimsI checked each claim against the source tree and test-ran the changed files against locally built ALPS binaries. All claims hold up; everything run exits cleanly with correct physics. The three bug claims — confirmed by direct experimented-05 — Ran ed-01 — Ran mc-08 — Confirmed from git history that the old DMRG changes — ran on the real binary
"Parameter files matched to their scripts" — verified programmaticallyA checker extracted the parameter dicts from each Full runs of the changed parm files — all exit 0 with sensible physics
Also confirmed the Not run at full scale: Overall: the PR does what it says, and the two headline physics bugs (ed-05's missing frustration, mc-08's wrong aspect ratio) are real and really fixed. Only wording nitpicks: the harmless-in-practice float 🤖 Generated with Claude Code |
Ooolab
left a comment
There was a problem hiding this comment.
Test runs all passed successfully!
|
@egull Yes, DMRG needed A LOT of work. The tutorials were broken before, so that is why there were so many changes and why DMRG-05 has extra examples. The original .md file described the results of a pure spin-1 chain in the text, but the simulations were for spin-1/2's attached at the ends. This was very confussing... so I just made the tutorial cover both these cases. Adrian did verify he liked this idea via email after I showed him the two plots, even the change in system size 32->64. This was all part of testing his latest dmrg code before approval. I'll wait for his response here still. |
There was a drift between parameters in the source files and the tutorials. I had Claude fix this in 2 stages already, but will rescan after this change to make sure things align.
(CLADUE)
The plain-text
parm*files and the.py/.ipynbscripts that are supposed to describe the same simulation had drifted apart, so the two halves of several tutorials no longer ran the same thing. This aligns them.DMRG follows the tutorial text; everything else follows the scripts.
Bugs (wrong results if run as-is)
parm_nnn-ptandparm_nnn-heisenbergdeclared a plain"chain lattice", which has no next-nearest-neighbour bonds.J1was silently ignored and both runs degenerated into an ordinary Heisenberg chain — the frustration the entire tutorial is about never happened. Now"nnn chain lattice", as the two.pyfiles in the same directory already had it.tutorial1a.pyhad a stray=inside a dictionary key, so the diagonal correlations were registered under a name ending in=and never appeared under the expected label.tutorial8d.pywas a copy oftutorial8c.pywithBETA = Linstead of2L, so the aspect ratio was not held fixed and the finite-size crossing could not land in the right place. It now reproducesparm8d, its actual namesake (the fine J₂ scan over 0.31–0.32). Also fixed'W' : l/2, a float on Python 3, intutorial8b.pyandtutorial8c.py.DMRG — matched to the text
CONSERVED_QUANTUMNUMBERSis now"N,Sz"throughoutdmrg-03…dmrg-06, matching what the pages show. Beyond the seven parm files, four artefacts still said"Sz"and are included:dmrg-04-gaps/{spin_one_gap,spin_one_gap_multiple,spin_one_half_gap_multiple}.pyanddmrg-05-local-observables/spin_one.dmrg-03's checked-inmy_lattice.xml. It declaredvertices="16", but dmrg-03 asks for a 32-site chain and dmrg-05 for 66. Both pages tell the reader to generate it withbuild_lattice.py, so the stale copy could only override them with the wrong lattice. Added to.gitignore.Parameter files matched to their scripts
ed-02parm2a/2bsweepL = 4…14, matchingtutorial2a/2b.py— the extra sizes are what make the gap extrapolation workmc-02parm2a/2buseTHERMALIZATION=10000and a flatSWEEPS=500000mc-03parm3adrops a redundant repeatedSWEEPSline;parm3bno longer drops to 5000 sweeps at h=1.5mc-04parm4setslocal_S, dropsREPRESENTATION="SSE"andWmc-06parm6atakesCUTOFF=1000and leaves the temperature grid toevaluateQWL;parm6druns both L=4 (CUTOFF 500) and L=6 (CUTOFF 1000)mc-07parm7buses a flatSWEEPS=150000and scans T=2.24…2.35 at every size;parm7a's L=16 block stages its sweeps at the same temperature as L=4 and L=8Notebooks
DMRG-04_Correlations.ipynb— the spin-1 cell usedSWEEPS: 4while its own parameter block and both files indmrg-06-correlationsuse 6.DMRG-02_Gaps.ipynb—NUMBER_EIGENVALUESwas set twice inside one dict literal.Note on
N_HISTOGRAM_ORDERSNo change was needed.
applications/dmft/qmc/hybridization/hybsim.cppreadsparms["N_HISTOGRAM_ORDERS"]andN_ORDERappears nowhere in the DMFT code, so the tutorials were already using the correct name.🤖 Generated with Claude Code