pyna.topo.fpt#
Functional perturbation theory shift hierarchy for field-line topology.
This module is the public landing zone for perturbative shifts of orbits,
trajectories, cycles, invariant tori, and invariant manifolds under a global
magnetic-field change. The C++ backend lives in pyna._cyna; this module
keeps the mathematical names and the field-cache convention visible.
For a toroidal field-line ODE
dX/dphi = f(X, phi) = (R * BR / BPhi, R * BZ / BPhi),
the first-order shift under a full-field perturbation is
d(delta_X)/dphi = A(X, phi) delta_X + delta_f(X, phi),
where A = partial f / partial (R, Z). delta_X_pol is the zero-initial
particular solution. delta_X_cyc is the periodic cycle displacement:
delta_X_cyc(phi) = delta_X_pol(phi) + DP(phi) delta_X_cyc(phi0), (I - DP(T)) delta_X_cyc(phi0) = delta_X_pol(phi0 + T).
For field-period-symmetric stellarators, use T = 2*pi / Nfp for one
field-period cycle, so the returned delta_X_cyc should repeat every field
period.
Classes#
First-order shift data along a traced field-line orbit. |
|
Shift of an open trajectory with a specified initial displacement. |
|
Shift of a periodic cycle under a full magnetic-field change. |
|
Placeholder for invariant-torus shift solvers. |
|
Placeholder for stable/unstable manifold shift solvers. |
Functions#
|
Compute cycle FPT shift from cylindrical vector-field objects. |
|
Compute |
Module Contents#
- class pyna.topo.fpt.OrbitPerturbationShift[source]#
First-order shift data along a traced field-line orbit.
- delta_X_pol: numpy.ndarray[source]#
- alive: numpy.ndarray[source]#
- class pyna.topo.fpt.TrajectoryPerturbationShift[source]#
Bases:
OrbitPerturbationShiftShift of an open trajectory with a specified initial displacement.
- class pyna.topo.fpt.CyclePerturbationShift[source]#
Bases:
OrbitPerturbationShiftShift of a periodic cycle under a full magnetic-field change.
delta_X_polis the particular solution with zero initial displacement.delta_X_cycis the periodic physical cycle shift. For an Nfp-periodic stellarator axis cycle, passphi_span=2*pi/Nfpand verify thatdelta_X_cyc[-1]matchesdelta_X_cyc[0].- delta_X_cyc: numpy.ndarray[source]#
- delta_X_cyc0: numpy.ndarray[source]#
- property periodic_residual: numpy.ndarray[source]#
Return
delta_X_cyc(end) - delta_X_cyc(start).
- class pyna.topo.fpt.InvariantTorusPerturbationShift(*args, **kwargs)[source]#
Placeholder for invariant-torus shift solvers.
The public class is reserved here so callers can discover the intended FPT hierarchy. Fourier/KAM torus-shift implementations should land behind this name instead of creating ad-hoc modules.
- class pyna.topo.fpt.StableManifoldPerturbationShift(*args, **kwargs)[source]#
Placeholder for stable/unstable manifold shift solvers.
Planned implementation: compute the X-cycle shift, perturb the DPm eigenvalue/eigenvector that defines the X-leg seed direction, deploy seed points with geometric spacing so one P^m image lands just beyond the last seed, advect each seed displacement along the field line, then report the normal component of the displaced manifold arc. The placeholder prevents future agents from creating duplicate one-off stable-manifold perturbation APIs.
- pyna.topo.fpt.compute_cycle_shift(R0: float, Z0: float, phi0: float, phi_span: float, base_field: Any, pert_field: Any, *, dphi_out: float = 0.01, DPhi: float = 0.01, fd_eps: float = 0.0001) CyclePerturbationShift[source]#
Compute cycle FPT shift from cylindrical vector-field objects.
base_fieldandpert_fieldmay beVectorFieldCylindinstances, compatible field-like objects, or legacy field-cache dicts.
- pyna.topo.fpt.compute_cycle_shift_from_cache(R0: float, Z0: float, phi0: float, phi_span: float, base_field_cache: Any, pert_field_cache: Any, *, dphi_out: float = 0.01, DPhi: float = 0.01, fd_eps: float = 0.0001) CyclePerturbationShift[source]#
Compute
delta_X_poland periodicdelta_X_cycusing cyna.base_field_cacheandpert_field_cachemay beVectorFieldCylindobjects, compatible field-like objects, or legacy field-cache dicts containingBR, BZ, BPhi, R_grid, Z_grid, Phi_grid. Component order is always canonicalBR, BZ, BPhi.