GUI workflows¶
Task-oriented quick reference: "I want to do X, where do I click?"
"I want to load a TraceWin .dat and run it"¶
- Lattice tab → Open… (or File → Open Lattice…, Ctrl+O) →
pick
.dat. - Beam tab → set energy, current, distribution → Apply.
- Numerics tab → leave defaults for first run.
- Toolbar → click Run Envelope (fast σ-only pass) or Run Multi-particle.
- Results tab → click any tile.
"I have a TraceWin project (.dat + .ini) and want its beam in HELIX"¶
TraceWin keeps the input beam you typed into its Main/Beam panels
in <project>.ini, next to the deck. Three routes; all three end with
the beam in the Beam tab as the session beam, the project marked dirty,
and every conversion warning in the console.
Route A — open the deck and say yes (a TraceWin project folder, first look):
- File → Open Lattice… (Ctrl+O) → pick
<project>.dat. - HELIX finds
<project>.ininext to it and asks Import its beam into the Beam tab? This replaces the current beam settings. Click Yes. (No keeps whatever beam you had — nothing is read silently, and opening a.lgprojnever asks.) - Beam tab → check species, energy, frequency, current, particle
count, ε and Twiss.
alpha_zalready has HELIX's sign. A LEBT project (no longitudinal emittance) arrives with Continuous beam ticked; set the DC energy spread yourself. - Set what the file does not carry — distribution type, cut-off, centroids — then Apply if you changed anything.
- File → Save Project so the
.lgprojcarries the beam; from now on open the project, not the deck.
Route B — the deck is already open, or the .ini lives elsewhere:
- Beam tab → Import TraceWin .ini… → pick the file (any name, any folder).
- Read the status line next to the button (species, energy, frequency, current, particle count, and a warning count) and the console.
- Continue with steps 4–5 of route A.
Route C — a new HELIX project from a TraceWin deck:
- File → New Project… (Ctrl+N) → name and location → Import an
existing lattice → browse to
<project>.dat. - The checkbox Also import the beam from the TraceWin .ini next to
the deck lights up when a sibling
.iniexists; tick it. With Copy the lattice into the project folder the.iniis copied alongside. - OK — the project opens with the imported beam and its
.lgprojis already written.
When something does not fit: a user-defined particle in the file
(an ion, a My_particle slot) has no HELIX species — the import keeps
the species selected in the Beam tab and says so in the console; pick
the right one first. A value outside a field's range is clamped and
reported. The PICNIC mesh sizes are recorded in the project file but
not applied — HELIX's space-charge grid is set on the Numerics tab.
For a second TraceWin input beam, or a deck whose .ini you want to
use for one headless run only, use the CLI (twini --beam 2,
--tracewin-ini): see Importing TraceWin project settings.
"I want to match Twiss to a target"¶
The matcher's variables and constraints come exclusively from
ADJUST_* / SET_* cards in the .dat — there is no GUI entry for
them. The realistic flow:
- Load lattice (see above).
- Add a Marker at the target s (Lattice tab → + Add… → Marker).
- Save the lattice (Ctrl+S), then add the matching cards to the
.datin a text editor:ADJUSTcards on the quads you want to tune and aSET_TWISS(or otherSET_*) card at the target — see SET / ADJUST cards for the syntax. - Reload the lattice (Lattice tab → Reload).
- Matching tab → Match; watch the live convergence dialog.
- Apply to commit the matched values, then Save the matched
.dat(or use Save matched .dat to export a copy). - Verify with Run Envelope and the Results tab.
"I want to run an alignment-tolerance study"¶
- Load lattice.
- Error Study tab → Element errors → add
dx, dyerrors atQUAD_*with σ = 0.2 mm. - Set n_seeds = 50 (or more for production).
- Click Run study.
- Results tab → Error-study ensemble tile.
"I want to see what's happening at element X"¶
- Lattice tab → click element X in the timeline or listing.
- Inspector on the right shows all parameters.
- (Optional) Add a Marker before/after for a snapshot — or set Numerics tab → Snapshot every N for periodic dumps.
- After running: Results tab → PHASE SPACE · DIAGNOSTICS → Phase space (4-panel) tile shows the full phase-space at the snapshot.
"I want to start a new project"¶
- File → New Project… (Ctrl+N, or the toolbar New button).
- Pick a name and a location — a folder
<name>/is created there. - Choose the starting point: a blank lattice (one editable
drift), import an existing
.dat(copied into the folder by default so the project stays portable; when a TraceWin<deck>.inisits next to it, a checkbox also imports that project's beam — see Beam tab), or a bundled example (FODO cell, solenoid channel, DTL section). - The project opens immediately; simulation outputs land in
<name>/runs/, so the whole folder can be moved, archived or version-controlled as one unit. File → Save Project updates the same.lgprojfrom then on.
"I want to compare two simulations"¶
- Run simulation 1 → File → Save Project As…
sim1.lgproj. - Modify whatever you want changed → Run simulation 2 →
File → Save Project As…
sim2.lgproj. - Open both projects in two HELIX windows side by side.
- Tile-by-tile visual comparison.
(A built-in diff/overlay is on the roadmap.)
"I want to use the GPU"¶
- Numerics tab → PIC backend → gpu (or auto; the combo also offers cuda and mps to pin a specific device type).
- Run as usual.
If the GPU isn't available you'll see a console warning; HELIX falls back to CPU.
"I want to run a multi-particle simulation through the differentiable PIC"¶
- Numerics tab → SC engine →
torch. - (Grid mode, PIC backend, DC kernel will grey out — expected.)
- Toolbar → click Run Multi-particle.
The torch backend is ~5× slower than the default numpy PIC but
matches it numerically. Pick it only when you need an autograd-
differentiable kick (e.g. chaining the simulation into a gradient-
based optimiser); for ordinary forward runs leave SC engine on
numpy. See
Differentiable PIC.
"I want to match through non-linear PIC space charge"¶
- Load a lattice with
ADJUST_*+SET_TWISS/SET_SIZEcards. The lattice must be all-linear (drift / quad / solenoid / dipole / edge — no RF or field maps). - Matching tab → Algorithm →
gradient. - Tick Space charge.
- Click Match.
- Apply or Save matched .dat when done.
This is the only HELIX matcher that solves through non-linear PIC space charge. See Gradient algorithm.
"I want to reconstruct the input beam from an exit distribution"¶
- Either run a forward multi-particle simulation first (its final
beam becomes selectable as the source), or have an exit-plane
.dstat hand (measured or exported). - Toolbar Simulate → Backtrack Distribution…
- Pick the source, the element range (defaults: full lattice), the
field-map inverse (
rk4, the exact default — round trips close at ~1e-13), and optionally tick space charge (uses the Numerics-tab SC settings) or set an output.dstfor the reconstructed entrance distribution. - Click OK — progress appears on the toolbar; Stop aborts at the next element boundary.
- The Results tab then shows the backward walk reversed to increasing s: index 0 is the reconstructed entrance. Losses cannot be undone — the reconstruction covers survivors only.
CLI equivalent: python -m linac_gen backtrack.