一键导入
using-netket
Use when choosing or running NetKet for VMC, neural quantum states, sampler or optimizer choices, JAX CPU/GPU setup, or NetKet setup failures.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when choosing or running NetKet for VMC, neural quantum states, sampler or optimizer choices, JAX CPU/GPU setup, or NetKet setup failures.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when the user wants a numerical result (ED / DMRG / QMC / VMC / any method) checked against an exact solution, or names a model from the solvable-models catalog in a verification context. Trigger phrases: "verify against the exact solution", "check my DMRG/ED/QMC result", "benchmark <method> on <model>", "is this energy right", "does this match the exact answer", "sanity-check this against Bethe ansatz / Onsager / free-fermion solution". Also fires when the user names any of the 63 catalog models below in a verification context — not only when they use the word "verify": - T1 quadratic/free-particle: tfim-chain (TFIM), xy-chain, kitaev-chain, ssh-chain, kitaev-honeycomb, hofstadter-harper, haldane-chern, anderson-1d, harmonic-chain - T2 2D classical/transfer matrix: ising-2d-onsager (Onsager / 2D Ising), ising-triangular, dimer-kasteleyn, six-vertex, eight-vertex, hard-hexagons - T3 Bethe ansatz/Yang–Baxter: xxz-chain, heisenberg-xxx, hubbard-1d-lieb-wu (Lieb–Wu / 1D Hubbard), lieb-liniger, yang
Use when an exact diagonalization track, ED reproduction, full spectrum, symmetry sector, scar, ETH, level statistics, quench dynamics, finite-temperature ED (FTLM/TPQ), spectral function, interior-spectrum / MBL eigenstates, or finite-cluster oracle needs method-level route and tool selection.
Use when the user names or describes a harness-tracked quantum lattice model. Match user prose to one of: - transverse-field-ising (TFIM): quantum-critical Ising chain / 2D Wilson-Fisher - heisenberg: SU(2) magnet, AFM or FM by sign of J - xxz-chain: spin-1/2 XXZ, Bethe-ansatz integrable, Δ tunes FM / Luttinger / Néel - j1-j2: frustrated Heisenberg, J2/J1≈0.5 spin-liquid candidate - shastry-sutherland: orthogonal-dimer AFM, exact dimer phase, magnetization plateaus - spin-1-xxz: Haldane phase, single-ion anisotropy - aklt: spin-1 bilinear-biquadratic, exact VBS ground state - kitaev-honeycomb: bond-dependent exchange, exactly solvable Z2 spin liquid, anyons - spin-ice-pyrochlore: 2-in-2-out ice rule, Coulomb phase, magnetic monopoles - mbl-disordered-heisenberg: random-field XXZ chain, ETH-to-MBL transition - rydberg-pxp: blockaded Rydberg chain, quantum many-body scars, |Z2⟩ revivals - dissipative-spin-lindblad: open spin lattice, Liouvillian spectrum, steady states - potts-clock: q-state, first-order / cont
Use when the user wants to reproduce a paper's figure or main result. Triggers include "reproduce paper X", "redo the figures of Y", "reproduce arXiv <id>", "put this paper through the harness as a calibration target", "walk me through reproducing this paper", "beginner reproduction", "I don't know what size to choose", "explain while reproducing", or right after `/download-ref` lands a new paper.
Use when choosing or running QuSpin as the Python fallback for exact diagonalization, constrained-basis ED, spin-chain ED examples, or QuSpin setup failures.
Use when choosing or running XDiag.jl for exact diagonalization, symmetry-resolved sectors, Lanczos/Krylov calculations, or XDiag setup failures.
| name | using-netket |
| description | Use when choosing or running NetKet for VMC, neural quantum states, sampler or optimizer choices, JAX CPU/GPU setup, or NetKet setup failures. |
Use NetKet for VMC / neural-quantum-state workflows where the task needs a variational ansatz, sampler, optimizer, and statistical validation.
skills/using-netket/stack.tomlskills/method-vmc/SKILL.mdmake install netketmake install netket-gpureferences/netket-api.mdUse this section as the source for NetKet-specific reproduction knobs unless the paper or official code fixes a value. The ## Knobs table below gives concrete starting points; the method card supplies the conceptual notation.
/using-jax and the NetKet stack profile for device setup.Concrete starting points for the knobs in Parameter setup.
| Knob | Effect | Starting point |
|---|---|---|
alpha (RBM hidden-unit ratio) | Ansatz expressiveness. Higher = more flexible, slower. | 2–4 for entry; 8+ for frustrated 2D. |
n_samples | MC samples per gradient step. More = lower variance gradient. | 1024–4096. |
learning_rate | Optimizer step size. | 0.01 (SGD); 0.001 (Adam). |
diag_shift (SR) | Stochastic reconfiguration regularization. | 0.01; reduce as training progresses. |
n_iter | Training iterations. | 500–2000; monitor energy convergence. |
| Architecture | RBM, CNN, Transformer, ... | RBM for entry; CNN/Transformer for 2D frustrated. |
import netket as nk
# 1. Lattice + Hilbert space
graph = nk.graph.Chain(length=N, pbc=True)
hi = nk.hilbert.Spin(s=0.5, N=graph.n_nodes)
# 2. Hamiltonian
H = nk.operator.Heisenberg(hilbert=hi, graph=graph, J=1.0)
# 3. Ansatz (RBM default; swap for other architectures)
model = nk.models.RBM(alpha=4, param_dtype=complex)
# 4. Sampler + optimizer
sampler = nk.sampler.MetropolisLocal(hi, n_chains=16)
optimizer = nk.optimizer.Sgd(learning_rate=0.01)
sr = nk.optimizer.SR(diag_shift=0.01)
# 5. VMC driver
vs = nk.VMC(H, optimizer, sampler, model, n_samples=1024, preconditioner=sr)
# 6. Run
vs.run(n_iter=500, out="output")
# 7. Read results
import json
data = json.load(open("output.log"))
energy = data["Energy"]["Mean"][-1]
variance = data["Energy"]["Variance"][-1]
Estimate from iterations * samples_per_iteration * model_eval_cost, plus JAX compilation and sampler overhead.
stack.toml to choose the profile, then smoke-test jax.devices() in the same environment./using-slurm.