API Reference¶
ElectrostaticDrive
¶
Bases: Module
Very simple electrostatic drive: E_∥ ~ C_{0,0} / kpar; dC_{1,0}/dt += - coef * sqrt(2) * i * E_∥
LenardBernstein
¶
Bases: Module
Diagonal Lenard–Bernstein model in Hermite–Laguerre space: dC/dt += -nu*(α n + β m) C.
NonlinearConvolution
¶
Bases: Module
Quadratic E–a convolution in Fourier space, only Laguerre m=0 is active.
State expected (nonlinear mode): C[k, n, m], complex. E_k = i * a_{k, n=0, m=0} / k N_{k, n>=1, m=0} = sqrt(2n) * sum_{k'} E_{k'} * a_{k-k', n-1, m=0} = sqrt(2n) * IFFT[ FFT(E) * FFT(a[:, n-1]) ]
Notes
- Assumes a uniform FFT grid in k (use klist of equally spaced values).
- Leaves Laguerre m>0 untouched; only m=0 updated.
StreamingOperator
¶
Bases: Module
Hermite streaming along straight B; Fourier in z with kpar.
dC_{n,m}/dt += -i * (kpar*vth/sqrt(2)) * [ sqrt(n+1) C_{n+1,m} + sqrt(n) C_{n-1,m} ]
__call__(C)
¶
Complex-space streaming RHS.
StreamingOperatorKS
¶
Bases: Module
Streaming with multiple Fourier modes: expects C[k, n, m].
panel_energy(ax, res)
¶
[0,0] Energies vs t: W_f, W_E, ∫C dt, ∫P_N dt, and their sum.
plot_energy(res)
¶
Interactive energy panel (same as summary [0,0]).
save_summary(res, out_png)
¶
Save a 3x2 summary figure composed from reusable panel functions.
Layout
(0,0) Energies vs t: W_f, W_E, ∫C dt, and W_f+W_E+∫C dt (0,1) density(x,t) imshow (vertical = x, horizontal = t) (1,0) f(v_parallel, v_perp) imshow at t=0 (1,1) f(v_parallel, v_perp) imshow at final time (2,0) Hermite heatmap |C_{n,m=0}(t)| (2,1) Stacked heatmap of |C_{n,m}(t)| blocks over time
info_line(msg)
¶
Print a single status line (respects Rich/NO_COLOR settings).
init_pretty(prefer_rich=True)
¶
Initialize pretty output. - Disables color if NO_COLOR is set (case-insensitive). - Uses Rich only if available, preferred, and NO_COLOR is not set. - Prints a minimal tip if Rich is preferred but not installed.
ComplexTerm
¶
Bases: Protocol
Any physics operator that maps complex HL coefficients to a complex RHS.
````