UPDE Moving-Frame Engine¶
MovingFrameUPDEEngine is the PHA-C.3 kinematic phase-dynamics surface for
systems where each oscillator has both a phase and an absolute axial coordinate
in a chamber-fixed reference frame. It composes two existing production
contracts:
SpatialCouplingModulatorcomputes distance-dependentK_nm(z)from the current axial positions.DopplerEnginecomputes velocity-dependent detuning from the active coupling graph.
The engine then advances phase and position as one coupled step. This is the surface to use when phase synchronisation depends on moving geometry rather than only on oscillator labels.
Use cases¶
Use the moving-frame engine for domains where a fixed graph is physically incorrect:
- counter-propagating plasmoid or particle packets approaching a chamber reference point;
- mobile sensor or clock swarms where distance and relative velocity alter synchronisation;
- acoustic, RF, or oscillator networks with line-of-flight detuning;
- digital-twin studies where collision or merge timing must be tied to the same integration clock as phase dynamics;
- MIF-style axial merger scenarios that require both
R(t)andz_i(t).
Mathematical contract¶
For every outer integration step s, with axial positions z_i(s) and scalar
velocities v_i(s):
K_eff_ij(s) = K_base_ij * g(|z_i(s) - z_j(s)|)
D_i(s) = doppler_strength * sum_j |K_eff_ij| * (v_i - v_j) / (|v_i| + eps)
/ sum_j |K_eff_ij|
omega_eff_i(s) = omega_i(s) + D_i(s)
theta(s + dt) = UPDE(theta(s), omega_eff(s), K_eff(s), alpha, dt)
z_i(s + dt) = z_i(s) + v_i(s) * dt
g(distance) is the configured SpatialCouplingModulator decay kernel:
inverse_plus_one, exponential, power_law, or inverse_distance. The
position update is ballistic over each outer step, which is exact for fixed
velocity over that step and consistent with the row-major velocity schedule used
by the backend contract. Production validation signs this kinematic identity
explicitly: the expected final coordinate is
z(0) + dt * sum_s velocity_schedule[s], and every backend row must keep the
maximum absolute residual below 1e-9 m before the run is accepted.
The benchmark also replays the derived summary equations
max_abs_velocity = max(|velocity_schedule|) and
path_length_max = max_i sum_s |velocity_schedule[s, i] * dt| under
KINEMATIC_SUMMARY_REPLAY_TOLERANCE.
Public API¶
import numpy as np
from scpn_phase_orchestrator.coupling import SpatialCouplingModulator
from scpn_phase_orchestrator.upde import MovingFrameUPDEEngine
knm = np.array([[0.0, 0.4], [0.4, 0.0]])
engine = MovingFrameUPDEEngine(
2,
omega=np.array([0.1, -0.1]),
k_nm=knm,
alpha=0.0,
dt=1.0e-9,
positions_t0=np.array([-1.0e-6, 1.0e-6]),
velocities=np.array([500.0, -500.0]),
spatial_modulator=SpatialCouplingModulator(K_base=0.8),
doppler_strength=0.01,
solver="rk45",
)
phases = engine.run(n_steps=2)
positions = engine.positions
near_reference = engine.collision_imminent(threshold_m=1.0e-9)
residual_m = engine.state.kinematic_residual_max_m
positions_t0 must be a finite axial vector with shape (n,). velocities
may be a fixed vector or a callable velocities(t) -> array, matching the
Doppler schedule contract. omega may be fixed or callable, matching the
standard UPDEEngine time-varying frequency contract.
Collision predicate¶
collision_imminent(threshold_m=...) checks current distance to the reference,
next-step distance under the currently resolved velocity, and sign-crossing of
the chamber reference. With threshold_m=0.0, exact crossing is still detected.
This makes it useful for merge-window monitors without forcing every caller to
manually inspect signed positions.
Downstream handoff¶
Moving-frame outputs can be passed to build_pha_c_handoff_record(...) after a
merge-window evaluation when a downstream lane needs compact event evidence
instead of full phase/position arrays. The handoff keeps scalar lock evidence,
order-parameter evidence, vector digests, and a canonical event hash while
remaining non-actuating.
from scpn_phase_orchestrator.upde.pha_c_handoff import (
build_pha_c_handoff_record,
)
record = build_pha_c_handoff_record(
phases,
positions,
t=engine.time,
phase_tol_rad=0.01,
spatial_tol_m=0.002,
required_consecutive_samples=1,
)
Backend contract¶
The backend-neutral function moving_frame_run(...) accepts row-major schedules
and returns a flat vector:
Python, Rust/PyO3, Go, Julia, and Mojo source surfaces share the same contract.
Optional accelerator runtimes are feature-detected; unavailable runtimes are
reported by the benchmark rather than hidden.
The benchmark also records expected_final_position_sha256,
reference_kinematic_residual_max_m, kinematic_residual_contract_passed,
final_position_equation_validated, max_abs_velocity_equation_validated,
path_length_equation_validated, kinematic_equations_validated,
max_abs_velocity_m_per_s, and path_length_max_m so polyglot rows cannot
pass with a numerically correct phase vector but a physically wrong coordinate,
velocity, or path-length summary.
Committed benchmark JSON is local regression and parity evidence only. It is not a production throughput claim unless rerun under the repository benchmark isolation protocol.
Failure boundaries¶
The moving-frame engine fails closed on:
- non-finite, complex, object-dtype, or boolean phase, position, omega,
velocity,
K_nm, oralphainputs; - non-zero self-coupling diagonal in the base
K_nm; - malformed schedule shapes or mismatched oscillator counts;
- negative collision thresholds;
- non-positive spatial decay scale, spatial epsilon, or Doppler epsilon;
- backend output with non-finite positions, phases outside
[0, 2*pi), or final positions that violate the ballistic schedule residual tolerance.
MovingFrameUPDEEngine ¶
MovingFrameUPDEEngine(
n: int,
omega: object,
k_nm: object,
alpha: object = 0.0,
dt: float = 0.01,
positions_t0: object | None = None,
velocities: object
| Callable[[float], object]
| None = None,
spatial_modulator: SpatialCouplingModulator
| None = None,
reference_point: float = 0.0,
doppler_strength: float = 1.0,
doppler_epsilon: float = 1e-09,
solver: str = "rk45",
phases: object | None = None,
velocity_axis: object | None = None,
t0: float = 0.0,
)
Bases: DopplerEngine
UPDE engine with chamber-frame axial positions and collision checks.
Source code in src/scpn_phase_orchestrator/upde/moving_frame.py
Attributes¶
positions
property
¶
Current absolute axial coordinate for each oscillator.
Returns¶
FloatArray Current absolute axial coordinate for each oscillator.
distance_to_reference
property
¶
Absolute distance from each oscillator to the chamber reference.
Returns¶
FloatArray Absolute distance from each oscillator to the chamber reference.
knm_effective
property
¶
Most recently applied distance-modulated coupling matrix.
Returns¶
FloatArray Most recently applied distance-modulated coupling matrix.
kinematic_residual_max_m
property
¶
Maximum residual against z_next = z + v*dt in the last run.
Returns¶
float
Maximum residual against z_next = z + v*dt in the last run.
max_abs_velocity_m_per_s
property
¶
Maximum absolute axial velocity used by the last step or run.
Returns¶
float Maximum absolute axial velocity used by the last step or run.
path_length_max_m
property
¶
Maximum per-oscillator axial path length in the last step or run.
Returns¶
float Maximum per-oscillator axial path length in the last step or run.
state
property
¶
Return the current moving-frame diagnostic snapshot.
Returns¶
MovingFrameState Return the current moving-frame diagnostic snapshot.
Methods:¶
collision_imminent ¶
Return whether any oscillator is at or crosses the reference soon.
Parameters¶
threshold_m : float Distance threshold in metres.
Returns¶
bool
True when an oscillator is at or crossing the reference within one step.
Source code in src/scpn_phase_orchestrator/upde/moving_frame.py
step ¶
step(
phases: object | None = None,
omegas: object | None = None,
knm: object | None = None,
zeta: float = 0.0,
psi: float = 0.0,
alpha: object | None = None,
) -> FloatArray
Advance one coupled phase/position step.
Parameters¶
phases : object | None
Oscillator phases in radians, shape (N,).
omegas : object | None
Natural frequencies in rad/s, shape (N,).
knm : object | None
Coupling matrix K_nm, shape (N, N).
zeta : float
External drive strength ζ.
psi : float
External drive reference phase Ψ in radians.
alpha : object | None
Phase-lag matrix in radians, shape (N, N), or None for no lag.
Returns¶
FloatArray The phases after one coupled phase/position step.
Source code in src/scpn_phase_orchestrator/upde/moving_frame.py
run ¶
run(
phases: object | None = None,
omegas: object | None = None,
knm: object | None = None,
zeta: float = 0.0,
psi: float = 0.0,
alpha: object | None = None,
n_steps: int = 1,
) -> FloatArray
Run n_steps of joint phase and axial-position dynamics.
Parameters¶
phases : object | None
Oscillator phases in radians, shape (N,).
omegas : object | None
Natural frequencies in rad/s, shape (N,).
knm : object | None
Coupling matrix K_nm, shape (N, N).
zeta : float
External drive strength ζ.
psi : float
External drive reference phase Ψ in radians.
alpha : object | None
Phase-lag matrix in radians, shape (N, N), or None for no lag.
n_steps : int
Number of integration steps to run.
Returns¶
FloatArray
The final phases after n_steps joint phase/position steps.
Source code in src/scpn_phase_orchestrator/upde/moving_frame.py
1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 | |
moving_frame_run ¶
moving_frame_run(
phases: object,
positions: object,
omega_schedule: object,
knm: object,
alpha: object,
velocity_schedule: object,
spatial_modulator: SpatialCouplingModulator,
doppler_strength: float = 1.0,
doppler_epsilon: float = 1e-09,
zeta: float = 0.0,
psi: float = 0.0,
dt: float = 0.01,
method: str = "rk45",
n_substeps: int = 1,
atol: float = 1e-06,
rtol: float = 0.001,
*,
backend: str = "auto",
) -> FloatArray
Run a moving-frame UPDE schedule through the selected backend.
Parameters¶
phases : object
Oscillator phases in radians, shape (N,).
positions : object
Absolute axial coordinates per oscillator, shape (N,).
omega_schedule : object
Per-step natural-frequency vectors, shape (n_steps, N).
knm : object
Coupling matrix K_nm, shape (N, N).
alpha : object
Phase-lag matrix in radians, shape (N, N), or None for no lag.
velocity_schedule : object
Per-step axial velocity vectors, shape (n_steps, N).
spatial_modulator : SpatialCouplingModulator
Configured spatial coupling modulator.
doppler_strength : float
Doppler coupling-correction strength.
doppler_epsilon : float
Numerical floor guarding the Doppler denominator.
zeta : float
External drive strength ζ.
psi : float
External drive reference phase Ψ in radians.
dt : float
Integration step size.
method : str
Integration method (euler, rk4, or rk45).
n_substeps : int
Number of inner substeps per outer step.
atol : float
Absolute tolerance for the adaptive (rk45) integrator.
rtol : float
Relative tolerance for the adaptive (rk45) integrator.
backend : str
Name of the compute backend to run.
Returns¶
FloatArray The final phases after running the moving-frame schedule on the selected backend.
Raises¶
ImportError If the selected backend's runtime is unavailable. ValueError If the schedule contract is invalid; the underlying backend error propagates when every backend fails.
Source code in src/scpn_phase_orchestrator/upde/moving_frame.py
653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 | |
moving_frame_run_python ¶
moving_frame_run_python(
phases: object,
positions: object,
omega_schedule: object,
knm: object,
alpha: object,
velocity_schedule: object,
spatial_k_base: float,
spatial_decay_form: object,
spatial_decay_exponent: float,
spatial_decay_length_scale: float,
spatial_epsilon: float,
doppler_strength: float,
doppler_epsilon: float,
zeta: float,
psi: float,
dt: float,
method: str = "rk45",
n_substeps: int = 1,
atol: float = 1e-06,
rtol: float = 0.001,
) -> FloatArray
Run the moving-frame UPDE schedule in the Python reference path.
Parameters¶
phases : object
Oscillator phases in radians, shape (N,).
positions : object
Absolute axial coordinates per oscillator, shape (N,).
omega_schedule : object
Per-step natural-frequency vectors, shape (n_steps, N).
knm : object
Coupling matrix K_nm, shape (N, N).
alpha : object
Phase-lag matrix in radians, shape (N, N), or None for no lag.
velocity_schedule : object
Per-step axial velocity vectors, shape (n_steps, N).
spatial_k_base : float
Base coupling strength before spatial modulation.
spatial_decay_form : object
Spatial decay law name (e.g. exponential or power).
spatial_decay_exponent : float
Exponent of the spatial decay law.
spatial_decay_length_scale : float
Characteristic length scale of the spatial decay.
spatial_epsilon : float
Numerical floor guarding the spatial-decay denominator.
doppler_strength : float
Doppler coupling-correction strength.
doppler_epsilon : float
Numerical floor guarding the Doppler denominator.
zeta : float
External drive strength ζ.
psi : float
External drive reference phase Ψ in radians.
dt : float
Integration step size.
method : str
Integration method (euler, rk4, or rk45).
n_substeps : int
Number of inner substeps per outer step.
atol : float
Absolute tolerance for the adaptive (rk45) integrator.
rtol : float
Relative tolerance for the adaptive (rk45) integrator.
Returns¶
FloatArray The final phases after running the moving-frame schedule on the Python path.
Source code in src/scpn_phase_orchestrator/upde/moving_frame.py
419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 | |
API documentation¶
moving_frame ¶
Moving-frame Kuramoto UPDE integration.
MovingFrameUPDEEngine carries one absolute axial coordinate per oscillator
alongside phase. Each outer step evaluates distance-dependent coupling from the
current positions, applies graph-weighted Doppler detuning from the current
velocities, advances phases, then advances positions ballistically over the
same chamber-clock step.
Classes¶
MovingFrameState
dataclass
¶
MovingFrameState(
phases: FloatArray,
positions: FloatArray,
velocities: FloatArray,
knm_effective: FloatArray,
doppler_term: FloatArray,
time: float,
kinematic_residual_max_m: float = 0.0,
max_abs_velocity_m_per_s: float = 0.0,
path_length_max_m: float = 0.0,
)
Snapshot of a moving-frame UPDE step or run.
MovingFrameUPDEEngine ¶
MovingFrameUPDEEngine(
n: int,
omega: object,
k_nm: object,
alpha: object = 0.0,
dt: float = 0.01,
positions_t0: object | None = None,
velocities: object
| Callable[[float], object]
| None = None,
spatial_modulator: SpatialCouplingModulator
| None = None,
reference_point: float = 0.0,
doppler_strength: float = 1.0,
doppler_epsilon: float = 1e-09,
solver: str = "rk45",
phases: object | None = None,
velocity_axis: object | None = None,
t0: float = 0.0,
)
Bases: DopplerEngine
UPDE engine with chamber-frame axial positions and collision checks.
Source code in src/scpn_phase_orchestrator/upde/moving_frame.py
Attributes¶
positions
property
¶
Current absolute axial coordinate for each oscillator.
Returns¶
FloatArray Current absolute axial coordinate for each oscillator.
distance_to_reference
property
¶
Absolute distance from each oscillator to the chamber reference.
Returns¶
FloatArray Absolute distance from each oscillator to the chamber reference.
knm_effective
property
¶
Most recently applied distance-modulated coupling matrix.
Returns¶
FloatArray Most recently applied distance-modulated coupling matrix.
kinematic_residual_max_m
property
¶
Maximum residual against z_next = z + v*dt in the last run.
Returns¶
float
Maximum residual against z_next = z + v*dt in the last run.
max_abs_velocity_m_per_s
property
¶
Maximum absolute axial velocity used by the last step or run.
Returns¶
float Maximum absolute axial velocity used by the last step or run.
path_length_max_m
property
¶
Maximum per-oscillator axial path length in the last step or run.
Returns¶
float Maximum per-oscillator axial path length in the last step or run.
state
property
¶
Return the current moving-frame diagnostic snapshot.
Returns¶
MovingFrameState Return the current moving-frame diagnostic snapshot.
Methods:¶
collision_imminent ¶
Return whether any oscillator is at or crosses the reference soon.
Parameters¶
threshold_m : float Distance threshold in metres.
Returns¶
bool
True when an oscillator is at or crossing the reference within one step.
Source code in src/scpn_phase_orchestrator/upde/moving_frame.py
step ¶
step(
phases: object | None = None,
omegas: object | None = None,
knm: object | None = None,
zeta: float = 0.0,
psi: float = 0.0,
alpha: object | None = None,
) -> FloatArray
Advance one coupled phase/position step.
Parameters¶
phases : object | None
Oscillator phases in radians, shape (N,).
omegas : object | None
Natural frequencies in rad/s, shape (N,).
knm : object | None
Coupling matrix K_nm, shape (N, N).
zeta : float
External drive strength ζ.
psi : float
External drive reference phase Ψ in radians.
alpha : object | None
Phase-lag matrix in radians, shape (N, N), or None for no lag.
Returns¶
FloatArray The phases after one coupled phase/position step.
Source code in src/scpn_phase_orchestrator/upde/moving_frame.py
run ¶
run(
phases: object | None = None,
omegas: object | None = None,
knm: object | None = None,
zeta: float = 0.0,
psi: float = 0.0,
alpha: object | None = None,
n_steps: int = 1,
) -> FloatArray
Run n_steps of joint phase and axial-position dynamics.
Parameters¶
phases : object | None
Oscillator phases in radians, shape (N,).
omegas : object | None
Natural frequencies in rad/s, shape (N,).
knm : object | None
Coupling matrix K_nm, shape (N, N).
zeta : float
External drive strength ζ.
psi : float
External drive reference phase Ψ in radians.
alpha : object | None
Phase-lag matrix in radians, shape (N, N), or None for no lag.
n_steps : int
Number of integration steps to run.
Returns¶
FloatArray
The final phases after n_steps joint phase/position steps.
Source code in src/scpn_phase_orchestrator/upde/moving_frame.py
1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 | |
Functions:¶
validate_moving_frame_backend_inputs ¶
validate_moving_frame_backend_inputs(
phases: object,
positions: object,
omega_schedule: object,
knm: object,
alpha: object,
velocity_schedule: object,
spatial_k_base: float,
spatial_decay_form: object,
spatial_decay_exponent: float,
spatial_decay_length_scale: float,
spatial_epsilon: float,
doppler_strength: float,
doppler_epsilon: float,
zeta: float,
psi: float,
dt: float,
method: str,
n_substeps: int,
atol: float,
rtol: float,
) -> tuple[
FloatArray,
FloatArray,
FloatArray,
FloatArray,
FloatArray,
FloatArray,
float,
int,
float,
float,
float,
float,
float,
float,
float,
float,
int,
str,
int,
float,
float,
]
Validate the backend-neutral moving-frame schedule contract.
Parameters¶
phases : object
Oscillator phases in radians, shape (N,).
positions : object
Absolute axial coordinates per oscillator, shape (N,).
omega_schedule : object
Per-step natural-frequency vectors, shape (n_steps, N).
knm : object
Coupling matrix K_nm, shape (N, N).
alpha : object
Phase-lag matrix in radians, shape (N, N), or None for no lag.
velocity_schedule : object
Per-step axial velocity vectors, shape (n_steps, N).
spatial_k_base : float
Base coupling strength before spatial modulation.
spatial_decay_form : object
Spatial decay law name (e.g. exponential or power).
spatial_decay_exponent : float
Exponent of the spatial decay law.
spatial_decay_length_scale : float
Characteristic length scale of the spatial decay.
spatial_epsilon : float
Numerical floor guarding the spatial-decay denominator.
doppler_strength : float
Doppler coupling-correction strength.
doppler_epsilon : float
Numerical floor guarding the Doppler denominator.
zeta : float
External drive strength ζ.
psi : float
External drive reference phase Ψ in radians.
dt : float
Integration step size.
method : str
Integration method (euler, rk4, or rk45).
n_substeps : int
Number of inner substeps per outer step.
atol : float
Absolute tolerance for the adaptive (rk45) integrator.
rtol : float
Relative tolerance for the adaptive (rk45) integrator.
Returns¶
tuple[FloatArray, FloatArray, FloatArray, FloatArray, FloatArray, FloatArray, float, int, float, float, float, float, float, float, float, float, int, str, int, float, float] The validated, canonicalised moving-frame schedule contract tuple.
Raises¶
ValueError If any schedule array is non-finite or has an inconsistent shape.
Source code in src/scpn_phase_orchestrator/upde/moving_frame.py
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 | |
validate_moving_frame_backend_output ¶
validate_moving_frame_backend_output(
value: object,
*,
n: int,
expected_positions: FloatArray | None = None,
) -> FloatArray
Validate moving-frame backend output before returning it to callers.
Parameters¶
value : object
Backend-produced concatenated phase and position vector, shape (2*N,).
n : int
Expected oscillator count.
expected_positions : FloatArray | None
Optional ballistic position reference derived from the submitted schedule.
Returns¶
FloatArray
Contiguous float64 vector containing final phases followed by positions.
Raises¶
ValueError If the backend output is non-finite, has the wrong shape, leaves the principal phase branch, or violates the ballistic position contract.
Source code in src/scpn_phase_orchestrator/upde/moving_frame.py
moving_frame_run_python ¶
moving_frame_run_python(
phases: object,
positions: object,
omega_schedule: object,
knm: object,
alpha: object,
velocity_schedule: object,
spatial_k_base: float,
spatial_decay_form: object,
spatial_decay_exponent: float,
spatial_decay_length_scale: float,
spatial_epsilon: float,
doppler_strength: float,
doppler_epsilon: float,
zeta: float,
psi: float,
dt: float,
method: str = "rk45",
n_substeps: int = 1,
atol: float = 1e-06,
rtol: float = 0.001,
) -> FloatArray
Run the moving-frame UPDE schedule in the Python reference path.
Parameters¶
phases : object
Oscillator phases in radians, shape (N,).
positions : object
Absolute axial coordinates per oscillator, shape (N,).
omega_schedule : object
Per-step natural-frequency vectors, shape (n_steps, N).
knm : object
Coupling matrix K_nm, shape (N, N).
alpha : object
Phase-lag matrix in radians, shape (N, N), or None for no lag.
velocity_schedule : object
Per-step axial velocity vectors, shape (n_steps, N).
spatial_k_base : float
Base coupling strength before spatial modulation.
spatial_decay_form : object
Spatial decay law name (e.g. exponential or power).
spatial_decay_exponent : float
Exponent of the spatial decay law.
spatial_decay_length_scale : float
Characteristic length scale of the spatial decay.
spatial_epsilon : float
Numerical floor guarding the spatial-decay denominator.
doppler_strength : float
Doppler coupling-correction strength.
doppler_epsilon : float
Numerical floor guarding the Doppler denominator.
zeta : float
External drive strength ζ.
psi : float
External drive reference phase Ψ in radians.
dt : float
Integration step size.
method : str
Integration method (euler, rk4, or rk45).
n_substeps : int
Number of inner substeps per outer step.
atol : float
Absolute tolerance for the adaptive (rk45) integrator.
rtol : float
Relative tolerance for the adaptive (rk45) integrator.
Returns¶
FloatArray The final phases after running the moving-frame schedule on the Python path.
Source code in src/scpn_phase_orchestrator/upde/moving_frame.py
419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 | |
moving_frame_run ¶
moving_frame_run(
phases: object,
positions: object,
omega_schedule: object,
knm: object,
alpha: object,
velocity_schedule: object,
spatial_modulator: SpatialCouplingModulator,
doppler_strength: float = 1.0,
doppler_epsilon: float = 1e-09,
zeta: float = 0.0,
psi: float = 0.0,
dt: float = 0.01,
method: str = "rk45",
n_substeps: int = 1,
atol: float = 1e-06,
rtol: float = 0.001,
*,
backend: str = "auto",
) -> FloatArray
Run a moving-frame UPDE schedule through the selected backend.
Parameters¶
phases : object
Oscillator phases in radians, shape (N,).
positions : object
Absolute axial coordinates per oscillator, shape (N,).
omega_schedule : object
Per-step natural-frequency vectors, shape (n_steps, N).
knm : object
Coupling matrix K_nm, shape (N, N).
alpha : object
Phase-lag matrix in radians, shape (N, N), or None for no lag.
velocity_schedule : object
Per-step axial velocity vectors, shape (n_steps, N).
spatial_modulator : SpatialCouplingModulator
Configured spatial coupling modulator.
doppler_strength : float
Doppler coupling-correction strength.
doppler_epsilon : float
Numerical floor guarding the Doppler denominator.
zeta : float
External drive strength ζ.
psi : float
External drive reference phase Ψ in radians.
dt : float
Integration step size.
method : str
Integration method (euler, rk4, or rk45).
n_substeps : int
Number of inner substeps per outer step.
atol : float
Absolute tolerance for the adaptive (rk45) integrator.
rtol : float
Relative tolerance for the adaptive (rk45) integrator.
backend : str
Name of the compute backend to run.
Returns¶
FloatArray The final phases after running the moving-frame schedule on the selected backend.
Raises¶
ImportError If the selected backend's runtime is unavailable. ValueError If the schedule contract is invalid; the underlying backend error propagates when every backend fails.
Source code in src/scpn_phase_orchestrator/upde/moving_frame.py
653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 | |