Skip to content

Bring Jupyter tutorials up to spec and translate to zh-cn/ja - #133

Open
Ooolab wants to merge 6 commits into
ALPSim:mainfrom
Ooolab:feat/jupyter-tutorials-fix-and-translate
Open

Bring Jupyter tutorials up to spec and translate to zh-cn/ja#133
Ooolab wants to merge 6 commits into
ALPSim:mainfrom
Ooolab:feat/jupyter-tutorials-fix-and-translate

Conversation

@Ooolab

@Ooolab Ooolab commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Brings all 10 Jupyter-notebook tutorials (content/en/tutorials/jupyter/**) up to the tutorial-page checklist: DOI citations, parameter tables, ASCII lattice diagrams, method-choice justification, real numerical results, and summary/outlook questions.
  • Numerical results come from actually running the simulations locally (sparsediag, dmrg, dmft), not placeholder text.
  • Surfaced and documented a real convergence issue in extrapolationenergygapspinonechain.md: SWEEPS=5 doesn't reliably resolve the near-degenerate ground-state doublet at L=128, corrupting the extrapolated gap; SWEEPS=10 fixes it. Added as a convergence note in the tutorial.
  • Translates all 10 pages plus the section _index.md into zh-cn and ja, preserving code/math/URLs verbatim.
  • Fixes two small pre-existing bugs: an "isomers" → "dimers" typo in spectra1dsystems.md (and its index link), and a copy-pasted "spin-half" front-matter description on the spin-1 extrapolation page.

Test plan

  • hugo --gc builds cleanly across en/zh-cn/ja with no errors
  • All 10 English pages verified against the CLAUDE.md tutorial checklist
  • Every reported numerical result was produced by an actual local ALPS run (sparsediag/dmrg/dmft), not fabricated
  • zh-cn/ja translations verified to leave code blocks, LaTeX, and DOI/relative links byte-identical to the English source
  • Manual visual check of rendered pages (math/tables/images) in a browser

🤖 Generated with Claude Code

The 10 Jupyter-based ALPS tutorials didn't meet the tutorial page
checklist: no DOI citations, no parameter tables, no lattice diagrams,
no stated numerical results, and no summary/outlook questions. Fix all
of that in English using real output from running the simulations
locally (sparsediag/dmrg/dmft), then translate all 10 pages plus the
section index into zh-cn and ja.

Along the way, running extrapolationenergygapspinonechain.md surfaced
a real convergence issue: SWEEPS=5 doesn't reliably resolve the
near-degenerate ground-state doublet at L=128, corrupting the gap
extrapolation. Documented the fix (SWEEPS=10) as a convergence note.

Also fixes a pre-existing "isomers" -> "dimers" typo in
spectra1dsystems.md and its index entry, and a copy-pasted
"spin-half" description on the spin-1 extrapolation page.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Ooolab
Ooolab requested review from marcusr2ML and vws100 August 7, 2026 02:55
@marcusr2ML

marcusr2ML commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

@Ooolab A few potential issues (see attachments).

In the side menu some of the tutorials are in English.

Some of the cn tutorials have en labels for subsections

The inline comments for shellsessions are all in English.

The translated DMRG tutorials seem behind the updated DMRG in en.

This could be my local hugo, but I am also seeing those fraction rendering issues I mentioned as an issue.

Screenshot 2026-08-07 at 11 49 44 AM Screenshot 2026-08-07 at 11 52 15 AM Screenshot 2026-08-07 at 11 52 27 AM Screenshot 2026-08-07 at 11 53 58 AM

@vws100
vws100 requested a balanced review from Copilot August 8, 2026 16:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates all 10 Jupyter tutorials to satisfy the tutorial checklist and synchronizes Chinese and Japanese translations.

Changes:

  • Adds model context, parameters, lattice diagrams, method rationale, numerical results, and outlook questions.
  • Documents the spin-1 DMRG convergence issue.
  • Translates tutorial pages and indexes into Chinese and Japanese.

Reviewed changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
content/en/tutorials/jupyter/_index.md Corrects the dimers index entry.
content/en/tutorials/jupyter/qbits/qbitenergy.md Expands the qubit tutorial.
content/en/tutorials/jupyter/ed/isingTransverseField.md Expands the Ising tutorial.
content/en/tutorials/jupyter/ed/spinGapSpinOneHeisenbergChain.md Expands the spin-gap tutorial.
content/en/tutorials/jupyter/ed/spectra1dsystems.md Expands the 1D spectra tutorial.
content/en/tutorials/jupyter/dmrg/groundstatespinchain.md Expands the ground-state tutorial.
content/en/tutorials/jupyter/dmrg/energygapspinhalf.md Expands the spin-1/2 gap tutorial.
content/en/tutorials/jupyter/dmrg/energygapspinone.md Expands the spin-1 gap tutorial.
content/en/tutorials/jupyter/dmrg/extrapolationenergygapspinhalfchain.md Adds spin-1/2 extrapolation results.
content/en/tutorials/jupyter/dmrg/extrapolationenergygapspinonechain.md Adds results and convergence guidance.
content/en/tutorials/jupyter/dmft/dmftBetheHubbard.md Expands the DMFT tutorial.
content/zh-cn/tutorials/jupyter/_index.md Translates the tutorial index.
content/zh-cn/tutorials/jupyter/qbits/qbitenergy.md Adds the Chinese qubit tutorial.
content/zh-cn/tutorials/jupyter/ed/isingTransverseField.md Adds the Chinese Ising tutorial.
content/zh-cn/tutorials/jupyter/ed/spinGapSpinOneHeisenbergChain.md Adds the Chinese spin-gap tutorial.
content/zh-cn/tutorials/jupyter/ed/spectra1dsystems.md Adds the Chinese spectra tutorial.
content/zh-cn/tutorials/jupyter/dmrg/groundstatespinchain.md Adds the Chinese ground-state tutorial.
content/zh-cn/tutorials/jupyter/dmrg/energygapspinhalf.md Adds the Chinese spin-1/2 gap tutorial.
content/zh-cn/tutorials/jupyter/dmrg/energygapspinone.md Adds the Chinese spin-1 gap tutorial.
content/zh-cn/tutorials/jupyter/dmrg/extrapolationenergygapspinhalfchain.md Adds the Chinese spin-1/2 extrapolation tutorial.
content/zh-cn/tutorials/jupyter/dmrg/extrapolationenergygapspinonechain.md Adds the Chinese spin-1 extrapolation tutorial.
content/zh-cn/tutorials/jupyter/dmft/dmftBetheHubbard.md Adds the Chinese DMFT tutorial.
content/ja/tutorials/jupyter/_index.md Translates the tutorial index.
content/ja/tutorials/jupyter/qbits/qbitenergy.md Adds the Japanese qubit tutorial.
content/ja/tutorials/jupyter/ed/isingTransverseField.md Adds the Japanese Ising tutorial.
content/ja/tutorials/jupyter/ed/spinGapSpinOneHeisenbergChain.md Adds the Japanese spin-gap tutorial.
content/ja/tutorials/jupyter/ed/spectra1dsystems.md Adds the Japanese spectra tutorial.
content/ja/tutorials/jupyter/dmrg/groundstatespinchain.md Adds the Japanese ground-state tutorial.
content/ja/tutorials/jupyter/dmrg/energygapspinhalf.md Adds the Japanese spin-1/2 gap tutorial.
content/ja/tutorials/jupyter/dmrg/energygapspinone.md Adds the Japanese spin-1 gap tutorial.
content/ja/tutorials/jupyter/dmrg/extrapolationenergygapspinhalfchain.md Adds the Japanese spin-1/2 extrapolation tutorial.
content/ja/tutorials/jupyter/dmrg/extrapolationenergygapspinonechain.md Adds the Japanese spin-1 extrapolation tutorial.
content/ja/tutorials/jupyter/dmft/dmftBetheHubbard.md Adds the Japanese DMFT tutorial.
Suppressed comments (3)

content/en/tutorials/jupyter/ed/isingTransverseField.md:56

  • chain lattice is periodic, not open (the repository documentation explicitly states this at content/en/documentation/methods/dmrg/nonintdmrg.md:28), and the later use of TOTAL_MOMENTUM also relies on translational symmetry. The new diagram and open-boundary rationale misdescribe the actual simulation and its finite-size spectrum; update them to show a ring/periodic chain in every locale.
The `chain lattice` is a 1D open chain of `L` sites, with the Ising coupling $J_z$ living on the bonds and the transverse field $\Gamma$ acting on each site:

content/en/tutorials/jupyter/ed/spinGapSpinOneHeisenbergChain.md:44

  • chain lattice is the periodic ALPS chain, not an open chain (see content/en/documentation/methods/dmrg/nonintdmrg.md:28). The reported gaps are consequently periodic-chain gaps; describing open boundaries here and on line 52 gives readers the wrong lattice and physical interpretation. Correct the diagram and prose in all locales.
The `chain lattice` is a 1D open chain of `L` spin-1 sites coupled by nearest-neighbour exchange $J$:

content/en/tutorials/jupyter/dmrg/energygapspinone.md:223

  • For an open spin-1 chain, the near-degenerate edge-state manifold is fourfold (one singlet plus the three components of a triplet), not twofold. Method 1 sees only two states because it is restricted to Sz_total=0; Method 2's near-degenerate Sz_total=1 state is part of the same manifold. Calling the full ground state twofold here and in the question misstates the physics.
Unlike the gapless spin-1/2 chain, the spin-1 Heisenberg chain has a 2-fold degenerate ground state and a finite excitation gap even at $L=64$ — direct DMRG confirmation of Haldane's prediction for integer-spin chains.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

| `CONSERVED_QUANTUMNUMBERS` | quantum numbers fixed in the basis | `Sz` |
| `Sz_total` | total magnetization sector | `0` |
| `J` | Heisenberg exchange coupling | `1` |
| `SWEEPS` | number of DMRG sweeps | `5` |

| $J_2$ | $E_0$ |
|---|---|
| 0.0 | -1.00000 |

Ground-state energies and the gap to the first excited state, from running the code above:

| System | $L$ | $E_0$ | $E_0/L$ | Gap to $E_1$ |
| `NUMBER_EIGENVALUES` | number of low-lying eigenstates kept | `5` |
| `L` | chain length | `10, 12` |

With `Jz=-1` and `Gamma=0.5`, $\Gamma/J=0.5$, which is exactly the critical point of the model.
- $U$ 是在位相互作用能,$U > 0$对应于排斥相互作用。
- $n_{i,\sigma} = c_{i,\sigma}^\dagger c_{i,\sigma}$ 是格点$i$处自旋味$\sigma$费米子的数目算符。

### Parameters

| Method | Quantity | Value |
|---|---|---|
| 1 | $E_0-E_1$ (ground-state degeneracy splitting) | $3\times10^{-7}$ |
| `MODEL` | Hamiltonian family | `spin` |
| `local_S` | spin quantum number per site | `1` |
| `J` | Heisenberg exchange coupling $J$ | `1` |
| `L` | chain length | `4, 6, 8, 10, 12, 14` |
$$S^{\dagger}|s\rangle = \sqrt{S(S+1)-s(s+1)}|s+1\rangle$$,
$$S^{-}|s\rangle = \sqrt{S(S+1)-s(s-1)}|s-1\rangle$$,
where $S=1/2$ and $s=-S, -S+1$.
其中 $S=1/2$$s=-S, -S+1$
```

Note that `local_S = 1`, which gives us the spin-1 system. The `NUMBER_EIGENVALUES = 4` will produce the lowest 4 energies from the DMRG simulations. To ensure enough accuracy, we have also set the number of sweeps `SWEEPS = 5` and the truncation of the number of states `NUMBER_EIGENVALUES = 300`.
注意 `local_S = 1` 给出了自旋-1系统。`NUMBER_EIGENVALUES = 4` 将从DMRG模拟中给出最低的4个能量。为了确保足够的精度,我们还设置了扫描次数 `SWEEPS = 5` 以及保留态数目的截断 `NUMBER_EIGENVALUES = 300`
Marcus Rosales and others added 5 commits August 10, 2026 14:38
…als-fix-and-translate

# Conflicts:
#	content/en/tutorials/jupyter/ed/isingTransverseField.md
…ranslate' into feat/jupyter-tutorials-fix-and-translate
The Bethe-lattice DMFT page was the only jupyter tutorial whose section
headings, table headers and lattice-diagram annotations were left in
English in both the Japanese and Simplified Chinese trees.

Headings and table headers now use the terms already established across
the other jupyter pages: パラメータ/格子/手法の選択/シミュレーション/結果/
まとめと展望 and 参数/晶格/方法选择/模拟/结果/总结与展望, with
"| パラメータ | 意味 | 値 |" and "| 参数 | 含义 | 值 |" for the parameter
tables and フレーバー / 味 for the Flavor column in the results table.

Proper nouns follow each page's existing convention: ja uses ベーテ格子 and
ハバードモデル (as in its own title and body), zh-cn keeps Bethe and Hubbard
in Latin (Bethe晶格, Hubbard模型). The ASCII lattice diagram keeps its art
and only the annotations are translated.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@marcusr2ML

marcusr2ML commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Pushed four commits to this branch to unblock it and finish a few leftovers. Quite a few English words were present still.

Summary of what changed and why below.

(CLAUDE)

Conflict resolution

The branch was 131 commits behind main. Merging main in (0d599fd) produced exactly one conflict — content/en/tutorials/jupyter/ed/isingTransverseField.md, a single line where both sides had edited the same sentence:

main this branch
spelling neighbors neighbours
citation Annals of Physics: 57 Annals of Physics 57
link sciencedirect.com URL doi.org URL

Resolved by taking one from main and two from this branch:

  • neighbors (from main) — content/en/ uses the American spelling 26 times vs 1.
  • no colon after "Physics" (from this branch) — correct citation form.
  • the doi.org link (from this branch) — CLAUDE.md requires doi.org over journal-specific URLs, main already uses this same DOI in documentation/models/transising.md and tutorials/ed/ed04.md, and line 29 of this very file already links doi.org, so this makes the file internally consistent.

Every other file merged cleanly. PR now reports mergeable.

Reverted the spectra1dsystems.md title change

8e0f995 changed the zh-cn title from 一维量子系统的能谱 to 维量子系统的能谱. Reverted in 40d303e.

The leading there is not a stray dash — it is the Chinese numeral "one", and 一维 is the word for "one-dimensional". It renders as a plain horizontal stroke, so at small sizes it reads like a hyphen. Without it the title says "dimensional quantum system spectra" and no longer matches the English title, Spectra of 1D Quantum Systems, or the ja title, 1次元量子系のスペクトル. The zh-cn body of that page uses 一维 throughout.

Untranslated English found in the DMFT tutorial

dmftBetheHubbard.md was the only jupyter tutorial still carrying English section headings and table headers in both the ja and zh-cn trees — the other ten pages were fully translated. Fixed in b1d98f9:

English ja zh-cn
Bethe Lattice ベーテ格子 Bethe晶格
Hubbard Model ハバードモデル Hubbard模型
Parameters パラメータ 参数
Lattice 格子 晶格
Method Choice 手法の選択 方法选择
Simulation シミュレーション 模拟
Results 結果 结果
Summary and Outlook まとめと展望 总结与展望

Also translated, in both trees:

  • the parameter table header | Parameter | Meaning | Value || パラメータ | 意味 | 値 | / | 参数 | 含义 | 值 |
  • the Flavor column in the results table → フレーバー /
  • the annotations on the ASCII lattice diagram (each site has z=3 neighbours, connected in a loop-free tree, → Bethe lattice, coordination z=3). The diagram art itself is unchanged.

Terms were taken from what the other jupyter pages already use, so nothing new was invented — パラメータ/格子/手法の選択/シミュレーション/結果/まとめと展望 appear across the ja pages, 参数/晶格/方法选择/模拟/结果/总结与展望 across the zh-cn ones, and | パラメータ | 意味 | 値 | is the parameter-table header used 23 times in the ja tree.

Proper nouns follow each page's own existing convention rather than a single rule: ja writes ベーテ / ハバード (its own title is ベーテ格子上のハバードモデルのDMFT), zh-cn keeps Bethe and Hubbard in Latin (its title is Bethe晶格上Hubbard模型的DMFT).

Still outstanding

One more instance of the same defect, not fixed here since it is outside the DMFT page: content/ja/tutorials/jupyter/ed/isingTransverseField.md:41 still has | Parameter | Meaning | Value |. It is the only remaining English table header in the ja tree.

hugo --gc --minify builds clean, and all 11 jupyter pages render in each of en, ja and zh-cn.

@marcusr2ML marcusr2ML left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I fixed the issues I was worried about.

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.

4 participants