Separating the transient grating#
A collection window behind the signal corner gathers more than the transient-grating
signal. The nonlinear part of the field, \(N = E - e^{Lz}E(0)\)
(pnps.simulate.visit_nonlinear()), holds everything the Kerr response
generated. That includes third-order light made by fewer than three arms: each
beamlet’s self-phase modulation, and the cross-phase modulation and two-beam mixing
of each pair. All of it spreads in momentum, and a large window collects some of it.
pnps.separation takes the three-arm signal apart from the rest. The
difference between a window’s whole record and its transient-grating record then
shows how much of the window’s light is not signal.
Inclusion and exclusion over the arms#
Write \(N(S)\) for the nonlinear part of a run whose input holds only the arms \(S\):
the two gates 1 and 2 and the test arm 3, each formed exactly as it is in the whole
input (pnps.form_input.form_input() with arms). The transient-grating field
is
Each arm appears in four of the seven runs, with signs that sum to zero. So any term of \(N\) that lacks one of the arms cancels, and the terms that hold all three survive. To first order in the response every term of \(N\) is cubic in the input, and \(N_\mathrm{TG}\) is exactly the part with one factor from each arm, which is the transient grating. Beyond first order it is still the part of \(N\) that vanishes whenever any arm is blocked, so it includes the signal’s cascaded corrections. The rest, \(N(123) - N_\mathrm{TG} = N(12) + N(13) + N(23) - N(1) - N(2) - N(3)\), is the light of the single arms and of the pairs.
The windows are quadratic in the field, so the combination has to be made on \(N\)
itself, at each save plane, before any window acts. The separated field is then
collected through the windows’ exact hard discs
(pnps.exact_windows.ExactWindows, Masks and collection windows), as
Config.exact_windows collects the whole of \(N\). This is why the separation needs
exact_windows. It also needs the three-arm "tg" layout: the self-diffraction
layout has no transient grating.
How it runs#
Each subset is one propagation through the slab on the configuration’s bridge. Three facts keep the cost and the memory down:
The gate subsets carry no delay. Their part, \(N(12) - N(1) - N(2)\), is the same at every delay. It is propagated once per process and kept (
pnps.separation.Separation.gate_terms()). Each delay then costs four runs, the four subsets that hold the test arm, instead of seven.The runs are summed as they go. The backend holds one run’s state at a time, as in a scan. At each save plane the host adds the field, with its sign, into one field volume per plane, so the seven fields are never held together.
The linear parts cancel. The input of each arm enters \(N_\mathrm{TG}\) with weights that sum to zero, so its linear propagation cancels too, and \(N_\mathrm{TG}\) is the same combination of the propagated fields. The linear propagator is applied once per plane, for the records of the whole \(N(123)\) and of the remainder. It is tabulated once per plane and kept.
On the tiny test grid, the separated spectra agree with the seven nonlinear parts
formed and combined one by one to 4e-15 of their peak. The whole \(N(123)\) agrees with
the record a scan writes to the same bound (tests/test_separation.py). With the
test arm 10 fs away from the gates, the 1 fs pulses no longer meet. The
transient-grating energy in each window then falls to below 1e-4 of its value at zero
delay, while the remainder keeps 0.2 to 0.4 of its own.
Memory. The host holds, per save plane, the gate part, the running combination and the linear propagator: three field volumes. On the 768 x 768 x 600 production grid one volume is 5.7 GB, so three planes take 51 GB. The exact windows’ masks take 15 GB for six windows on the production band, and a few volumes of working space come on top. Measured at the production shape with three planes and six windows, the process peaked at 111 GB, so ask for about 160 GB. The device holds one run, the same memory as a scan.
Cost. Per delay, four propagations, plus the host’s work on the whole input’s planes: three exact reductions and one host reduction per plane. On 16 cores of an EPYC 7513 that work took 28 to 33 s per plane, against 0.5 to 0.7 s per plane for summing a subset’s field in. Once per process come the three gate runs, the linear propagators (130 s for three planes) and the masks (20 s).
Running a separation#
pnps separate RUN.toml runs the separation a run file describes. It takes the same
options as pnps scan (--shard I/N, --indices, --backend, --recompute), and
its shards merge with pnps merge (Run files, the command line and clusters). In Python it is
pnps.scan.run_separation_scan(), or pnps.separation.Separation on a
bridge for one delay at a time.
Give the separation a run file with a scan name of its own. It writes
<name>_collected.h5, and it refuses to write into a file that is not a separation.
A scan likewise refuses to resume into a separation file. The bridge always reduces
on the host, whatever the configuration’s reduction says.
The file has the usual layout (pnps.io_h5), so a reader that takes a scan
file takes this one unchanged:
Dataset |
Holds |
|---|---|
|
\(N_\mathrm{TG}\) through each exact disc: the collected and the on-axis re-imaged spectrum |
|
\(N_\mathrm{TG}\) over the signal region and over the whole beam |
|
what the lap budget removed from \(N_\mathrm{TG}\)’s beam spectrum |
|
the whole \(N(123)\), as a scan of the same configuration records it |
|
the remainder \(N(123) - N_\mathrm{TG}\) |
|
|
|
the combination, in words |
|
turns a trace summed over frequency into joules: a window’s energy is |
All spectra are in the units of a scan’s records and on its frequency axis. A scan of the same configuration can therefore be compared with them cell for cell, and its full record minus the transient-grating record is what the window gathers besides the signal. The spectra are not additive: the collected energy of \(N(123)\) includes the cross term between \(N_\mathrm{TG}\) and the remainder.
examples/runs/frog2_tg_separation.toml is the separation of the FROG2 campaign’s
common instrument: its 768 x 768 x 600 grid, six windows, three planes and 27
delays.