/fusion:frescofrom fusion
Writes, runs, debugs, and verifies FRESCO input decks for coupled-channels nuclear reaction calculations including elastic, inelastic, transfer/DWBA, breakup, CDCC, and capture. Useful when the observable is an angular distribution or S matrix from a stated interaction at one energy.
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.
FRESCO is a coupled-channels reaction code (I.J. Thompson, Comput. Phys. Rep. 7 (1988) 167). It solves the CC / CRC equations for any number of mass partitions and nuclear excitations, and covers elastic, inelastic, transfer (DWBA and CRC), breakup, and CDCC. This skill lets you build a correct input deck, run it, read the output, and prove the answer against a reference before trusting it.
The hard part of FRESCO is never the physics. It is the arcane namelist input and the convergence parameters. This skill's whole job is to make the input correct on the first or second try and to force a numerical check before any result is reported.
references/verification.md. State the agreement explicitly.空跑 a cluster.examples/ directory holds real decks that reproduce published outputs to 6+ significant figures. Copy the closest one and modify it. This is the anti-hallucination move: FRESCO syntax is easy to get subtly wrong, and a wrong deck often still runs and prints plausible garbage.hort=5 in the actual &FRESCO input. This enables QR stabilization at 5 fm intervals. Verify the solver prints Solutions stabilized at intervals of 5.0 fm; a front-end echo of hort=5 is insufficient. Some CDCC front ends omit it from fort.301: inspect the expanded deck, add hort=5 there if missing, and run that standard namelist deck directly. For first-order runs with iter=1 iblock=1, use hort=0 (the QR path can fail for a single-channel block). Details: references/cdcc-format.md and references/namelist-reference.md.scripts/install_fresco.sh: it checks ~/bin/fresco (override FRESCO_BIN_DIR) and then PATH; if neither has it, it clones the source from https://github.com/I-Thompson/fresco, compiles with gfortran tuned to the build CPU (-O3 -march=native on x86_64, -O3 -mcpu=native on Apple silicon; override with FRESCO_FFLAGS, ~1-2 min), and copies fresco + sfresco into the bin dir. scripts/run_fresco.sh calls this automatically on first use, so you normally never install by hand. Requires gfortran, git, make (macOS: brew install gcc).~/bin or PATH (e.g. an existing FRES 2.9), the installer detects it and does NOT rebuild; force a fresh 3.4 build with scripts/install_fresco.sh --force.examples/, but new 3.x variables may be silently ignored by an older 2.9 binary. If a 3.x-only feature is needed, flag it. See references/failure-modes.md.examples/crc-16O-208Pb-multistep.nin, 17 channels at J=0+; sigma_R = 104.198 mb in every build; 2 to 3 runs per build). The build is serial: both the local tree and upstream FRES 3.5 contain OpenMP runtime queries but no parallel regions, so one deck uses one core and the levers are the compiler and its flags. On x86_64 the native flag matters: about 21 s generic against 16 to 17 s with -march=native on a Threadripper 7970X (gfortran 13.3, shared box at load average 10 to 15 on 64 threads). On Apple silicon (M3 Ultra, gfortran 15.2) it is neutral, 9.3 s either way; the binary previously installed there (2023 compiler, flags unrecorded) took 13.3 s, so rebuilding with a current compiler is what helps. -flto alone made the deck about 1.5x slower on the Threadripper and about 2x slower on the Mac; -funroll-loops alone was neutral. Linking OpenBLAS in place of the bundled lapack.o gained about 7% on the Threadripper, and Accelerate nothing on the Mac, at this size (large CDCC untested). A native binary is not portable across CPUs, so build on each machine. An existing binary is never upgraded automatically: --force rebuilds the checkout in FRESCO_SRC_DIR after a git pull that is allowed to fail, so the FRESCO version usually, but not necessarily, moves to current upstream. For scans, throughput comes from running decks in parallel, one per physical core.fresco < input > output in a clean working directory (FRESCO writes many fort.* files into cwd; always run in a scratch dir, never in a shared source tree).timeout/gtimeout are absent on this macOS. To cap a run, background it and kill, or run on a Linux box. Do not paste timeout ... into a command.FRESCO has two input styles. Pick before writing anything.
&FRESCO &PARTITION &STATES &POT &OVERLAP &COUPLING): full control, required for transfer, custom couplings, and anything non-standard. Default to this for research work.&CDCC &NUCLEUS &BIN &POTENTIAL): a compact front end that auto-generates the bin states and overlaps for a standard CDCC breakup calculation, then expands into the standard format internally (writes the expanded deck to fort.301). Use it only for textbook two-body-projectile CDCC. The moment you need non-standard bins, transfer channels, or hand-built couplings, drop to the standard format. See references/cdcc-format.md.FRESCO is a general coupled-channels code, not a CDCC tool. The same binary does elastic, inelastic, transfer, breakup/CDCC, and capture. What changes between them is which namelists you populate, which example to start from, and a few key parameters. Pick the row first.
| Type | Physics | Namelists beyond the elastic minimum | Start from | Key parameters | Read result from |
|---|---|---|---|---|---|
| Elastic | optical model, one channel | none (just &POT TYPE 0/1/2/3) | examples/B1-elastic.in | hcm, rmatch, jtmax, absend | fort.16 (ratio to Rutherford); reaction σ |
| Inelastic | collective excitation of a bound state | extra &STATES (the excited level, copyp/copyt), deformed &POT TYPE=10/11 (rotor) or 12/13 + &step | examples/B2-inelastic.in | iter=1 (DWBA) vs iblock=2 (full CC); deformation length (p2 of the TYPE 11 term) | outgoing σ per state; fort.201+ |
| Transfer | (d,p), (p,d), stripping/pickup; see sub-types below | 2nd &PARTITION, &OVERLAP bound states, &COUPLING kind=7/5, &CFP amplitudes | examples/B5-transfer.in | nonlocal grid rintp/hnl/rnl/centre, nnu, post vs prior (ip1) | outgoing σ; fort.13 |
| Breakup / CDCC | coupling to the continuum | continuum-bin &STATES/&OVERLAP (isc=2, negative be), &COUPLING kind=3 | examples/be11-, b8ex-, dex-*cdcc*.nin | equal-k bins (energy=F; narrow bins break full CC with charged fragments, see references/cdcc-format.md), rmatch<0 + rasym, jump/jbord, iblock=Nbins+1, smallchan/smallcoup | breakup σ; fort.16 via sumbins, fort.13 via sumxen |
| Capture | radiative capture, astrophysical S-factor | &OVERLAP final bound state, &COUPLING kind=2 (Eλ/Mλ) | examples/B6-capture.in | ip1=λ multipolarity, ip4 direct/semidirect | fort.35 (S-factor); outgoing σ |
Two axes cut across all rows: number of mass partitions (1 for elastic/inelastic/breakup within a partition, 2+ for transfer/capture) and iteration mode (iter>0 perturbative DWBA vs iter=0 iblock=N exact coupled channels). See references/namelist-reference.md for every variable and references/cdcc-format.md for the compact CDCC front end.
"Transfer" splits along two independent axes: how many nucleons move, and whether it is solved perturbatively (DWBA) or to all orders (CRC). These are different inputs, not a naming preference.
| Sub-type | What changes in the deck | Start from | Anchor |
|---|---|---|---|
| One-nucleon transfer (DWBA) | &OVERLAP kind=0 (or 1) single-particle form factor; &COUPLING kind=7 (finite range) or kind=5 (zero range); one &CFP amplitude. iter=1 (one step, forward couplings only). | examples/B5-transfer.in | outgoing σ = 0.26397 |
| Two-nucleon transfer | two-particle overlaps &OVERLAP kind=6-9 built from a &TWONT pair wavefunction (NT(1:4), COEF); needs both the simultaneous (direct 2N) and sequential (via an intermediate one-nucleon partition) paths, so 3 partitions and a chain of kind=6/7 + kind=9 couplings. | examples/2n-transfer-li9tp-simseq.nin (9Li(t,p), sim+seq) | outgoing σ = 6.15287 |
| CRC (coupled reaction channels) | same transfer couplings as DWBA but solved to all orders: iter=0 with iblock spanning the coupled partitions, and reverse couplings kept (icto>0, not negative). Multi-step chains across several partitions (elastic ↔ inelastic ↔ transfer) are CRC. | examples/crc-16O-208Pb-multistep.nin (16O+208Pb, 17O/15N/12C channels) | outgoing σ = 70.97471 |
DWBA vs CRC is the solution mode (iter/iblock + reverse-coupling sign), not a different set of namelists: the same deck run with iter=1 is one-step DWBA and with iter=0 iblock=<N> is CRC. Check DWBA validity by turning on CRC and seeing if the cross section moves. One- vs two-nucleon is a genuinely different &OVERLAP/&TWONT setup. CCBA (coupled-channels Born approximation, e.g. transfer between deformed/inelastically-coupled states) sits between them: inelastic couplings to all orders, the transfer step in Born; see f19xfs in the FRESCO test set.
examples/ (table below).scripts/omp.py, do not type the parameters by hand. For a nucleon entrance or exit channel, omp.py --code kd02 --proj n --target 90Zr --energy 50 prints a ready-to-paste &POT block. Writing 13 KD02 numbers from memory is the single easiest way to produce a deck that runs cleanly and is wrong, and the radius-convention trap below is invisible in the output. See Optical potentials for what the script does and does not cover.references/namelist-reference.md (radial: hcm, rmatch/rasym; partial waves: jtmin, jtmax, jump/jbord; cutoffs: cutr, cutl).scripts/run_fresco.sh <deck>; it runs in a scratch dir and pulls out the integrated cross sections.references/verification.md: vary hcm, rmatch, jtmax, bin count; the observable must be stable to the precision you quote. If you have a published number or a reference deck, compare to N digits with scripts/check_xsec.py.fort.* file (references/output-files.md): fort.13 (total xsec per channel), fort.16 (angular distributions, xmgrace-ready), fort.56 (xsec per J and partition: reaction/nonelastic), fort.201+ (per-state).references/failure-modes.md (symptom to cause to fix) before guessing.scripts/omp.py produces global nucleon optical potentials as ready-to-paste &POT blocks. Pure Python, standard library only, so it runs anywhere FRESCO does and needs no Fortran toolchain of its own.
| Code | Reference | Projectiles |
|---|---|---|
kd02 | Koning and Delaroche, Nucl. Phys. A713 (2003) 231 | n, p |
ch89 | Varner et al. (Chapel Hill 89), Phys. Rep. 201 (1991) 57 | n, p |
python scripts/omp.py --code kd02 --proj n --target 90Zr --energy 50
python scripts/omp.py --code ch89 --proj p --target 208Pb --energy 30 --format table
python scripts/omp.py --selftest
Targets parse as 90Zr, Zr-90, or 40,90 (Z,A); an impossible nuclide is rejected rather than quietly evaluated, and a target or energy outside the published fit range is flagged on stderr as extrapolation (KD02 A=24-209, CH89 A=40-209 and E=10-65 MeV). --format gives fresco (default), table, or json. --kp sets the potential index when a deck needs several.
Why to use it rather than typing the parameters. The formulas are not the hard part; the handoff into FRESCO is. Three things go wrong silently, meaning the deck runs and prints a plausible cross section that is wrong:
R = r0*(Ap^1/3 + At^1/3), while KD02 and CH89 are both defined on R = r0*At^1/3. The fix is ap=0 in the type=0 line, which the script always emits. Get it wrong on a nucleon projectile and every radius is about 22% too large.W_d goes in p4 of the type=2 line, not p1. In p1 it becomes a real surface well and the absorption quietly drops.type=0 is mandatory even for neutrons, because that line is what declares the radius convention. rc is then unused but must still be there.Verification. Both parameterizations are transcribed from production Fortran (Koning's own kd02.f, and the TWOFNR-derived ch89.f), and --selftest checks 39 values pinned from those sources. CH89 matches to machine precision. KD02 agrees to about 7 digits and no more, for an understood reason: that kd02.f is single precision wherever Fortran lets it be. The declared variables are real*8, but that does not make the arithmetic double: the literals are truncated, with 59.30 entering as 59.2999992370605, and some subexpressions are evaluated in single precision before ever meeting a real*8, since 1./3. is a single-precision divide and real(N-Z) carries no kind argument so it drops to real(4). The ch89.f suffixes every constant with d0, which is why it reproduces exactly. Recompiling the reference kd02.f with -fdefault-real-8 matches this module to 16 digits, so the Python is the more accurate of the two and the residual belongs to the Fortran. At the three or four physically meaningful digits of a global optical potential this is irrelevant, but anything above the 2e-7 tolerance is a real bug rather than the literal artifact. End to end, the generated deck reproduces sigma_R = 1301.64017 mb for n+90Zr at 50 MeV, identical to a hand-built deck.
Two deliberate differences from the reference Fortran, both in CH89: that ch89.f computes the spin-orbit term internally but never returns it, and its caller has those lines commented out, so the reference CH89 path carries no spin-orbit at all. Elastic scattering needs it, so omp.py returns it; pass --no-spin-orbit to reproduce the reference behaviour. Separately, the reference caller hardcodes rc = 1.24 while omp.py uses the Varner form (1.24*A^1/3 + 0.12)/A^1/3.
Scope. Nucleon global potentials only. The script does not fit, does not build local-equivalent potentials, and does not touch nonlocality. Composite projectiles are out of scope: for deuteron CDCC the fragment potentials are p+A and n+A at roughly half the deuteron energy, which you build by calling this script twice, not by asking it for a deuteron potential. If a calculation needs Becchetti-Greenlees, Daehnick, or an alpha potential, take it from the literature and say so in the deck comments.
All reproduce their reference output on ~/bin/fresco (FRES 2.9) to the digits noted in references/verification.md.
| File | Reaction | Method | Anchor (integrated) |
|---|---|---|---|
examples/B1-elastic.in | p + 78Ni, 3 energies | Optical-model elastic | reaction σ = 1575.175 mb |
examples/B2-inelastic.in | α + 12C → 12C*(2+, 4.43) | Inelastic, rotor deformation, DWBA | outgoing σ = 31.67415 mb |
examples/B5-transfer.in | one-nucleon (d,p)-type | Finite-range DWBA transfer | outgoing σ = 0.26397 mb |
examples/2n-transfer-li9tp-simseq.nin | 9Li(t,p), sim + seq | Two-neutron transfer (kind 6/7/9, &TWONT) | outgoing σ = 6.15287 mb |
examples/crc-16O-208Pb-multistep.nin | 16O+208Pb, 17O/15N/12C | Multi-step CRC (4 partitions) | outgoing σ = 70.97471 mb |
examples/B6-capture.in | radiative capture | E1/M1 capture (kind=2) | outgoing σ = 0.00330 mb |
examples/be11-cdcc-lowlevel.nin | 11Be + 197Au @ 42 MeV | CDCC Coulex, standard format | reaction 2758.687, absorption 423.915 |
examples/b8ex-cdcc-lowlevel.nin | 8B + 208Pb s-wave | CDCC breakup, standard format | breakup σ = 58.36164 mb |
examples/dex-deuteron-cdcc.nin | d + target | Deuteron CDCC | absorption 2154.845, outgoing 1234.089 |
The -lowlevel CDCC decks are in the fully expanded standard namelist format (explicit &States/&Pot/&Overlap bins), which is what you want to read and adapt for research. For the compact &CDCC front end, see references/cdcc-format.md.
references/namelist-reference.md: every namelist and its frequently-used variables, organized by task (grid, partial waves, potentials by TYPE/SHAPE, states, overlaps by KIND, couplings by KIND). This is the distilled dictionary; the 45-page manual is the fallback for rare options.references/cdcc-format.md: the high-level &CDCC/&NUCLEUS/&BIN/&POTENTIAL format and when to use it.references/output-files.md: the fort.* file allocation table and how to pull each observable.references/failure-modes.md: symptom → cause → fix, seeded from the manual footnotes and real gotchas. Grow this file every time a new failure is diagnosed.references/verification.md: the anchor cases with exact expected numbers, and the convergence-check protocol.scripts/install_fresco.sh [--force] [--verify]: ensures a fresco/sfresco binary exists, building it from https://github.com/I-Thompson/fresco with gfortran if missing (see Environment above). --verify runs the B1-elastic anchor and checks it reproduces σ_R = 1575.175 mb. Idempotent; safe to call before any run.scripts/omp.py --code <kd02|ch89> --proj <n|p> --target <90Zr> --energy <MeV>: prints a KD02 or CH89 global nucleon optical potential as a ready-to-paste &POT block, with the ap=0 radius convention already applied. --format table|json for other output, --selftest to verify against the reference values. See Optical potentials above.scripts/run_fresco.sh <deck.in> [runname]: copies the deck into a fresh scratch dir, runs the fresco binary (auto-installing it via install_fresco.sh on first use), and prints the integrated cross sections. Keeps you from polluting source trees with fort.* files.scripts/check_xsec.py <output> [--ref <refoutput>] [--sigfig N]: parses the cumulative reaction / outgoing / absorption cross sections from a FRESCO output and, given a reference, reports agreement to N significant figures.FRESCO computes elastic, inelastic, transfer (DWBA and CRC), breakup, CDCC, and capture. It does not compute inclusive non-elastic breakup (IAV / NEB); that is a separate calculation done by the user's own smoothie code. If the task is really an IAV / inclusive-breakup problem, this is the wrong tool. This skill is for direct FRESCO work: elastic/inelastic, plain CDCC breakup, transfer/DWBA, and capture.
Fitting a deck to data (chi-squared search over potential parameters, spectroscopic amplitudes, R-matrix widths or dataset normalisations) belongs to the sfresco skill, which owns the .search file format, the MINUIT session, and the error/correlation reporting. Build and converge the deck here first; that is a hard precondition of any fit.
AGENTS.md (opens in a new tab)examples/2n-transfer-li9tp-simseq.nin (opens in a new tab)examples/B1-elastic.in (opens in a new tab)examples/B2-inelastic.in (opens in a new tab)examples/B5-transfer.in (opens in a new tab)examples/B6-capture.in (opens in a new tab)examples/b8ex-cdcc-lowlevel.nin (opens in a new tab)examples/be11-cdcc-lowlevel.nin (opens in a new tab)examples/crc-16O-208Pb-multistep.nin (opens in a new tab)examples/dex-deuteron-cdcc.nin (opens in a new tab)examples/n90Zr-kd02-50MeV.in (opens in a new tab)references/cdcc-format.md (opens in a new tab)references/failure-modes.md (opens in a new tab)references/namelist-reference.md (opens in a new tab)references/output-files.md (opens in a new tab)references/verification.md (opens in a new tab)scripts/check_xsec.py (opens in a new tab)scripts/install_fresco.sh (opens in a new tab)scripts/omp.py (opens in a new tab)scripts/run_fresco.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
nuclear-reactions, coupled-channels, optical-model, cdcc, dwba, fresco-input
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