/fusion:gsmfrom fusion
Builds, runs, and verifies Gamow Shell Model input decks for Berggren-basis one-body Gamow states, resonance searches, complex-scaling widths, many-body eigenstates with continuum coupling, densities, electromagnetic transitions, spectroscopic factors, and GSM-CC reaction channels.
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.
The Gamow Shell Model is the shell model built on the Berggren basis, so bound states, resonances, and the non-resonant scattering continuum are treated on the same footing. Single-particle states carry complex energies, matrix elements are complex-symmetric (not Hermitian), and widths come out of the diagonalization rather than being added afterwards. The package covers one-body Gamow states, two-body and many-body GSM, and the coupled-channel GSM-CC extension for reactions.
Reference: N. Michel and M. Ploszajczak, Gamow Shell Model: The Unified Theory of Nuclear Structure and Reactions, Lecture Notes in Physics 983, Springer (2021). Code: github.com/GSMUTNSR/book_codes, Academic Free License v3.0. Manual: GSM_manual.pdf at the repository root.
Exercises/Chapter_N/Exercise_M/. Reproduce the relevant one after any build. Verified benchmarks and their agreement are in references/verification.md..out files in Exercises/ are reference outputs, never inputs. Run in a workdir that does not already contain them. run_gsm.sh refuses to start if the target .out exists, because a crashed run in a directory holding the reference is indistinguishable from a perfect reproduction.diff. The shipped references were produced by GSM-1.0 and the current code is GSM-2.0, which changed the print format (k:(...) became k : (...)). Last-digit rounding also varies by compiler. Use scripts/compare_gsm.sh, and state agreement as significant figures.g++ is required. Apple clang cannot compile this code (see Gotchas). The install script autodetects and refuses to proceed with clang.scripts/install_gsm.sh [targets...] clones the repository, unpacks it, applies the portability patch, and builds. Requires git, unzip, make, mpic++ (OpenMPI or MPICH), and a real GNU g++. On macOS: brew install gcc open-mpi.
The repository ships zip archives at top level, not an unpacked tree. The install script unpacks GSM_code_repository.zip (sources) and workspace_for_GSM.zip (interaction files). Qbox_interaction.zip is large and only needed for Qbox-format wave functions, so it is left packed.
Build targets (install_gsm.sh one res gsm2, default is those three):
| target | directory | binary | what it does |
|---|---|---|---|
one | Gamow_one/One_particle_dir | run_one | one-body Berggren-basis diagonalization |
one-ptg | Gamow_one/One_particle_PTG_dir | run_one | same, Poschl-Teller-Ginocchio potential |
res | Gamow_one/resonances_dir | run_res | pole search: bound, antibound, resonance; phase shifts |
opt | Gamow_one/optimization_code_dir | run_opt | one-body potential fitting |
rotor | CC_rotor_dir | CC_rotor_exe | particle-plus-rotor coupled channels |
gsm2 | GSM_two_dir | GSM_two_exe | two-valence-particle GSM, observables, EM transitions |
gsm2rel | GSM_two_relative_dir | GSM_two_relative_exe | two-body in relative coordinates (deuteron, dineutron) |
gsm1d | GSM_dir_1D/GSM_dir | GSM_exe | full many-body GSM, 1D MPI partitioning |
gsm2d | GSM_dir_2D/GSM_dir | GSM_exe | full many-body GSM, 2D MPI partitioning |
cc1d | GSM_dir_1D/CC_dir | CC_exe | GSM-CC coupled channels (reactions) |
Env overrides: GSM_ROOT (install tree, default ~/.cache/fusion/gsm), GSM_CXX, GSM_JOBS.
README. The book exercises are the documentation that matters; the manual describes parameters, the READMEs describe intent.scripts/run_gsm.sh <target> <deck.in> <workdir>. It builds on first use, guards the clean room, and reports stderr and exit status.scripts/compare_gsm.sh <reference.out> <workdir/deck.out>.Maximal |overlap|oo) should be small (1e-8 or below in the verified cases).All GSM codes read the deck on stdin and write everything to stdout:
run_one < deck.in > deck.out
Decks are free-format, one item per line, with a trailing parenthetical naming the parameter. Blank lines separate blocks and are load-bearing. Layout of a one-body deck (examples/Exercise_XIII_1s1I2.in):
WS-analytic, WS, PTG), then diffuseness, depth Vo, spin-orbit Vso, radius R0A, and whether target recoil is neglectedproton / neutron), target charge, charge radiuss1/2, d3/2, ...) and the list of pole statesk.peak (complex, the resonance being enclosed), k.middle, k.max, and the number of points on each of the three segmentsMany-body decks (examples/Exercise_II.in) begin with MPI processes, OpenMP threads, and a workspace directory path on line 4 which must exist (see Gotchas).
The contour is the physics. k.peak must enclose the resonance you want; Chapter 5 Exercise I is built precisely to show what happens when the contour is too close to or too far from the pole.
Everything goes to stdout in sections: echo of the input, pole basis states (complex k, E, width G, Jost residual), the scattering basis on the contour, Berggren completeness diagnostics, the Hamiltonian dimension, then per-eigenstate results. Many-body runs add densities, electromagnetic transitions, and a final spectrum table:
Z:8 N:10 J Pi (index):0+(0) E:-11.3636534616811 MeV G:-8.13793226533975 keV E:0 MeV ...
The first E is absolute (relative to the core), the second is excitation energy relative to the ground state. G is the width; for a bound state it is a numerical zero (1e-5 keV or below), and a bound state showing a genuinely nonzero width means the contour or the mesh is wrong.
A real GNU g++ is mandatory. Apple clang rejects out-of-line template definitions whose signatures do not match their declarations. Two exist in numlib/total_diagonalization and are harmless because they are never instantiated, but clang checks eagerly and refuses. GCC 15 also turned these into errors via -Wtemplate-body, so the install script adds -fpermissive for GCC 15 and newer.
finite() infinite recursion (fixed automatically, and the fix is enforced). numlib/complex_add.cpp defines finite(const complex<double>&) and calls finite(x) on a double inside it, expecting the legacy BSD finite(double) from <math.h>. That function was removed in POSIX 2008 and is absent on macOS, so the double converts back to complex<double> and the function recurses until it hits the stack guard page. The symptom is exit 139 with an empty stderr, crashing right after Pole basis states. Linux glibc still exposes finite, so the bug does not appear there.
install_gsm.sh rewrites those calls to std::isfinite on every run, and because an unapplied patch builds fine and only dies at run time (where it looks like a bad deck), the fix is not allowed to fail quietly:
All of that is idempotent: a second run on a patched, built tree does nothing and returns in well under a second.
Homebrew GCC vs the macOS SDK. After an Xcode update, brew GCC's private fixincludes copy of _stdio.h refers to a _bounds.h it cannot find. The install script prepends the live SDK headers (-I$(xcrun --show-sdk-path)/usr/include) instead of modifying the brew installation. If you see fatal error: _bounds.h: No such file or directory, this is it.
Many-body decks need an existing workspace directory. Line 4 of the deck names it and the shipped decks hardcode /tmp/workspace/. If it does not exist the run prints MPI process:0 <path> does not exist and calls MPI_ABORT (exit 1). Set GSM_WORKSPACE and run_gsm.sh will create it, populate it from workspace_for_GSM, and rewrite line 4. Interaction files (USDB.int, sd.int, and the v2body_* tables) must be in that directory for decks that read them.
Blank lines are separators and are significant. Deleting one shifts every subsequent read.
The reference outputs are GSM-1.0, the code is GSM-2.0. Expect a print-format difference in pole lines (k:(...) vs k : (...)) and last-digit rounding. That is why rule 4 exists. GSM-2.0 also corrected real bugs, so a few book exercises have genuinely different answers; the repository README.md lists them (Chapter 9 Exercises X and XI in particular, whose numbers in the printed book are superseded).
MPI is compiled in but a plain run is serial. The binaries call MPI_Init and run fine launched directly. Use mpirun -n N only for the gsm1d / gsm2d many-body targets, and match the MPI.processes line at the top of the deck.
Some features are explicitly unfinished upstream: many-body projectiles and the no-core framework in GSM-CC "might run, but results might not be correct", and hypernuclei are untested. Do not build a result on those without an independent check.
Full detail, commands, and numbers in references/verification.md. All three were run in a clean room: fresh clone from the public repository, fresh build, fresh workdir with no reference file present, stderr inspected.
| case | target | what | agreement |
|---|---|---|---|
| Ch. 2 Ex. XV | res | neutron 0d3/2 narrow resonance in a Woods-Saxon well, complex-scaling width | 11 significant figures on 35 observables |
| Ch. 3 Ex. XIII | one | 1s1/2 proton, diagonalization in a Berggren basis generated by a different potential | 9 significant figures on 562 observables |
| Ch. 5 Ex. II | gsm2 | 18O = 16O core + 2 valence neutrons: spectrum, densities, EM transitions | 8 significant figures on 2539 observables |
The 18O ground state comes out at E = -11.3636534616779 MeV against the reference -11.3636534616811 MeV, which is 12 significant figures on the headline number.
AGENTS.md (opens in a new tab)examples/Exercise_II.in (opens in a new tab)examples/Exercise_XIII_1s1I2.in (opens in a new tab)examples/Exercise_XV_A_neutron_narrow_resonance.in (opens in a new tab)references/Exercise_II.out.reference (opens in a new tab)references/Exercise_XIII_1s1I2.out.reference (opens in a new tab)references/Exercise_XV_A_neutron_narrow_resonance.out.reference (opens in a new tab)references/input-format.md (opens in a new tab)references/verification.md (opens in a new tab)scripts/compare_gsm.sh (opens in a new tab)scripts/install_gsm.sh (opens in a new tab)scripts/run_gsm.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
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./cnokDrive CNOK, the C++ Glauber-model single-nucleon knockout code of Y.Z. Sun and S.T. Wang (Comput. Phys. Commun. 288, 108726 (2023); GPL-3.0, gitee.com/asiarabbit/cnok). Compute single-particle removal cross sections (stripping + diffractive dissociation) and parallel (longitudinal) momentum distributions of the heavy residue (core) in one-nucleon knockout from intermediate-energy (30 MeV/u to 2 GeV/u) stable and radioactive beams on a light composite target, via the eikonal/sudden Glauber model with a t-rho-rho optical potential; supports batch mode over valence configurations (C2S-weighted inclusive cross sections and momentum distributions, spectroscopic-factor / quenching studies). Use for 跑CNOK, CNOK input, Glauber, 敲出, knockout, single-nucleon removal, stripping, diffractive dissociation, 动量分布, momentum distribution, sigma_sp, single-particle cross section, spectroscopic factor, 谱因子, C2S, quenching, eikonal, sudden approximation, t-rho-rho, 16C knockout, exotic nuclei knockout, MOMDIS./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.Other plugins' skills for the same job