/fusion:cnokfrom fusion
Drives the CNOK C++ Glauber-model code for computing single-nucleon knockout cross sections and parallel momentum distributions from intermediate-energy beams on light targets. Supports batch mode for spectroscopic factor and quenching studies.
Ships in fusion. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
CNOK implements the Glauber reaction model for single-nucleon knockout. It builds the valence-nucleon bound state in a Woods-Saxon well (searching the well parameters to reproduce a chosen separation energy and rms radius), builds the core+target and valence+target optical potentials from nucleon densities by the t-rho-rho prescription, and evaluates the stripping and diffractive-dissociation cross sections and the core's parallel momentum distribution. The single-particle cross section sigma_sp is the "unit" cross section from which experimental spectroscopic factors (and their quenching) are extracted.
Upstream: gitee.com/asiarabbit/cnok, GPL-3.0, C++ and CMake, needs yaml-cpp
(ROOT optional, for plotting only). It targets Linux + gcc; two small, proven
behaviour-preserving edits let it build under Apple clang / libc++ (below).
mom prints a long
integrand trace to stdout and writes the answer to a timestamped result file
<basedir>/<name>_<YYYYMMDD>_<HHMM>.txt. Success means: a zero exit, a result
file, three finite positive cross sections, TOTAL == STRIP + DIFF, and the
file's S_N+Ex equal to the deck's Eref (a substituted-deck guard).
run_cnok.sh asserts all of these from the file../mom 1s11p
(neutron removal from ^16C's 1s1/2 (x) 1/2+) gives
(sigma_str, sigma_diff, sigma_sp) = (60.086689, 18.056073, 78.142761) mb,
identical to every printed digit across macOS/clang (patched, -O2 and -O0) and
Linux/gcc (unpatched and patched). Stripping matches the paper's documented
60.087 mb exactly. See references/verification.md.mom must run from the build directory. It resolves config/basedir.yaml
and the deck path relative to the cwd. The wrappers cd into the build tree
and set basedir.yaml for you.<name> argument is both the YAML basename and the valence
configuration. 1s11p = 1s1/2 (x) 1/2+, 0d55p = 0d5/2 (x) 5/2+
(half-integer core spin as 2J; integer J drops the trailing i). Prepare
<basedir>/<name>.yaml first; batch mode deduces the per-config names from
this convention.-m gives the parallel momentum distribution instead of the cross
section. CNOK computes the stripping, the diffractive, and the total
distribution of the core (writing *_strT.txt, *_difT.txt, *_totT.txt);
including the diffractive part, which most Glauber codes drop, is one of its
selling points. -mc convolves with config/expres.yaml.<name>_*.txt
before a run and take the newest after (the wrappers do), so a leftover file
from a killed or earlier run is never read as a fresh result.scripts/install_cnok.sh clones CNOK, resolves yaml-cpp (Homebrew on macOS;
system or a source build on Linux), applies the portability patches, builds with
CMake, runs the benchmark deck as a probe, and prints three lines:
CNOK=<path to the mom executable>
CNOK_BUILD=<build dir; mom runs from here>
CNOK_YAMLLIB=<yaml-cpp lib dir, for the runtime loader>
About 7 s once yaml-cpp is present (brew install yaml-cpp on macOS). Requires
git, cmake, a C++11 compiler, and yaml-cpp.
The macOS build applies, only where needed and all proven behaviour-preserving by
the four-build cross check: fabs -> std::abs in the templated Romberg /
interpolation headers (libc++ has no fabs(complex)), a __APPLE__-guarded
ulong typedef, and the link flag -Wl,-undefined,dynamic_lookup (a macOS
.dylib rejects the cross-library undefined symbols a Linux .so allows). On
Linux the code builds unpatched. Details in references/failure-modes.md.
./mom <name> # cross sections for one valence configuration
./mom <name> -m # parallel momentum distribution instead
./mom <name> -mc # ... convolved with experimental resolutions
./mom -b rs.yaml # batch: inclusive c.s. summed over configs (C2S-weighted)
./mom -b batch.yaml # super-batch: many nuclei in one run
Field-level deck reference: references/input-format.md; outputs:
references/output-format.md. Both are written from the shipped decks and the
code's comments, not from memory.
bash scripts/install_cnok.sh # prints CNOK=, CNOK_BUILD=, CNOK_YAMLLIB=
bash scripts/run_cnok.sh 1s11p # the benchmark case (basedir default config/C/C16)
bash scripts/run_cnok.sh 0d55p config/C/C16 # another 16C valence configuration
bash scripts/verify_cnok.sh # tier-1 benchmark (cross-build pin + paper anchor)
bash scripts/selftest_cnok.sh # test the harness guards (11 cases)
^16C(-1n) at 239 MeV/nucleon, the 1s1/2 (x) 1/2+ configuration (paper Sec. 5.5):
| check | result |
|---|---|
| L1 stripping / diffractive / total | (60.086689, 18.056073, 78.142761) mb, bit-identical across 4 builds (macOS clang -O2/-O0, Linux gcc unpatched/patched) |
| L2 stripping vs paper's documented 60.087 mb | exact to the paper's precision |
L1 is the tier-1 build-integrity result (two compilers, two architectures,
identical output; -O0 == -O2 rules out optimization-sensitive UB, and the
gcc-unpatched vs clang-patched match proves the libc++ patch is
behaviour-preserving). The paper's diffractive/total (18.050, 78.136) sit 0.03% /
0.009% below the released code; since the two independent builds agree bit-for-bit
that drift is on the paper side (manuscript predates the final commit) and is
smaller than the paper's own CNOK-vs-MOMDIS spread (0.09%). The physics is
anchored independently by that MOMDIS cross-check. Full account:
references/verification.md.
See references/failure-modes.md. The ones that bite: fabs(complex) and
ulong will not compile under libc++ (patched); the FCI .dylib needs
-undefined dynamic_lookup on macOS; yaml-cpp must be fed to CMake via
CPATH/LIBRARY_PATH (no find_package); mom must run from the build dir; and
the minute-stamped result file can be stale, so clear it before each run.
AGENTS.md (opens in a new tab)examples/README.md (opens in a new tab)references/failure-modes.md (opens in a new tab)references/input-format.md (opens in a new tab)references/output-format.md (opens in a new tab)references/verification.md (opens in a new tab)scripts/install_cnok.sh (opens in a new tab)scripts/run_cnok.sh (opens in a new tab)scripts/selftest_cnok.sh (opens in a new tab)scripts/verify_cnok.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub jinleiphys/fusion --plugin fusion29 skills in this plugin
/azure2Drive AZURE2, the Notre Dame multichannel R-matrix code of Azuma et al. (Phys. Rev. C 81, 045805 (2010); GPL-3.0). Write, run and verify .azr configuration files for low-energy charged-particle reactions in nuclear astrophysics: radiative capture, elastic scattering, resonance and subthreshold contributions, external (direct) capture normalised by ANCs, S-factor extrapolation to stellar energies, and reaction rates. Use for 跑AZURE2, AZURE2 input, .azr, R-matrix, R矩阵, 天体物理S因子, astrophysical S factor, direct capture, external capture, ANC, 渐近归一化系数, subthreshold state, CNO cycle capture, resonance analysis./bandBayesian uncertainty quantification for nuclear physics with the BAND framework (Bayesian Analysis of Nuclear Dynamics, bandframework v1.0.0): calibrate a model's parameters against data with surmise, build a fast reduced-basis emulator of nucleon-nucleus elastic scattering with rose, and combine several models' predictions with Bayesian model mixing in Taweret; also routes to the other BAND tools (jitr, Bfrescox, OpenBT, parMOO, PUQ, pybmc, LCGP, mooGP, Smooth Emulator). Use for Bayesian calibration, 贝叶斯校准, 参数后验, posterior, MCMC, emulator, 仿真器, surrogate model, Gaussian process emulator, reduced basis, reduced-order model, ROSE, optical potential calibration, 光学势不确定度, uncertainty quantification, UQ, 不确定度量化, model mixing, 模型混合, Bayesian model averaging, BMM, Taweret, surmise, BAND framework, experimental design. For running FRESCO itself use the `fresco` skill; for fitting a FRESCO deck by chi-squared use `sfresco`./ccfullDrive CCFULL, the all-order coupled-channels code for near-barrier heavy-ion fusion (K. Hagino, N. Rowley, A.T. Kruppa, CPC 123 (1999) 143). Write, run, and verify CCFULL input for fusion excitation functions, barrier distributions, and mean angular momenta with vibrational or rotational couplings and pair transfer. Use for 跑ccfull, CCFULL input, heavy-ion fusion, near-barrier fusion, coupled-channels fusion, fusion excitation function, barrier distribution, 熔合截面./cgmfDrive CGMF, the LANL fission-fragment de-excitation Monte Carlo code of Talou, Stetcu, Jaffke, Rising, Lovell and Kawano (Comput. Phys. Commun. 269, 108087 (2021); BSD-3-Clause). Run and analyse event-by-event simulations of prompt fission neutrons and gammas emitted by excited fission fragments, for spontaneous fission (Cf-252/254, Pu-238/240/242/244) and neutron-induced fission (U-233/234/235/238, Np-237, Pu-239/241) from thermal to 20 MeV: average and distributional neutron and gamma multiplicities, spectra, fragment mass/charge/TKE yields, and n-gamma correlations. Use for 跑CGMF, CGMF input, 裂变, fission, prompt fission neutrons, PFNS, prompt fission gammas, nu-bar, 中子多重性, neutron multiplicity, fission fragment yields, Hauser-Feshbach fission, 252Cf spontaneous fission, event-by-event fission./colossDrive COLOSS, the complex-scaled optical and Coulomb scattering solver (Liu Junzhe, Lei, Ren; CPC 311, 109568, 2025). Write, run, and verify COLOSS input for two-body elastic scattering with local or Perey-Buck nonlocal optical potentials, computing S-matrices and cross sections by complex scaling. Use for 跑coloss, COLOSS input, complex scaling scattering, 复标度散射, bound-state technique scattering, S-matrix from Lagrange-Laguerre basis./exfor-dataRetrieve real measured nuclear reaction data (cross sections, angular distributions, spectra, resonance data) from the IAEA EXFOR database and parse it into clean columns for comparison with a calculation. Use whenever experiment enters the picture: 实验数据, 有没有实验数据, 找实验点, EXFOR, 对比实验, compare with experiment, measured cross section, angular distribution data, add the data to this plot, is there data at this energy. Also use before claiming that a measurement does or does not exist.Other plugins' skills for the same job