universal-physics-tensor 0.4.6 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/dimensional/connection-validators.d.ts +59 -1
  2. package/dist/dimensional/connection-validators.d.ts.map +1 -1
  3. package/dist/dimensional/connection-validators.js +75 -1
  4. package/dist/dimensional/connection-validators.js.map +1 -1
  5. package/dist/dimensional/curvature.d.ts +336 -0
  6. package/dist/dimensional/curvature.d.ts.map +1 -0
  7. package/dist/dimensional/curvature.js +291 -0
  8. package/dist/dimensional/curvature.js.map +1 -0
  9. package/dist/dimensional/validator.d.ts +5 -3
  10. package/dist/dimensional/validator.d.ts.map +1 -1
  11. package/dist/dimensional/validator.js +58 -1
  12. package/dist/dimensional/validator.js.map +1 -1
  13. package/dist/index.d.ts +8 -2
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +19 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/numerical/be37-covariant-eikonal.d.ts +96 -39
  18. package/dist/numerical/be37-covariant-eikonal.d.ts.map +1 -1
  19. package/dist/numerical/be37-covariant-eikonal.js +202 -40
  20. package/dist/numerical/be37-covariant-eikonal.js.map +1 -1
  21. package/dist/numerical/curvature-lowering-helpers.d.ts +162 -0
  22. package/dist/numerical/curvature-lowering-helpers.d.ts.map +1 -0
  23. package/dist/numerical/curvature-lowering-helpers.js +378 -0
  24. package/dist/numerical/curvature-lowering-helpers.js.map +1 -0
  25. package/dist/numerical/errors.d.ts +16 -0
  26. package/dist/numerical/errors.d.ts.map +1 -1
  27. package/dist/numerical/errors.js +20 -0
  28. package/dist/numerical/errors.js.map +1 -1
  29. package/dist/numerical/gl4-integrator.d.ts +167 -0
  30. package/dist/numerical/gl4-integrator.d.ts.map +1 -0
  31. package/dist/numerical/gl4-integrator.js +276 -0
  32. package/dist/numerical/gl4-integrator.js.map +1 -0
  33. package/dist/numerical/index.d.ts +8 -0
  34. package/dist/numerical/index.d.ts.map +1 -1
  35. package/dist/numerical/index.js +4 -0
  36. package/dist/numerical/index.js.map +1 -1
  37. package/dist/numerical/lowering.d.ts.map +1 -1
  38. package/dist/numerical/lowering.js +170 -0
  39. package/dist/numerical/lowering.js.map +1 -1
  40. package/dist/numerical/perihelion-finder.d.ts +84 -0
  41. package/dist/numerical/perihelion-finder.d.ts.map +1 -0
  42. package/dist/numerical/perihelion-finder.js +261 -0
  43. package/dist/numerical/perihelion-finder.js.map +1 -0
  44. package/package.json +1 -1
@@ -0,0 +1,162 @@
1
+ /**
2
+ * Numerical helpers for Riemann-curvature lowering (Task 6 [U] / v0.5.0 1c-ii).
3
+ *
4
+ * Mirrors `connection-lowering-helpers.ts`: produces Γ and ∂Γ tensors from
5
+ * coordinate-dependent metric closures, then assembles the Riemann tensor via
6
+ * the corrected (Carroll-Ch.3 §3.4 / Adam+Eve F4-S3) formula:
7
+ *
8
+ * R^ρ_{σμν} = ∂_μ Γ^ρ_{σν} − ∂_ν Γ^ρ_{σμ} + Σ_λ (Γ^ρ_{λμ} Γ^λ_{σν} − Γ^ρ_{λν} Γ^λ_{σμ})
9
+ *
10
+ * Index conventions (pinned via JSDoc + a runtime assert):
11
+ * - Γ[ρ][σ][ν] = Γ^ρ_{σν} (matches computeChristoffelTensor's [α][μ][ν] with
12
+ * σ ↔ μ — i.e., the SECOND axis is σ, the THIRD is ν, per Carroll Ch.5).
13
+ * - dGamma[λ][ρ][σ][ν] = ∂_λ Γ^ρ_{σν} (I3)
14
+ * - R[ρ][σ][μ][ν] = R^ρ_{σμν} (Carroll)
15
+ *
16
+ * NOTE on the σ/μ swap vs `computeChristoffelTensor`:
17
+ * `computeChristoffelTensor` was authored for v0.4.0 covariant-derivative
18
+ * lowering, which sums Γ^α_{μλ} T^λ over the middle index `μ` (the wrt index
19
+ * of the cov-deriv). v0.5.0 Riemann needs σ in the SECOND-lower slot of every
20
+ * Γ. Because Γ is symmetric in its two lower indices (Christoffel symmetry),
21
+ * the two storage conventions are numerically identical — we use the
22
+ * existing [α][middle][last] storage and access it with σ in the middle slot.
23
+ *
24
+ * The fast path uses the v0.4.0 `computeChristoffelTensor` infrastructure
25
+ * (no new tensor-engine code) and the v0.4.0 `pderivNumericalFn` pattern
26
+ * (centered finite differences). M11: ∂Γ is computed by repeated centered
27
+ * finite-differences on `christoffel()`, not a new AST node type or AD pass.
28
+ *
29
+ * @module numerical/curvature-lowering-helpers
30
+ */
31
+ import type { TensorEngine } from './tensor-engine.js';
32
+ import type { NestedArray } from './types.js';
33
+ /** Flat row-major N×N matrix (one g or g^{-1} sample). */
34
+ export type FlatMatrix = ReadonlyArray<number>;
35
+ /** A coordinate-dependent rank-2 closure: f(x) → N×N as a NestedArray
36
+ * (number[][] or any nested form that `flattenNA` can flatten). */
37
+ export type MetricFn = (x: ReadonlyArray<number>) => NestedArray;
38
+ /**
39
+ * dGamma[λ][ρ][σ][ν] = ∂_λ Γ^ρ_{σν} at the given coordinates (I3).
40
+ *
41
+ * 4-deep nested number array — readonly to mark this as an output container
42
+ * the helper produces but does not mutate after construction.
43
+ */
44
+ export type DGammaTensor = readonly (readonly (readonly (readonly number[])[])[])[];
45
+ /** Gamma[ρ][σ][ν] = Γ^ρ_{σν} — same index order as `computeChristoffelTensor`
46
+ * output (just renamed for the Riemann use). */
47
+ export type GammaTensor = readonly (readonly (readonly number[])[])[];
48
+ /**
49
+ * Step size for finite differences on the Christoffel function.
50
+ *
51
+ * Inner step (∂g for one Γ evaluation) uses the v0.4.0 default
52
+ * `1e-6·max(|x|,1)` via `pderivNumericalFn`-style centered FD. This gives ∂g
53
+ * with relative precision ≈ 1e-11 on Schwarzschild components (verified by
54
+ * inspection at r=3·r_s).
55
+ *
56
+ * Outer step (∂Γ for one R evaluation) is `1e-4·max(|x|,1)` and we use a
57
+ * **4th-order centered stencil**:
58
+ *
59
+ * f'(x) ≈ [−f(x+2h) + 8 f(x+h) − 8 f(x-h) + f(x-2h)] / (12 h)
60
+ *
61
+ * Truncation O(h⁴) instead of O(h²). At h=0.886 m (r=3·r_s, M=M_sun),
62
+ * truncation ≈ h⁴·Γ⁽⁵⁾/Γ ~ 1e-13 relative, round-off ε·|Γ|/h ~ 1e-15 relative.
63
+ * Both sit well below the 1e-9 gate.
64
+ *
65
+ * The 2nd-order outer FD that v0.4.0 covariant-derivative lowering uses
66
+ * leaves ~3e-6 relative error on R^t_{rtr} due to noise propagation through
67
+ * the c²-scaled g_{tt} component — 4th-order outer FD recovers the precision.
68
+ */
69
+ export declare function outerStep(x: number): number;
70
+ /**
71
+ * Compute Γ^ρ_{σν} at coordinate x. Internally builds a centered-FD ∂g sampler
72
+ * around x and delegates to `computeChristoffelTensor` (the v0.4.0 helper).
73
+ *
74
+ * Returns a fully-materialised 3-deep nested array Γ[ρ][σ][ν]. (We do NOT keep
75
+ * the EngineTensor wrapper because we immediately rebuild dGamma and R as
76
+ * plain nested arrays — round-tripping through the engine on every FD sample
77
+ * would dominate the cost.)
78
+ */
79
+ export declare function christoffelAt(x: ReadonlyArray<number>, gFn: MetricFn, gInverseFn: MetricFn, N: number, engine: TensorEngine): number[][][];
80
+ /**
81
+ * dGamma[λ][ρ][σ][ν] = ∂_λ Γ^ρ_{σν} via centered FD on `christoffelAt`. (I3)
82
+ *
83
+ * Includes a runtime index-assert verifying `dGamma[1][1][1][1]` is finite
84
+ * before returning (catches silent shape-permutation bugs introduced by future
85
+ * edits to `computeChristoffelTensor`'s output ordering).
86
+ */
87
+ export declare function dGammaAt(x: ReadonlyArray<number>, gFn: MetricFn, gInverseFn: MetricFn, N: number, engine: TensorEngine): DGammaTensor;
88
+ /**
89
+ * Build the full 4×4×4×4 Riemann tensor R^ρ_{σμν} from Γ and ∂Γ per the
90
+ * Carroll formula (Adam+Eve F4-S3):
91
+ *
92
+ * R[ρ][σ][μ][ν] = ∂_μ Γ[ρ][σ][ν] − ∂_ν Γ[ρ][σ][μ]
93
+ * + Σ_λ (Γ[ρ][λ][μ] Γ[λ][σ][ν] − Γ[ρ][λ][ν] Γ[λ][σ][μ])
94
+ *
95
+ * σ in the SECOND lower slot of each Γ (F4/S3 correction).
96
+ */
97
+ export declare function buildRiemann(gamma: GammaTensor, dGamma: DGammaTensor, N: number): number[][][][];
98
+ /**
99
+ * Compute the upper-Riemann tensor R^ρ_{σμν} at coordinate x using the same
100
+ * Γ + ∂Γ pipeline as the riemann-tensor lowering case. Encapsulates the
101
+ * full christoffelAt + dGammaAt + buildRiemann sequence so callers (Task 9
102
+ * Bianchi residual) can sample R at perturbed coordinates without
103
+ * re-implementing the FD machinery.
104
+ */
105
+ export declare function riemannUpperAt(x: ReadonlyArray<number>, gFn: MetricFn, gInverseFn: MetricFn, N: number, engine: TensorEngine): number[][][][];
106
+ /**
107
+ * Lower the upper-ρ index of R^ρ_{σμν} via the covariant metric g_{aρ}:
108
+ *
109
+ * R_{aσμν} = Σ_ρ g_{aρ} R^ρ_{σμν}
110
+ *
111
+ * Output index order: `[a][σ][μ][ν]` — all four lower. (a is the freshly
112
+ * lowered index in the first slot.)
113
+ */
114
+ export declare function lowerFirstIndex(R: number[][][][], gLowerFlat: ReadonlyArray<number>, N: number): number[][][][];
115
+ /**
116
+ * Sample the all-lower Riemann tensor R_{αβγδ}(x) — combines `riemannUpperAt`
117
+ * with `lowerFirstIndex` for the single-coordinate evaluation. Used both as
118
+ * the base sample and (with perturbed x) as the FD inputs for ∂_λ R_{αβγδ}.
119
+ */
120
+ export declare function riemannLowerAt(x: ReadonlyArray<number>, gFn: MetricFn, gInverseFn: MetricFn, N: number, engine: TensorEngine): number[][][][];
121
+ /**
122
+ * Compute ∂_λ R_{αβγδ}(x) via a 4th-order centered stencil on
123
+ * `riemannLowerAt`. Index order: `dR[λ][α][β][γ][δ] = ∂_λ R_{αβγδ}`.
124
+ *
125
+ * Uses the same outer step (`outerStep`) as Task 6's dGammaAt so the
126
+ * FD-noise compounding pattern matches. This is one extra layer of FD on top
127
+ * of the Christoffel-of-Christoffel double-FD already inside `riemannLowerAt`
128
+ * — total: ∂(∂(∂g)) at 4th order in each layer. Empirical noise floor reached
129
+ * by the per-component value is documented in the test report.
130
+ */
131
+ export declare function dRiemannLowerAt(x: ReadonlyArray<number>, gFn: MetricFn, gInverseFn: MetricFn, N: number, engine: TensorEngine): number[][][][][];
132
+ /**
133
+ * Compute ∇_λ R_{μνρσ} via partial + Christoffel-correction terms (Approach 1).
134
+ *
135
+ * ∇_λ R_{μνρσ} = ∂_λ R_{μνρσ}
136
+ * − Γ^α_{λμ} R_{ανρσ}
137
+ * − Γ^α_{λν} R_{μαρσ}
138
+ * − Γ^α_{λρ} R_{μνασ}
139
+ * − Γ^α_{λσ} R_{μνρα}
140
+ *
141
+ * Index order: `covR[λ][μ][ν][ρ][σ] = ∇_λ R_{μνρσ}`.
142
+ *
143
+ * Approach choice (full ∇, not raw ∂): the second Bianchi identity
144
+ * ∇_{[λ} R_{μν]ρσ} = 0 is the canonical statement. Using raw ∂ would give a
145
+ * residual dominated by the (cyclic-non-cancelling) Christoffel-correction
146
+ * terms, masking the identity check with O(1) algebraic clutter. Full ∇
147
+ * makes the test a genuine self-consistency check of the lowered Riemann.
148
+ */
149
+ export declare function covariantDerivRiemannLowerAt(x: ReadonlyArray<number>, gFn: MetricFn, gInverseFn: MetricFn, N: number, engine: TensorEngine): number[][][][][];
150
+ /**
151
+ * Build the second-Bianchi-identity residual (cyclic over first three indices):
152
+ *
153
+ * B_{λμνρσ} = ∇_λ R_{μνρσ} + ∇_μ R_{νλρσ} + ∇_ν R_{λμρσ}
154
+ *
155
+ * Carroll Eq. 3.95: B ≡ 0 in any (torsion-free) Lorentzian manifold. The
156
+ * residual measures the FD-truncation + cancellation noise on the lowered
157
+ * Riemann tensor through one extra ∂ layer.
158
+ *
159
+ * Index order: `B[λ][μ][ν][ρ][σ]` — all five lower.
160
+ */
161
+ export declare function bianchiResidualAt(x: ReadonlyArray<number>, gFn: MetricFn, gInverseFn: MetricFn, N: number, engine: TensorEngine): number[][][][][];
162
+ //# sourceMappingURL=curvature-lowering-hel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E,EAAE,EAAE,EAAE,CAqClB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,EACxB,GAAG,EAAE,QAAQ,EACb,UAAU,EAAE,QAAQ,EACpB,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,YAAY,GACnB,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,CA2BlB"}
@@ -0,0 +1,378 @@
1
+ /**
2
+ * Numerical helpers for Riemann-curvature lowering (Task 6 [U] / v0.5.0 1c-ii).
3
+ *
4
+ * Mirrors `connection-lowering-helpers.ts`: produces Γ and ∂Γ tensors from
5
+ * coordinate-dependent metric closures, then assembles the Riemann tensor via
6
+ * the corrected (Carroll-Ch.3 §3.4 / Adam+Eve F4-S3) formula:
7
+ *
8
+ * R^ρ_{σμν} = ∂_μ Γ^ρ_{σν} − ∂_ν Γ^ρ_{σμ} + Σ_λ (Γ^ρ_{λμ} Γ^λ_{σν} − Γ^ρ_{λν} Γ^λ_{σμ})
9
+ *
10
+ * Index conventions (pinned via JSDoc + a runtime assert):
11
+ * - Γ[ρ][σ][ν] = Γ^ρ_{σν} (matches computeChristoffelTensor's [α][μ][ν] with
12
+ * σ ↔ μ — i.e., the SECOND axis is σ, the THIRD is ν, per Carroll Ch.5).
13
+ * - dGamma[λ][ρ][σ][ν] = ∂_λ Γ^ρ_{σν} (I3)
14
+ * - R[ρ][σ][μ][ν] = R^ρ_{σμν} (Carroll)
15
+ *
16
+ * NOTE on the σ/μ swap vs `computeChristoffelTensor`:
17
+ * `computeChristoffelTensor` was authored for v0.4.0 covariant-derivative
18
+ * lowering, which sums Γ^α_{μλ} T^λ over the middle index `μ` (the wrt index
19
+ * of the cov-deriv). v0.5.0 Riemann needs σ in the SECOND-lower slot of every
20
+ * Γ. Because Γ is symmetric in its two lower indices (Christoffel symmetry),
21
+ * the two storage conventions are numerically identical — we use the
22
+ * existing [α][middle][last] storage and access it with σ in the middle slot.
23
+ *
24
+ * The fast path uses the v0.4.0 `computeChristoffelTensor` infrastructure
25
+ * (no new tensor-engine code) and the v0.4.0 `pderivNumericalFn` pattern
26
+ * (centered finite differences). M11: ∂Γ is computed by repeated centered
27
+ * finite-differences on `christoffel()`, not a new AST node type or AD pass.
28
+ *
29
+ * @module numerical/curvature-lowering-helpers
30
+ */
31
+ import { NumericalBackendError } from './errors.js';
32
+ import { computeChristoffelTensor, flattenNA } from './connection-lowering-helpers.js';
33
+ // ---------------------------------------------------------------------------
34
+ // Finite-difference step
35
+ // ---------------------------------------------------------------------------
36
+ /**
37
+ * Step size for finite differences on the Christoffel function.
38
+ *
39
+ * Inner step (∂g for one Γ evaluation) uses the v0.4.0 default
40
+ * `1e-6·max(|x|,1)` via `pderivNumericalFn`-style centered FD. This gives ∂g
41
+ * with relative precision ≈ 1e-11 on Schwarzschild components (verified by
42
+ * inspection at r=3·r_s).
43
+ *
44
+ * Outer step (∂Γ for one R evaluation) is `1e-4·max(|x|,1)` and we use a
45
+ * **4th-order centered stencil**:
46
+ *
47
+ * f'(x) ≈ [−f(x+2h) + 8 f(x+h) − 8 f(x-h) + f(x-2h)] / (12 h)
48
+ *
49
+ * Truncation O(h⁴) instead of O(h²). At h=0.886 m (r=3·r_s, M=M_sun),
50
+ * truncation ≈ h⁴·Γ⁽⁵⁾/Γ ~ 1e-13 relative, round-off ε·|Γ|/h ~ 1e-15 relative.
51
+ * Both sit well below the 1e-9 gate.
52
+ *
53
+ * The 2nd-order outer FD that v0.4.0 covariant-derivative lowering uses
54
+ * leaves ~3e-6 relative error on R^t_{rtr} due to noise propagation through
55
+ * the c²-scaled g_{tt} component — 4th-order outer FD recovers the precision.
56
+ */
57
+ export function outerStep(x) {
58
+ return 1e-4 * Math.max(Math.abs(x), 1);
59
+ }
60
+ /**
61
+ * Build a flat ∂_μ g sampler around point x using a **4th-order centered
62
+ * stencil**:
63
+ *
64
+ * ∂_μ g ≈ [−g(x+2h) + 8 g(x+h) − 8 g(x−h) + g(x−2h)] / (12 h)
65
+ *
66
+ * Returned function matches the `getMetricDeriv` signature expected by
67
+ * `computeChristoffelTensor`.
68
+ *
69
+ * Inner step `h_i = 1e-3·max(|x|,1)` is intentionally LARGER than the v0.4.0
70
+ * 1e-6 default to compensate for the c²·g_{tt} ~ 6e16 cancellation noise: a
71
+ * 4th-order stencil at h_i ≈ 8.86 m around r=3·r_s gives truncation
72
+ * O(h_i⁴·g⁽⁵⁾) ~ 1e-13 relative on each ∂g component while keeping round-off
73
+ * ε|g|/h_i ~ 1e-15 relative — orders below the 1e-9 component-match gate.
74
+ */
75
+ function makeInnerGradFn(gFn, x0, N) {
76
+ return (mu) => {
77
+ const xc = x0[mu];
78
+ const h = 1e-3 * Math.max(Math.abs(xc), 1);
79
+ const p1 = [...x0];
80
+ p1[mu] = xc + h;
81
+ const m1 = [...x0];
82
+ m1[mu] = xc - h;
83
+ const p2 = [...x0];
84
+ p2[mu] = xc + 2 * h;
85
+ const m2 = [...x0];
86
+ m2[mu] = xc - 2 * h;
87
+ const gp1 = flattenNA(gFn(p1));
88
+ const gm1 = flattenNA(gFn(m1));
89
+ const gp2 = flattenNA(gFn(p2));
90
+ const gm2 = flattenNA(gFn(m2));
91
+ if (gp1.length !== N * N || gm1.length !== N * N ||
92
+ gp2.length !== N * N || gm2.length !== N * N) {
93
+ throw new NumericalBackendError(`curvature-lowering: metric closure returned wrong shape — expected ${N * N}, ` +
94
+ `got [${gp1.length}, ${gm1.length}, ${gp2.length}, ${gm2.length}]`);
95
+ }
96
+ const inv12h = 1 / (12 * h);
97
+ const out = new Array(N * N);
98
+ for (let i = 0; i < N * N; i++) {
99
+ out[i] = (-gp2[i] + 8 * gp1[i] - 8 * gm1[i] + gm2[i]) * inv12h;
100
+ }
101
+ return out;
102
+ };
103
+ }
104
+ /**
105
+ * Compute Γ^ρ_{σν} at coordinate x. Internally builds a centered-FD ∂g sampler
106
+ * around x and delegates to `computeChristoffelTensor` (the v0.4.0 helper).
107
+ *
108
+ * Returns a fully-materialised 3-deep nested array Γ[ρ][σ][ν]. (We do NOT keep
109
+ * the EngineTensor wrapper because we immediately rebuild dGamma and R as
110
+ * plain nested arrays — round-tripping through the engine on every FD sample
111
+ * would dominate the cost.)
112
+ */
113
+ export function christoffelAt(x, gFn, gInverseFn, N, engine) {
114
+ const gInvFlat = flattenNA(gInverseFn(x));
115
+ if (gInvFlat.length !== N * N) {
116
+ throw new NumericalBackendError(`curvature-lowering: gInverseFn returned wrong shape — expected ${N * N}, got ${gInvFlat.length}`);
117
+ }
118
+ const gradFn = makeInnerGradFn(gFn, x, N);
119
+ const tensor = computeChristoffelTensor(gInvFlat, gradFn, N, engine);
120
+ const nested = engine.toNested(tensor);
121
+ engine.dispose?.(tensor);
122
+ // Cast to the expected nested shape; computeChristoffelTensor produces
123
+ // shape [N,N,N] so this is structurally [ρ][middle][last]. We treat
124
+ // [middle] as σ and [last] as ν (Christoffel symmetry makes the two
125
+ // lower-slot conventions numerically interchangeable).
126
+ return nested;
127
+ }
128
+ /**
129
+ * dGamma[λ][ρ][σ][ν] = ∂_λ Γ^ρ_{σν} via centered FD on `christoffelAt`. (I3)
130
+ *
131
+ * Includes a runtime index-assert verifying `dGamma[1][1][1][1]` is finite
132
+ * before returning (catches silent shape-permutation bugs introduced by future
133
+ * edits to `computeChristoffelTensor`'s output ordering).
134
+ */
135
+ export function dGammaAt(x, gFn, gInverseFn, N, engine) {
136
+ // Allocate dGamma[λ][ρ][σ][ν]
137
+ const dGamma = Array.from({ length: N }, () => Array.from({ length: N }, () => Array.from({ length: N }, () => new Array(N).fill(0))));
138
+ // 4th-order centered stencil: f'(x) ≈ [−f₊₂ + 8 f₊₁ − 8 f₋₁ + f₋₂] / (12 h)
139
+ for (let lam = 0; lam < N; lam++) {
140
+ const xc = x[lam];
141
+ const h = outerStep(xc);
142
+ const xP1 = [...x];
143
+ xP1[lam] = xc + h;
144
+ const xM1 = [...x];
145
+ xM1[lam] = xc - h;
146
+ const xP2 = [...x];
147
+ xP2[lam] = xc + 2 * h;
148
+ const xM2 = [...x];
149
+ xM2[lam] = xc - 2 * h;
150
+ const Gp1 = christoffelAt(xP1, gFn, gInverseFn, N, engine);
151
+ const Gm1 = christoffelAt(xM1, gFn, gInverseFn, N, engine);
152
+ const Gp2 = christoffelAt(xP2, gFn, gInverseFn, N, engine);
153
+ const Gm2 = christoffelAt(xM2, gFn, gInverseFn, N, engine);
154
+ const inv12h = 1 / (12 * h);
155
+ for (let rho = 0; rho < N; rho++) {
156
+ for (let sigma = 0; sigma < N; sigma++) {
157
+ for (let nu = 0; nu < N; nu++) {
158
+ dGamma[lam][rho][sigma][nu] = (-Gp2[rho][sigma][nu]
159
+ + 8 * Gp1[rho][sigma][nu]
160
+ - 8 * Gm1[rho][sigma][nu]
161
+ + Gm2[rho][sigma][nu]) * inv12h;
162
+ }
163
+ }
164
+ }
165
+ }
166
+ // I3 runtime index-assert: verify the container is populated as expected.
167
+ // dGamma[1][1][1][1] is ∂_r Γ^r_{rr} for Schwarzschild — a non-trivial real
168
+ // number, so a `Number.isFinite` check catches both shape regressions and
169
+ // numerical blow-ups.
170
+ const probe = dGamma[1]?.[1]?.[1]?.[1];
171
+ if (typeof probe !== 'number' || !Number.isFinite(probe)) {
172
+ throw new NumericalBackendError(`curvature-lowering: dGamma index-assert failed — dGamma[1][1][1][1] is ` +
173
+ `${probe} (expected finite number). Shape regression in christoffelAt?`);
174
+ }
175
+ return dGamma;
176
+ }
177
+ /**
178
+ * Build the full 4×4×4×4 Riemann tensor R^ρ_{σμν} from Γ and ∂Γ per the
179
+ * Carroll formula (Adam+Eve F4-S3):
180
+ *
181
+ * R[ρ][σ][μ][ν] = ∂_μ Γ[ρ][σ][ν] − ∂_ν Γ[ρ][σ][μ]
182
+ * + Σ_λ (Γ[ρ][λ][μ] Γ[λ][σ][ν] − Γ[ρ][λ][ν] Γ[λ][σ][μ])
183
+ *
184
+ * σ in the SECOND lower slot of each Γ (F4/S3 correction).
185
+ */
186
+ export function buildRiemann(gamma, dGamma, N) {
187
+ const R = Array.from({ length: N }, () => Array.from({ length: N }, () => Array.from({ length: N }, () => new Array(N).fill(0))));
188
+ for (let rho = 0; rho < N; rho++) {
189
+ for (let sigma = 0; sigma < N; sigma++) {
190
+ for (let mu = 0; mu < N; mu++) {
191
+ for (let nu = 0; nu < N; nu++) {
192
+ // ∂_μ Γ^ρ_{σν} − ∂_ν Γ^ρ_{σμ}
193
+ let value = dGamma[mu][rho][sigma][nu] - dGamma[nu][rho][sigma][mu];
194
+ // Σ_λ (Γ^ρ_{λμ} Γ^λ_{σν} − Γ^ρ_{λν} Γ^λ_{σμ})
195
+ for (let lam = 0; lam < N; lam++) {
196
+ value += gamma[rho][lam][mu] * gamma[lam][sigma][nu]
197
+ - gamma[rho][lam][nu] * gamma[lam][sigma][mu];
198
+ }
199
+ R[rho][sigma][mu][nu] = value;
200
+ }
201
+ }
202
+ }
203
+ }
204
+ return R;
205
+ }
206
+ // ---------------------------------------------------------------------------
207
+ // v0.5.0 Task 9: helpers for bianchiResidual()
208
+ // ---------------------------------------------------------------------------
209
+ /**
210
+ * Compute the upper-Riemann tensor R^ρ_{σμν} at coordinate x using the same
211
+ * Γ + ∂Γ pipeline as the riemann-tensor lowering case. Encapsulates the
212
+ * full christoffelAt + dGammaAt + buildRiemann sequence so callers (Task 9
213
+ * Bianchi residual) can sample R at perturbed coordinates without
214
+ * re-implementing the FD machinery.
215
+ */
216
+ export function riemannUpperAt(x, gFn, gInverseFn, N, engine) {
217
+ const gamma = christoffelAt(x, gFn, gInverseFn, N, engine);
218
+ const dGamma = dGammaAt(x, gFn, gInverseFn, N, engine);
219
+ return buildRiemann(gamma, dGamma, N);
220
+ }
221
+ /**
222
+ * Lower the upper-ρ index of R^ρ_{σμν} via the covariant metric g_{aρ}:
223
+ *
224
+ * R_{aσμν} = Σ_ρ g_{aρ} R^ρ_{σμν}
225
+ *
226
+ * Output index order: `[a][σ][μ][ν]` — all four lower. (a is the freshly
227
+ * lowered index in the first slot.)
228
+ */
229
+ export function lowerFirstIndex(R, gLowerFlat, N) {
230
+ const Rlow = Array.from({ length: N }, () => Array.from({ length: N }, () => Array.from({ length: N }, () => new Array(N).fill(0))));
231
+ for (let a = 0; a < N; a++) {
232
+ for (let sig = 0; sig < N; sig++) {
233
+ for (let mu = 0; mu < N; mu++) {
234
+ for (let nu = 0; nu < N; nu++) {
235
+ let sum = 0;
236
+ for (let rho = 0; rho < N; rho++) {
237
+ sum += gLowerFlat[a * N + rho] * R[rho][sig][mu][nu];
238
+ }
239
+ Rlow[a][sig][mu][nu] = sum;
240
+ }
241
+ }
242
+ }
243
+ }
244
+ return Rlow;
245
+ }
246
+ /**
247
+ * Sample the all-lower Riemann tensor R_{αβγδ}(x) — combines `riemannUpperAt`
248
+ * with `lowerFirstIndex` for the single-coordinate evaluation. Used both as
249
+ * the base sample and (with perturbed x) as the FD inputs for ∂_λ R_{αβγδ}.
250
+ */
251
+ export function riemannLowerAt(x, gFn, gInverseFn, N, engine) {
252
+ const Rup = riemannUpperAt(x, gFn, gInverseFn, N, engine);
253
+ const gFlat = flattenNA(gFn(x));
254
+ if (gFlat.length !== N * N) {
255
+ throw new NumericalBackendError(`bianchi-residual: gFn returned wrong shape — expected ${N * N}, got ${gFlat.length}`);
256
+ }
257
+ return lowerFirstIndex(Rup, gFlat, N);
258
+ }
259
+ /**
260
+ * Compute ∂_λ R_{αβγδ}(x) via a 4th-order centered stencil on
261
+ * `riemannLowerAt`. Index order: `dR[λ][α][β][γ][δ] = ∂_λ R_{αβγδ}`.
262
+ *
263
+ * Uses the same outer step (`outerStep`) as Task 6's dGammaAt so the
264
+ * FD-noise compounding pattern matches. This is one extra layer of FD on top
265
+ * of the Christoffel-of-Christoffel double-FD already inside `riemannLowerAt`
266
+ * — total: ∂(∂(∂g)) at 4th order in each layer. Empirical noise floor reached
267
+ * by the per-component value is documented in the test report.
268
+ */
269
+ export function dRiemannLowerAt(x, gFn, gInverseFn, N, engine) {
270
+ const dR = Array.from({ length: N }, () => Array.from({ length: N }, () => Array.from({ length: N }, () => Array.from({ length: N }, () => new Array(N).fill(0)))));
271
+ for (let lam = 0; lam < N; lam++) {
272
+ const xc = x[lam];
273
+ const h = outerStep(xc);
274
+ const xP1 = [...x];
275
+ xP1[lam] = xc + h;
276
+ const xM1 = [...x];
277
+ xM1[lam] = xc - h;
278
+ const xP2 = [...x];
279
+ xP2[lam] = xc + 2 * h;
280
+ const xM2 = [...x];
281
+ xM2[lam] = xc - 2 * h;
282
+ const Rp1 = riemannLowerAt(xP1, gFn, gInverseFn, N, engine);
283
+ const Rm1 = riemannLowerAt(xM1, gFn, gInverseFn, N, engine);
284
+ const Rp2 = riemannLowerAt(xP2, gFn, gInverseFn, N, engine);
285
+ const Rm2 = riemannLowerAt(xM2, gFn, gInverseFn, N, engine);
286
+ const inv12h = 1 / (12 * h);
287
+ for (let a = 0; a < N; a++) {
288
+ for (let b = 0; b < N; b++) {
289
+ for (let c = 0; c < N; c++) {
290
+ for (let d = 0; d < N; d++) {
291
+ dR[lam][a][b][c][d] = (-Rp2[a][b][c][d]
292
+ + 8 * Rp1[a][b][c][d]
293
+ - 8 * Rm1[a][b][c][d]
294
+ + Rm2[a][b][c][d]) * inv12h;
295
+ }
296
+ }
297
+ }
298
+ }
299
+ }
300
+ return dR;
301
+ }
302
+ /**
303
+ * Compute ∇_λ R_{μνρσ} via partial + Christoffel-correction terms (Approach 1).
304
+ *
305
+ * ∇_λ R_{μνρσ} = ∂_λ R_{μνρσ}
306
+ * − Γ^α_{λμ} R_{ανρσ}
307
+ * − Γ^α_{λν} R_{μαρσ}
308
+ * − Γ^α_{λρ} R_{μνασ}
309
+ * − Γ^α_{λσ} R_{μνρα}
310
+ *
311
+ * Index order: `covR[λ][μ][ν][ρ][σ] = ∇_λ R_{μνρσ}`.
312
+ *
313
+ * Approach choice (full ∇, not raw ∂): the second Bianchi identity
314
+ * ∇_{[λ} R_{μν]ρσ} = 0 is the canonical statement. Using raw ∂ would give a
315
+ * residual dominated by the (cyclic-non-cancelling) Christoffel-correction
316
+ * terms, masking the identity check with O(1) algebraic clutter. Full ∇
317
+ * makes the test a genuine self-consistency check of the lowered Riemann.
318
+ */
319
+ export function covariantDerivRiemannLowerAt(x, gFn, gInverseFn, N, engine) {
320
+ const gamma = christoffelAt(x, gFn, gInverseFn, N, engine);
321
+ const R = riemannLowerAt(x, gFn, gInverseFn, N, engine);
322
+ const dR = dRiemannLowerAt(x, gFn, gInverseFn, N, engine);
323
+ const covR = Array.from({ length: N }, () => Array.from({ length: N }, () => Array.from({ length: N }, () => Array.from({ length: N }, () => new Array(N).fill(0)))));
324
+ for (let lam = 0; lam < N; lam++) {
325
+ for (let mu = 0; mu < N; mu++) {
326
+ for (let nu = 0; nu < N; nu++) {
327
+ for (let rho = 0; rho < N; rho++) {
328
+ for (let sig = 0; sig < N; sig++) {
329
+ let value = dR[lam][mu][nu][rho][sig];
330
+ // Subtract Γ^α_{λμ} R_{ανρσ} (correction for the μ index)
331
+ // Subtract Γ^α_{λν} R_{μαρσ} (correction for the ν index)
332
+ // Subtract Γ^α_{λρ} R_{μνασ} (correction for the ρ index)
333
+ // Subtract Γ^α_{λσ} R_{μνρα} (correction for the σ index)
334
+ for (let a = 0; a < N; a++) {
335
+ value -= gamma[a][lam][mu] * R[a][nu][rho][sig];
336
+ value -= gamma[a][lam][nu] * R[mu][a][rho][sig];
337
+ value -= gamma[a][lam][rho] * R[mu][nu][a][sig];
338
+ value -= gamma[a][lam][sig] * R[mu][nu][rho][a];
339
+ }
340
+ covR[lam][mu][nu][rho][sig] = value;
341
+ }
342
+ }
343
+ }
344
+ }
345
+ }
346
+ return covR;
347
+ }
348
+ /**
349
+ * Build the second-Bianchi-identity residual (cyclic over first three indices):
350
+ *
351
+ * B_{λμνρσ} = ∇_λ R_{μνρσ} + ∇_μ R_{νλρσ} + ∇_ν R_{λμρσ}
352
+ *
353
+ * Carroll Eq. 3.95: B ≡ 0 in any (torsion-free) Lorentzian manifold. The
354
+ * residual measures the FD-truncation + cancellation noise on the lowered
355
+ * Riemann tensor through one extra ∂ layer.
356
+ *
357
+ * Index order: `B[λ][μ][ν][ρ][σ]` — all five lower.
358
+ */
359
+ export function bianchiResidualAt(x, gFn, gInverseFn, N, engine) {
360
+ const covR = covariantDerivRiemannLowerAt(x, gFn, gInverseFn, N, engine);
361
+ const B = Array.from({ length: N }, () => Array.from({ length: N }, () => Array.from({ length: N }, () => Array.from({ length: N }, () => new Array(N).fill(0)))));
362
+ for (let lam = 0; lam < N; lam++) {
363
+ for (let mu = 0; mu < N; mu++) {
364
+ for (let nu = 0; nu < N; nu++) {
365
+ for (let rho = 0; rho < N; rho++) {
366
+ for (let sig = 0; sig < N; sig++) {
367
+ B[lam][mu][nu][rho][sig] =
368
+ covR[lam][mu][nu][rho][sig] // ∇_λ R_{μνρσ}
369
+ + covR[mu][nu][lam][rho][sig] // ∇_μ R_{νλρσ}
370
+ + covR[nu][lam][mu][rho][sig]; // ∇_ν R_{λμρσ}
371
+ }
372
+ }
373
+ }
374
+ }
375
+ }
376
+ return B;
377
+ }
378
+ //# sourceMappingURL=curvature-lowering-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curvature-lowering-helpers.js","sourceRoot":"","sources":["../../src/numerical/curvature-lowering-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAqBvF,8EAA8E;AAC9E,yBAAyB;AACzB,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,SAAS,CAAC,CAAS;IACjC,OAAO,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,S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C,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,eAAe;oBAClD,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -25,4 +25,20 @@ export declare class EngineCapabilityError extends NumericalBackendError {
25
25
  readonly missingMethod: string;
26
26
  constructor(engineName: string, missingMethod: string);
27
27
  }
28
+ /**
29
+ * Thrown when the GL4 implicit-stage Picard fixed-point solver fails to
30
+ * reach `picardTol` within `picardMaxIter` iterations. Carries a message
31
+ * matching `/Picard iteration did not converge/` for I7-style specific
32
+ * error-class assertions.
33
+ *
34
+ * Picard convergence is linear with contraction rate ≈ h·|∂f/∂x|; failure
35
+ * usually indicates the step size h is too large for the local curvature.
36
+ * Adaptive step-halving (Task 5) is the production response — direct
37
+ * callers of `solveGL4Stage` should adjust h or picardMaxIter.
38
+ *
39
+ * @public
40
+ */
41
+ export declare class GL4ConvergenceError extends NumericalBackendError {
42
+ constructor(message: string);
43
+ }
28
44
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/numerical/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,QAAQ;gBACrC,OAAO,EAAE,MAAM;CAK5B;AAED;;;;;;GAMG;AACH,qBAAa,qBAAsB,SAAQ,qBAAqB;aAE5C,UAAU,EAAE,MAAM;aAClB,aAAa,EAAE,MAAM;gBADrB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM;CASxC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/numerical/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,QAAQ;gBACrC,OAAO,EAAE,MAAM;CAK5B;AAED;;;;;;GAMG;AACH,qBAAa,qBAAsB,SAAQ,qBAAqB;aAE5C,UAAU,EAAE,MAAM;aAClB,aAAa,EAAE,MAAM;gBADrB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM;CASxC;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,mBAAoB,SAAQ,qBAAqB;gBAChD,OAAO,EAAE,MAAM;CAK5B"}
@@ -36,4 +36,24 @@ export class EngineCapabilityError extends NumericalBackendError {
36
36
  Object.setPrototypeOf(this, EngineCapabilityError.prototype);
37
37
  }
38
38
  }
39
+ /**
40
+ * Thrown when the GL4 implicit-stage Picard fixed-point solver fails to
41
+ * reach `picardTol` within `picardMaxIter` iterations. Carries a message
42
+ * matching `/Picard iteration did not converge/` for I7-style specific
43
+ * error-class assertions.
44
+ *
45
+ * Picard convergence is linear with contraction rate ≈ h·|∂f/∂x|; failure
46
+ * usually indicates the step size h is too large for the local curvature.
47
+ * Adaptive step-halving (Task 5) is the production response — direct
48
+ * callers of `solveGL4Stage` should adjust h or picardMaxIter.
49
+ *
50
+ * @public
51
+ */
52
+ export class GL4ConvergenceError extends NumericalBackendError {
53
+ constructor(message) {
54
+ super(message);
55
+ this.name = 'GL4ConvergenceError';
56
+ Object.setPrototypeOf(this, GL4ConvergenceError.prototype);
57
+ }
58
+ }
39
59
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/numerical/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD;;;;GAIG;AACH,MAAM,OAAO,qBAAsB,SAAQ,QAAQ;IACjD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;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