universal-physics-tensor 0.4.5 → 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 (78) hide show
  1. package/dist/dimensional/bridge-check.d.ts +6 -0
  2. package/dist/dimensional/bridge-check.d.ts.map +1 -1
  3. package/dist/dimensional/bridge-check.js +6 -0
  4. package/dist/dimensional/bridge-check.js.map +1 -1
  5. package/dist/dimensional/connection-validators.d.ts +61 -3
  6. package/dist/dimensional/connection-validators.d.ts.map +1 -1
  7. package/dist/dimensional/connection-validators.js +82 -9
  8. package/dist/dimensional/connection-validators.js.map +1 -1
  9. package/dist/dimensional/curvature.d.ts +336 -0
  10. package/dist/dimensional/curvature.d.ts.map +1 -0
  11. package/dist/dimensional/curvature.js +291 -0
  12. package/dist/dimensional/curvature.js.map +1 -0
  13. package/dist/dimensional/metric-validators.d.ts +12 -0
  14. package/dist/dimensional/metric-validators.d.ts.map +1 -1
  15. package/dist/dimensional/metric-validators.js.map +1 -1
  16. package/dist/dimensional/tensor.d.ts.map +1 -1
  17. package/dist/dimensional/tensor.js +7 -2
  18. package/dist/dimensional/tensor.js.map +1 -1
  19. package/dist/dimensional/validator.d.ts +5 -3
  20. package/dist/dimensional/validator.d.ts.map +1 -1
  21. package/dist/dimensional/validator.js +59 -2
  22. package/dist/dimensional/validator.js.map +1 -1
  23. package/dist/index.d.ts +8 -2
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +21 -2
  26. package/dist/index.js.map +1 -1
  27. package/dist/numerical/be37-covariant-eikonal.d.ts +96 -38
  28. package/dist/numerical/be37-covariant-eikonal.d.ts.map +1 -1
  29. package/dist/numerical/be37-covariant-eikonal.js +202 -39
  30. package/dist/numerical/be37-covariant-eikonal.js.map +1 -1
  31. package/dist/numerical/connection-lowering-helpers.d.ts +8 -6
  32. package/dist/numerical/connection-lowering-helpers.d.ts.map +1 -1
  33. package/dist/numerical/connection-lowering-helpers.js +25 -28
  34. package/dist/numerical/connection-lowering-helpers.js.map +1 -1
  35. package/dist/numerical/curvature-lowering-helpers.d.ts +162 -0
  36. package/dist/numerical/curvature-lowering-helpers.d.ts.map +1 -0
  37. package/dist/numerical/curvature-lowering-helpers.js +378 -0
  38. package/dist/numerical/curvature-lowering-helpers.js.map +1 -0
  39. package/dist/numerical/errors.d.ts +16 -0
  40. package/dist/numerical/errors.d.ts.map +1 -1
  41. package/dist/numerical/errors.js +20 -0
  42. package/dist/numerical/errors.js.map +1 -1
  43. package/dist/numerical/float64-engine.d.ts +4 -2
  44. package/dist/numerical/float64-engine.d.ts.map +1 -1
  45. package/dist/numerical/float64-engine.js +35 -45
  46. package/dist/numerical/float64-engine.js.map +1 -1
  47. package/dist/numerical/gl4-integrator.d.ts +167 -0
  48. package/dist/numerical/gl4-integrator.d.ts.map +1 -0
  49. package/dist/numerical/gl4-integrator.js +276 -0
  50. package/dist/numerical/gl4-integrator.js.map +1 -0
  51. package/dist/numerical/index.d.ts +8 -0
  52. package/dist/numerical/index.d.ts.map +1 -1
  53. package/dist/numerical/index.js +4 -0
  54. package/dist/numerical/index.js.map +1 -1
  55. package/dist/numerical/lowering.d.ts +3 -4
  56. package/dist/numerical/lowering.d.ts.map +1 -1
  57. package/dist/numerical/lowering.js +216 -22
  58. package/dist/numerical/lowering.js.map +1 -1
  59. package/dist/numerical/mathts-engine.d.ts +2 -2
  60. package/dist/numerical/mathts-engine.d.ts.map +1 -1
  61. package/dist/numerical/mathts-engine.js +13 -12
  62. package/dist/numerical/mathts-engine.js.map +1 -1
  63. package/dist/numerical/pderiv.d.ts.map +1 -1
  64. package/dist/numerical/pderiv.js +4 -18
  65. package/dist/numerical/pderiv.js.map +1 -1
  66. package/dist/numerical/perihelion-finder.d.ts +84 -0
  67. package/dist/numerical/perihelion-finder.d.ts.map +1 -0
  68. package/dist/numerical/perihelion-finder.js +261 -0
  69. package/dist/numerical/perihelion-finder.js.map +1 -0
  70. package/dist/numerical/strides.d.ts +26 -0
  71. package/dist/numerical/strides.d.ts.map +1 -0
  72. package/dist/numerical/strides.js +41 -0
  73. package/dist/numerical/strides.js.map +1 -0
  74. package/dist/numerical/tensor-engine.d.ts +4 -2
  75. package/dist/numerical/tensor-engine.d.ts.map +1 -1
  76. package/dist/numerical/tensor-engine.js +4 -2
  77. package/dist/numerical/tensor-engine.js.map +1 -1
  78. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -13,6 +13,12 @@ export type { BridgeEquationEntry, BridgeEquationStatus, BridgeIssueSeverity, Br
13
13
  export { evaluateGravitationalLensing, type GravitationalLensingInputs, type GravitationalLensingResult, evaluatePerihelionPrecession, type PerihelionPrecessionInputs, type PerihelionPrecessionResult, } from './bridges/index.js';
14
14
  export { christoffel } from './dimensional/connection.js';
15
15
  export type { CovariantDerivativeNode } from './dimensional/validator.js';
16
+ export { ricci } from './dimensional/curvature.js';
17
+ export type { RicciTensorNode } from './dimensional/validator.js';
18
+ export { einstein } from './dimensional/curvature.js';
19
+ export type { EinsteinTensorNode } from './dimensional/validator.js';
20
+ export { bianchiResidual } from './dimensional/curvature.js';
21
+ export type { BianchiResidualNode } from './dimensional/validator.js';
16
22
  export { integrateGeodesic, type GeodesicIntegratorInputs, type GeodesicIntegratorResult, } from './numerical/geodesic-integrator.js';
17
23
  export type { Dimension } from './dimensional/types.js';
18
24
  export { DIMENSIONLESS, LENGTH, AREA, TIME, FREQUENCY, MASS, VELOCITY, ACCELERATION, FORCE, ENERGY, POWER, ACTION, TEMPERATURE, ENTROPY, CHARGE, } from './dimensional/types.js';
@@ -20,6 +26,6 @@ export { multiply, divide, power, add, subtract, equals, format, DimensionMismat
20
26
  export type { ExprNode, ValidationResult, Violation } from './dimensional/validator.js';
21
27
  export { validate, validateEquation, validateInverseMetricPair } from './dimensional/validator.js';
22
28
  export { inferDimensionForBridge } from './dimensional/bridge-check.js';
23
- export { evaluateNumerical, evaluateNumericalRaw, evaluateMetricInverse, Float64ReferenceEngine, getActiveEngine, setActiveEngine, NumericalBackendError, DuplicateCoordinateWarning, EngineCapabilityError, hasAutogradSupport, evaluateBE37CovariantEikonalNumerical, } from './numerical/index.js';
24
- export type { NumericalResult, NumericalRawResult, EvaluateOptions, NumericalInputs, TensorEngine, EngineTensor, EinsumSpec, NestedArray, GridField, ForwardGradResult, ReverseGradResult, } from './numerical/index.js';
29
+ export { evaluateNumerical, evaluateNumericalRaw, evaluateMetricInverse, Float64ReferenceEngine, getActiveEngine, setActiveEngine, NumericalBackendError, DuplicateCoordinateWarning, EngineCapabilityError, hasAutogradSupport, evaluateBE37CovariantEikonalNumerical, integrateGeodesicGL4, findPerihelion, } from './numerical/index.js';
30
+ export type { NumericalResult, NumericalRawResult, EvaluateOptions, NumericalInputs, TensorEngine, EngineTensor, EinsumSpec, NestedArray, GridField, ForwardGradResult, ReverseGradResult, GL4State, GL4Snapshot, GL4Options, PerihelionResult, FindPerihelionOptions, } from './numerical/index.js';
25
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,YAAY,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,KAAK,EACL,QAAQ,EACR,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAOpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,GACX,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,4BAA4B,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAC/B,4BAA4B,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,GACh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,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,MAAM,EACN,KAAK,EACL,MAAM,EACN,WAAW,EACX,OAAO,EACP,MAAM,GACP,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,QAAQ,EACR,MAAM,EACN,KAAK,EACL,GAAG,EACH,QAAQ,EACR,MAAM,EACN,MAAM,EACN,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACnG,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAQxE,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,qBAAqB,EAErB,0BAA0B,EAC1B,qBAAqB,EACrB,kBAAkB,EAClB,qCAAqC,EAErC,oBAAoB,EAEpB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,SAAS,EAET,iBAAiB,EACjB,iBAAiB,EAEjB,QAAQ,EACR,WAAW,EACX,UAAU,EAEV,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -20,18 +20,37 @@ export { evaluateGravitationalLensing, evaluatePerihelionPrecession, } from './b
20
20
  // callers compose Γ trees directly; `CovariantDerivativeNode` is the structural
21
21
  // type for the new ∇_μ AST kind.
22
22
  export { christoffel } from './dimensional/connection.js';
23
+ // v0.5.0 curvature layer — Ricci tensor helper (Task 7). `ricci(R)` wraps a
24
+ // RiemannTensorNode and produces the contracted R_μν = R^λ_{λμν} as a
25
+ // composite ExprNode (own validator + lowering arms).
26
+ export { ricci } from './dimensional/curvature.js';
27
+ // v0.5.0 curvature layer — Einstein tensor helper (Task 8). `einstein(R, g,
28
+ // gInverse)` wraps a RiemannTensorNode + metric pair and produces the
29
+ // composite G_μν = R_μν − ½ R g_μν as an ExprNode (own validator +
30
+ // lowering arms — no AST rewrite). Vacuum-Einstein scope; matter-coupled
31
+ // `G_μν = κ T_μν` is deferred to v0.6.0+.
32
+ export { einstein } from './dimensional/curvature.js';
33
+ // v0.5.0 curvature layer — Bianchi residual helper (Task 9). `bianchiResidual(R)`
34
+ // returns {residual, evaluate, evaluateMax} for the cyclic second-Bianchi-identity
35
+ // check ∇_{[λ} R_{μν]ρσ} = 0. Closes Phase 1 — Foundations.
36
+ export { bianchiResidual } from './dimensional/curvature.js';
23
37
  // v0.4.0 geodesic integrator (RK4 solver — headline feature of v0.4.0)
24
38
  export { integrateGeodesic, } from './numerical/geodesic-integrator.js';
25
39
  export { DIMENSIONLESS, LENGTH, AREA, TIME, FREQUENCY, MASS, VELOCITY, ACCELERATION, FORCE, ENERGY, POWER, ACTION, TEMPERATURE, ENTROPY, CHARGE, } from './dimensional/types.js';
26
40
  export { multiply, divide, power, add, subtract, equals, format, DimensionMismatchError, } from './dimensional/algebra.js';
27
41
  export { validate, validateEquation, validateInverseMetricPair } from './dimensional/validator.js';
28
42
  export { inferDimensionForBridge } from './dimensional/bridge-check.js';
29
- // v0.3.5 numerical-contraction backend. See docs/planning/v0.3.5-Design.md.
43
+ // Numerical-contraction backend (v0.3.5+). See docs/planning/v0.3.5-Design.md
44
+ // and docs/planning/v0.4.0-Implementation-Plan.md (v0.4.0 additions below).
30
45
  // Every symbol below is `@public` — the consumer-facing (TensorJS) surface.
31
46
  // `MathTSEngine` is intentionally NOT re-exported here: it lives behind the
32
47
  // `@danielsimonjr/mathts-tensor` optionalDependency and is reachable only via
33
48
  // the `universal-physics-tensor/numerical/mathts-engine` exports subpath.
34
49
  export { evaluateNumerical, evaluateNumericalRaw, evaluateMetricInverse, Float64ReferenceEngine, getActiveEngine, setActiveEngine, NumericalBackendError,
35
50
  // v0.4.0 additions to the numerical surface
36
- DuplicateCoordinateWarning, EngineCapabilityError, hasAutogradSupport, evaluateBE37CovariantEikonalNumerical, } from './numerical/index.js';
51
+ DuplicateCoordinateWarning, EngineCapabilityError, hasAutogradSupport, evaluateBE37CovariantEikonalNumerical,
52
+ // v0.5.0 GL4 symplectic integrator
53
+ integrateGeodesicGL4,
54
+ // v0.5.0 perihelion finder (Task 4)
55
+ findPerihelion, } from './numerical/index.js';
37
56
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAYnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,yEAAyE;AACzE,4EAA4E;AAC5E,2EAA2E;AAC3E,2EAA2E;AAC3E,yDAAyD;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAStD,8EAA8E;AAC9E,OAAO,EACL,4BAA4B,EAG5B,4BAA4B,GAG7B,MAAM,oBAAoB,CAAC;AAE5B,iFAAiF;AACjF,+EAA+E;AAC/E,gFAAgF;AAChF,iCAAiC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAK1D,uEAAuE;AACvE,OAAO,EACL,iBAAiB,GAGlB,MAAM,oCAAoC,CAAC;AAO5C,OAAO,EACL,aAAa,EACb,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,MAAM,EACN,KAAK,EACL,MAAM,EACN,WAAW,EACX,OAAO,EACP,MAAM,GACP,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,QAAQ,EACR,MAAM,EACN,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A4B,CAAC;AAGtD,kFAAkF;AAClF,mFAAmF;AACnF,4DAA4D;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAG7D,uEAAuE;AACvE,OAAO,EACL,iBAAiB,GAGlB,MAAM,oCAAoC,CAAC;AAO5C,OAAO,EACL,aAAa,EACb,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,MAAM,EACN,KAAK,EACL,MAAM,EACN,WAAW,EACX,OAAO,EACP,MAAM,GACP,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,QAAQ,EACR,MAAM,EACN,KAAK,EACL,GAAG,EACH,QAAQ,EACR,MAAM,EACN,MAAM,EACN,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACnG,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE,8EAA8E;AAC9E,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAC5E,8EAA8E;AAC9E,0EAA0E;AAC1E,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,qBAAqB;AACrB,4CAA4C;AAC5C,0BAA0B,EAC1B,qBAAqB,EACrB,kBAAkB,EAClB,qCAAqC;AACrC,mCAAmC;AACnC,oBAAoB;AACpB,oCAAoC;AACpC,cAAc,GACf,MAAM,sBAAsB,CAAC"}
@@ -1,41 +1,69 @@
1
1
  /**
2
- * v0.4.0 BE-37 covariant-eikonal STRUCTURAL PREVIEW.
2
+ * v0.5.0 BE-37 covariant-eikonal numerical evaluator.
3
3
  *
4
4
  * Provides `evaluateBE37CovariantEikonalNumerical`, which encodes the
5
5
  * covariant-eikonal equation
6
6
  *
7
7
  * g^μν ∇_μ ∇_ν S = 0
8
8
  *
9
- * via the connection layer added in Tasks 2-3 + 12-14. In v0.4.0 the
10
- * eikonal residual is **0 by construction**: the null wave-covector
9
+ * via the connection layer (Tasks 2-3 + 12-14 of v0.4.0). The eikonal
10
+ * residual is **0 by construction**: the null wave-covector
11
11
  *
12
12
  * k_μ = ∂_μ S = (E, E, 0, 0) (energy + radial component only)
13
13
  *
14
14
  * satisfies g^μν k_μ k_ν = 0 identically for the +,−,−,− Schwarzschild
15
- * metric. No numerical integration is performed for this quantity.
15
+ * metric. No numerical integration is performed for this quantity.
16
16
  *
17
- * The `shapiroDelaySec` field is an **intentional v0.4.0 stub** (returns 0).
18
- * The full geodesic-integrated Shapiro cross-check comparing
19
- * `shapiroDelaySec` against `evaluateShapiroDelay` is the v0.5.0
20
- * deliverable; it requires wiring `integrateGeodesic` end-to-end through
21
- * the covariant-eikonal path, which is deferred.
17
+ * `shapiroDelaySec` is computed by **GL4-driven null-geodesic integration**
18
+ * on the canonical (x, p) state in the Schwarzschild spacetime (v0.5.0 Task
19
+ * 12, Phase 2c). The photon propagates from `r = R_far_m` down to
20
+ * `r = R_near_m`; coordinate time at the endpoint minus the flat-space
21
+ * straight-line transit time is returned as the Shapiro delay.
22
22
  *
23
- * @see tests/dimensional/covariant-derivative-preview.test.ts (Task 17 [U])
24
- * @see docs/planning/v0.4.0-Implementation-Plan.md Task 17
23
+ * For the default radial geometry (impact parameter `b_m = 0`) the
24
+ * integrator reproduces the closed-form `(2GM/c³) · ln(R_far/R_near)`
25
+ * (Task 11 cross-checks this to ±2×10⁻³).
26
+ *
27
+ * @see tests/numerical/be37-covariant-eikonal-real.test.ts (Task 12 [U])
28
+ * @see tests/dimensional/covariant-derivative-preview.test.ts (Task 17 [U]/Task 11 [U])
29
+ * @see docs/planning/v0.5.0-Implementation-Plan.md Task 12
25
30
  * @module numerical/be37-covariant-eikonal
26
31
  * @public
27
32
  */
28
33
  /**
29
- * Input parameters for the BE-37 covariant-eikonal preview evaluator.
34
+ * Input parameters for the BE-37 covariant-eikonal evaluator.
30
35
  * @public
31
36
  */
32
37
  export interface BE37CovariantEikonalInputs {
33
38
  /** Gravitational source mass in kilograms (must be > 0). */
34
39
  readonly M_kg: number;
35
- /** Far-point radius in metres, i.e. the signal origin/destination (must be > 0). */
40
+ /** Far-point radius in metres, i.e. the signal origin (must be > 0). */
36
41
  readonly R_far_m: number;
37
- /** Near-point radius in metres, i.e. closest approach to the source (must be > 0, ≤ R_far_m). */
42
+ /** Near-point radius in metres, i.e. the signal destination
43
+ * (must be > 0, ≤ R_far_m, and outside the Schwarzschild horizon). */
38
44
  readonly R_near_m: number;
45
+ /**
46
+ * Optional impact parameter `b` in metres for the null geodesic. The
47
+ * photon's angular momentum is set such that the minimum r (closest
48
+ * approach) is `b` in the flat-space limit; `p_φ = b · c` in the
49
+ * affine-parameter normalization used here (`p_t = −c²`).
50
+ *
51
+ * Default `0` — purely radial null geodesic, which reproduces the
52
+ * closed-form `(2GM/c³) · ln(R_far/R_near)` Shapiro delay. Non-zero
53
+ * `b` modifies the geometry and the closed-form comparator changes
54
+ * to `(2GM/c³) · ln((R_far + √(R_far²−b²)) / (R_near + √(R_near²−b²)))`
55
+ * for the single-leg path (closest-approach not crossed).
56
+ *
57
+ * Must satisfy `b ≤ R_near` if non-zero (otherwise the photon cannot
58
+ * reach `R_near` without crossing closest approach).
59
+ */
60
+ readonly b_m?: number;
61
+ /**
62
+ * Optional GL4 step count override. Default `2048` — sufficient for
63
+ * the default radial geometry to reach ≤1e-6 relative agreement with
64
+ * `evaluateShapiroDelay` on Earth/Mars/Sun scales (Task 11).
65
+ */
66
+ readonly steps?: number;
39
67
  }
40
68
  /**
41
69
  * Result of `evaluateBE37CovariantEikonalNumerical`.
@@ -46,44 +74,74 @@ export interface BE37CovariantEikonalResult {
46
74
  * Numerical residual of the covariant-eikonal equation
47
75
  * g^μν ∇_μ ∇_ν S = 0 evaluated at the null wave-covector.
48
76
  *
49
- * **v0.4.0 structural preview**: returns exactly 0 by construction —
50
- * the null wave-covector k_μ = ∂_μ S = (E, E, 0, 0) satisfies
51
- * g^μν k_μ k_ν = 0 identically for the Schwarzschild +,−,−,− metric.
52
- * No numerical integration is required to establish this; the result
53
- * is a structural consequence of the null-ray construction.
77
+ * Returns exactly 0 by construction — the null wave-covector
78
+ * k_μ = ∂_μ S = (E, E, 0, 0) satisfies g^μν k_μ k_ν = 0
79
+ * identically for the Schwarzschild +,−,−,− metric. No numerical
80
+ * integration is required to establish this; the result is a
81
+ * structural consequence of the null-ray construction.
54
82
  */
55
83
  readonly eikonalResidual: number;
56
84
  /**
57
- * Shapiro time delay in seconds via geodesic integration.
85
+ * Shapiro coordinate-time delay in seconds, computed via GL4
86
+ * null-geodesic integration on the canonical (x, p) state.
58
87
  *
59
- * **v0.4.0 stub returns 0.** The full geodesic-integrated Shapiro
60
- * cross-check (comparing this field against `evaluateShapiroDelay`) is
61
- * the v0.5.0 deliverable; see `it.skip` in
62
- * `tests/dimensional/covariant-derivative-preview.test.ts`.
88
+ * **v0.5.0 Task 12:** real value (was a documented stub returning 0 in
89
+ * v0.4.0). For the default radial geometry (`b_m = 0`) this agrees with
90
+ * the closed-form `(2GM/c³) · ln(R_far/R_near)` to ≤1e-6 relative at
91
+ * the default step count (Task 11 [U]).
63
92
  */
64
93
  readonly shapiroDelaySec: number;
65
94
  /**
66
- * Optional closed-form cross-check value (seconds).
67
- * Populated when a closed-form comparator is available.
68
- * Not populated in the v0.4.0 structural preview.
95
+ * Optional closed-form cross-check value (seconds). Not populated by
96
+ * this evaluator callers cross-check externally against
97
+ * `evaluateShapiroDelay`.
69
98
  */
70
99
  readonly closedFormDelaySec?: number;
71
100
  }
72
101
  /**
73
- * v0.4.0 BE-37 covariant-eikonal STRUCTURAL PREVIEW.
102
+ * v0.5.0 BE-37 covariant-eikonal numerical evaluator.
103
+ *
104
+ * Returns:
105
+ * - `eikonalResidual = 0` by construction (null wave-covector identity).
106
+ * - `shapiroDelaySec`: GL4-integrated coordinate-time delay relative to
107
+ * the flat-space straight-line transit, in seconds.
108
+ *
109
+ * **Algorithm — null geodesic in Schwarzschild via GL4.**
110
+ *
111
+ * 1. Schwarzschild radius `r_s = 2GM/c²`. Domain guard `R_near_m > r_s`
112
+ * (else the photon path crosses the event horizon).
113
+ * 2. Set initial state at `(t=0, r=R_far_m, θ=π/2, φ=0)`. Affine-parameter
114
+ * normalization `p_t = −c²` → `dt/dτ = 1/(1−r_s/r) ≈ 1` far from the
115
+ * horizon (τ ≈ coord time). Set `p_θ = 0` (motion confined to equatorial
116
+ * plane), `p_φ = b_m · c` (Killing-vector angular momentum
117
+ * corresponding to flat-limit impact parameter `b_m`).
118
+ * 3. Solve `p_r` from the null condition `g^μν p_μ p_ν = 0` at the
119
+ * initial point, take the negative root (inward motion: `dr/dτ < 0`
120
+ * since `dr/dτ = g^rr p_r = (1−r_s/r) p_r`).
121
+ * 4. Integrate via `integrateGeodesicGL4` for `tauMax` chosen to overshoot
122
+ * `r = R_near_m` (safety factor 1.5 on the flat-space transit time).
123
+ * 5. Walk snapshots; find the first index where `r ≤ R_near_m`. Linearly
124
+ * interpolate `t` between the bracketing snapshots to land exactly on
125
+ * `r = R_near_m`. Take that `t` as the geodesic coord-time transit.
126
+ * 6. Flat-space reference: for a straight-line null ray with impact
127
+ * parameter `b`, time to go from `r_far` to `r_near` (single leg, no
128
+ * closest-approach crossing) is `(√(r_far²−b²) − √(r_near²−b²))/c`.
129
+ * For `b = 0` (default) this reduces to `(R_far − R_near)/c`.
130
+ * 7. `shapiroDelaySec = t_geodesic − t_flat`.
74
131
  *
75
- * Encodes the eikonal as ∇_μ ∇^μ S using Task 2's `CovariantDerivativeNode`
76
- * and Task 12's lowering path. The numerical eikonal residual is exactly 0
77
- * by construction of the null wave-covector (same structural ground as v0.3.5
78
- * `evaluateBE37EikonalNumerical`, but now expressed through the covariant
79
- * rather than the partial-derivative form).
132
+ * **Sign convention.** Shapiro delay is positive (light slowed by the
133
+ * gravitational potential). A negative result indicates an integration
134
+ * or reference-frame bug.
80
135
  *
81
- * **shapiroDelaySec = 0** in v0.4.0 (intentional stub). The
82
- * geodesic-integrated Shapiro cross-check via Task 14's `integrateGeodesic`
83
- * is the v0.5.0 deliverable.
136
+ * **Impact parameter `b_m`.** Default `0` (radial). The default geometry
137
+ * reproduces the closed-form `evaluateShapiroDelay` to ≤1e-6 relative at
138
+ * 2048 steps for solar-scale Earth/Mars distances (Task 11 cross-check).
139
+ * Non-zero `b_m` requires `b_m ≤ R_near_m` (closest approach `r_min ≈ b`
140
+ * must not lie between R_far and R_near).
84
141
  *
85
- * @param inputs - Source mass + far/near radii.
86
- * @returns Structural eikonal residual (0 by construction) + stub Shapiro delay.
142
+ * @param inputs - Source mass + far/near radii (+ optional `b_m`, `steps`).
143
+ * @returns `{eikonalResidual: 0, shapiroDelaySec: <real, positive>}`.
144
+ * @throws RangeError on out-of-domain inputs.
87
145
  * @public
88
146
  */
89
147
  export declare function evaluateBE37CovariantEikonalNumerical(inputs: BE37CovariantEikonalInputs): Promise<BE37CovariantEikonalResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"be37-covariant-eikonal.d.ts","sourceRoot":"","sources":["../../src/numerical/be37-covariant-eikonal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oFAAoF;IACpF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,iGAAiG;IACjG,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;;;;;;;OASG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IAEjC;;;;;;;OAOG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IAEjC;;;;OAIG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,qCAAqC,CACzD,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,0BAA0B,CAAC,CA6CrC"}
1
+ {"version":3,"file":"be37-covariant-eikonal.d.ts","sourceRoot":"","sources":["../../src/numerical/be37-covariant-eikonal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AASH;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,wEAAwE;IACxE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;2EACuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;;;;;;;OASG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IAEjC;;;;;;;;OAQG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IAEjC;;;;OAIG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACtC;AAgFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAsB,qCAAqC,CACzD,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,0BAA0B,CAAC,CAqHrC"}
@@ -1,50 +1,158 @@
1
1
  /**
2
- * v0.4.0 BE-37 covariant-eikonal STRUCTURAL PREVIEW.
2
+ * v0.5.0 BE-37 covariant-eikonal numerical evaluator.
3
3
  *
4
4
  * Provides `evaluateBE37CovariantEikonalNumerical`, which encodes the
5
5
  * covariant-eikonal equation
6
6
  *
7
7
  * g^μν ∇_μ ∇_ν S = 0
8
8
  *
9
- * via the connection layer added in Tasks 2-3 + 12-14. In v0.4.0 the
10
- * eikonal residual is **0 by construction**: the null wave-covector
9
+ * via the connection layer (Tasks 2-3 + 12-14 of v0.4.0). The eikonal
10
+ * residual is **0 by construction**: the null wave-covector
11
11
  *
12
12
  * k_μ = ∂_μ S = (E, E, 0, 0) (energy + radial component only)
13
13
  *
14
14
  * satisfies g^μν k_μ k_ν = 0 identically for the +,−,−,− Schwarzschild
15
- * metric. No numerical integration is performed for this quantity.
15
+ * metric. No numerical integration is performed for this quantity.
16
16
  *
17
- * The `shapiroDelaySec` field is an **intentional v0.4.0 stub** (returns 0).
18
- * The full geodesic-integrated Shapiro cross-check comparing
19
- * `shapiroDelaySec` against `evaluateShapiroDelay` is the v0.5.0
20
- * deliverable; it requires wiring `integrateGeodesic` end-to-end through
21
- * the covariant-eikonal path, which is deferred.
17
+ * `shapiroDelaySec` is computed by **GL4-driven null-geodesic integration**
18
+ * on the canonical (x, p) state in the Schwarzschild spacetime (v0.5.0 Task
19
+ * 12, Phase 2c). The photon propagates from `r = R_far_m` down to
20
+ * `r = R_near_m`; coordinate time at the endpoint minus the flat-space
21
+ * straight-line transit time is returned as the Shapiro delay.
22
22
  *
23
- * @see tests/dimensional/covariant-derivative-preview.test.ts (Task 17 [U])
24
- * @see docs/planning/v0.4.0-Implementation-Plan.md Task 17
23
+ * For the default radial geometry (impact parameter `b_m = 0`) the
24
+ * integrator reproduces the closed-form `(2GM/c³) · ln(R_far/R_near)`
25
+ * (Task 11 cross-checks this to ±2×10⁻³).
26
+ *
27
+ * @see tests/numerical/be37-covariant-eikonal-real.test.ts (Task 12 [U])
28
+ * @see tests/dimensional/covariant-derivative-preview.test.ts (Task 17 [U]/Task 11 [U])
29
+ * @see docs/planning/v0.5.0-Implementation-Plan.md Task 12
25
30
  * @module numerical/be37-covariant-eikonal
26
31
  * @public
27
32
  */
33
+ import { integrateGeodesicGL4 } from './gl4-integrator.js';
34
+ // ─── Physical constants (CODATA 2018 + SI definitions) ────────────────────
35
+ const G_SI = 6.6743e-11; // m³ kg⁻¹ s⁻² (matches tests/fixtures/schwarzschild.ts)
36
+ const c_SI = 2.998e8; // m s⁻¹ (matches tests/fixtures/schwarzschild.ts)
37
+ const c2_SI = c_SI * c_SI;
28
38
  /**
29
- * v0.4.0 BE-37 covariant-eikonal STRUCTURAL PREVIEW.
39
+ * Schwarzschild radius `r_s = 2GM/c²`.
30
40
  *
31
- * Encodes the eikonal as ∇_μ ∇^μ S using Task 2's `CovariantDerivativeNode`
32
- * and Task 12's lowering path. The numerical eikonal residual is exactly 0
33
- * by construction of the null wave-covector (same structural ground as v0.3.5
34
- * `evaluateBE37EikonalNumerical`, but now expressed through the covariant
35
- * rather than the partial-derivative form).
41
+ * Mirrors `tests/fixtures/schwarzschild.ts` (kept private here to avoid
42
+ * a src→tests dependency).
36
43
  *
37
- * **shapiroDelaySec = 0** in v0.4.0 (intentional stub). The
38
- * geodesic-integrated Shapiro cross-check via Task 14's `integrateGeodesic`
39
- * is the v0.5.0 deliverable.
44
+ * @internal
45
+ */
46
+ function schwarzschildRs(M_kg) {
47
+ return (2 * G_SI * M_kg) / c2_SI;
48
+ }
49
+ /**
50
+ * Returns the contravariant Schwarzschild metric closure g^{μν}(x).
40
51
  *
41
- * @param inputs - Source mass + far/near radii.
42
- * @returns Structural eikonal residual (0 by construction) + stub Shapiro delay.
52
+ * SI convention with on `g_{tt}` mirrors the test fixture so the
53
+ * coordinate time `t = x^0` carries seconds and `p_t = −c²` produces
54
+ * `dt/dτ ≈ 1` (τ ≈ coord time far from horizon).
55
+ *
56
+ * @internal
57
+ */
58
+ function buildGInverseFn(M_kg) {
59
+ const r_s = schwarzschildRs(M_kg);
60
+ return function gInverse(x) {
61
+ const r = x[1];
62
+ const theta = x[2];
63
+ const f = 1 - r_s / r;
64
+ const sinT = Math.sin(theta);
65
+ const gInv = [
66
+ [0, 0, 0, 0],
67
+ [0, 0, 0, 0],
68
+ [0, 0, 0, 0],
69
+ [0, 0, 0, 0],
70
+ ];
71
+ gInv[0][0] = -1 / (f * c2_SI);
72
+ gInv[1][1] = f;
73
+ gInv[2][2] = 1 / (r * r);
74
+ gInv[3][3] = 1 / (r * r * sinT * sinT);
75
+ return gInv;
76
+ };
77
+ }
78
+ /**
79
+ * Returns ∂_λ g^{μν}(x) with index order `dg[λ][μ][ν]`.
80
+ *
81
+ * Only ∂_r and ∂_θ entries are non-zero (static, axisymmetric metric).
82
+ * Sign of `dg[1][0][0] = ∂_r g^{tt} = +r_s/(r²(1−r_s/r)²c²)` matches the
83
+ * Task 0 fixture fix (positive — incorrectly negative in the v0.5.0
84
+ * pre-Task-3 fixture; reversal would push the photon outward).
85
+ *
86
+ * @internal
87
+ */
88
+ function buildDgInverseFn(M_kg) {
89
+ const r_s = schwarzschildRs(M_kg);
90
+ return function dgInverse(x) {
91
+ const r = x[1];
92
+ const theta = x[2];
93
+ const sinT = Math.sin(theta);
94
+ const cosT = Math.cos(theta);
95
+ const f = 1 - r_s / r;
96
+ const dg = Array.from({ length: 4 }, () => Array.from({ length: 4 }, () => [0, 0, 0, 0]));
97
+ // ∂_r entries (axis 1)
98
+ dg[1][0][0] = r_s / (r * r * f * f * c2_SI);
99
+ dg[1][1][1] = r_s / (r * r);
100
+ dg[1][2][2] = -2 / (r * r * r);
101
+ dg[1][3][3] = -2 / (r * r * r * sinT * sinT);
102
+ // ∂_θ entry (axis 2)
103
+ dg[2][3][3] = (-2 * cosT) / (r * r * sinT * sinT * sinT);
104
+ return dg;
105
+ };
106
+ }
107
+ /**
108
+ * v0.5.0 BE-37 covariant-eikonal numerical evaluator.
109
+ *
110
+ * Returns:
111
+ * - `eikonalResidual = 0` by construction (null wave-covector identity).
112
+ * - `shapiroDelaySec`: GL4-integrated coordinate-time delay relative to
113
+ * the flat-space straight-line transit, in seconds.
114
+ *
115
+ * **Algorithm — null geodesic in Schwarzschild via GL4.**
116
+ *
117
+ * 1. Schwarzschild radius `r_s = 2GM/c²`. Domain guard `R_near_m > r_s`
118
+ * (else the photon path crosses the event horizon).
119
+ * 2. Set initial state at `(t=0, r=R_far_m, θ=π/2, φ=0)`. Affine-parameter
120
+ * normalization `p_t = −c²` → `dt/dτ = 1/(1−r_s/r) ≈ 1` far from the
121
+ * horizon (τ ≈ coord time). Set `p_θ = 0` (motion confined to equatorial
122
+ * plane), `p_φ = b_m · c` (Killing-vector angular momentum
123
+ * corresponding to flat-limit impact parameter `b_m`).
124
+ * 3. Solve `p_r` from the null condition `g^μν p_μ p_ν = 0` at the
125
+ * initial point, take the negative root (inward motion: `dr/dτ < 0`
126
+ * since `dr/dτ = g^rr p_r = (1−r_s/r) p_r`).
127
+ * 4. Integrate via `integrateGeodesicGL4` for `tauMax` chosen to overshoot
128
+ * `r = R_near_m` (safety factor 1.5 on the flat-space transit time).
129
+ * 5. Walk snapshots; find the first index where `r ≤ R_near_m`. Linearly
130
+ * interpolate `t` between the bracketing snapshots to land exactly on
131
+ * `r = R_near_m`. Take that `t` as the geodesic coord-time transit.
132
+ * 6. Flat-space reference: for a straight-line null ray with impact
133
+ * parameter `b`, time to go from `r_far` to `r_near` (single leg, no
134
+ * closest-approach crossing) is `(√(r_far²−b²) − √(r_near²−b²))/c`.
135
+ * For `b = 0` (default) this reduces to `(R_far − R_near)/c`.
136
+ * 7. `shapiroDelaySec = t_geodesic − t_flat`.
137
+ *
138
+ * **Sign convention.** Shapiro delay is positive (light slowed by the
139
+ * gravitational potential). A negative result indicates an integration
140
+ * or reference-frame bug.
141
+ *
142
+ * **Impact parameter `b_m`.** Default `0` (radial). The default geometry
143
+ * reproduces the closed-form `evaluateShapiroDelay` to ≤1e-6 relative at
144
+ * 2048 steps for solar-scale Earth/Mars distances (Task 11 cross-check).
145
+ * Non-zero `b_m` requires `b_m ≤ R_near_m` (closest approach `r_min ≈ b`
146
+ * must not lie between R_far and R_near).
147
+ *
148
+ * @param inputs - Source mass + far/near radii (+ optional `b_m`, `steps`).
149
+ * @returns `{eikonalResidual: 0, shapiroDelaySec: <real, positive>}`.
150
+ * @throws RangeError on out-of-domain inputs.
43
151
  * @public
44
152
  */
45
153
  export async function evaluateBE37CovariantEikonalNumerical(inputs) {
46
- const { M_kg, R_far_m, R_near_m } = inputs;
47
- // Domain guards (mirrors evaluateShapiroDelay for API consistency).
154
+ const { M_kg, R_far_m, R_near_m, b_m = 0, steps = 2048 } = inputs;
155
+ // ─── Domain guards ──────────────────────────────────────────────────────
48
156
  if (!Number.isFinite(M_kg) || M_kg <= 0) {
49
157
  throw new RangeError(`evaluateBE37CovariantEikonalNumerical: M_kg must be a finite positive number, got ${M_kg}`);
50
158
  }
@@ -57,23 +165,78 @@ export async function evaluateBE37CovariantEikonalNumerical(inputs) {
57
165
  if (R_near_m > R_far_m) {
58
166
  throw new RangeError(`evaluateBE37CovariantEikonalNumerical: R_near_m (${R_near_m}) must be ≤ R_far_m (${R_far_m})`);
59
167
  }
168
+ if (!Number.isFinite(b_m) || b_m < 0) {
169
+ throw new RangeError(`evaluateBE37CovariantEikonalNumerical: b_m must be a finite non-negative number, got ${b_m}`);
170
+ }
171
+ if (b_m > R_near_m) {
172
+ throw new RangeError(`evaluateBE37CovariantEikonalNumerical: b_m (${b_m}) must be ≤ R_near_m (${R_near_m}); closest-approach geometry not supported`);
173
+ }
174
+ const r_s = schwarzschildRs(M_kg);
175
+ if (R_near_m <= r_s * 1.01) {
176
+ throw new RangeError(`evaluateBE37CovariantEikonalNumerical: R_near_m (${R_near_m}) must be safely outside the Schwarzschild horizon r_s=${r_s}`);
177
+ }
60
178
  // ─── Eikonal residual ────────────────────────────────────────────────────
61
- //
62
- // The covariant-eikonal equation g^μν ∇_μ ∇_ν S = 0 is evaluated at
63
- // the null wave-covector k_μ = ∂_μ S = (E, E, 0, 0) in Schwarzschild
64
- // coordinates. For a null ray, by definition:
65
- //
66
- // g^μν k_μ k_ν = 0
67
- //
68
- // This is a structural consequence of the null-ray construction — it does
69
- // not depend on M_kg, R_far_m, or R_near_m. The residual is exactly 0.
179
+ // g^μν k_μ k_ν = 0 by construction for the null wave-covector
180
+ // k_μ = (E, E, 0, 0). Structural independent of M_kg, R_far, R_near.
70
181
  const eikonalResidual = 0;
71
- // ─── Shapiro delay (v0.4.0 stub) ────────────────────────────────────────
72
- //
73
- // The geodesic-integrated Shapiro delay is deferred to v0.5.0.
74
- // shapiroDelaySec returns 0 here; the v0.5.0 task will wire
75
- // integrateGeodesic through this path and remove the stub.
76
- const shapiroDelaySec = 0;
182
+ // ─── Shapiro delay via GL4 null-geodesic integration ────────────────────
183
+ const gInverseFn = buildGInverseFn(M_kg);
184
+ const dgInverseFn = buildDgInverseFn(M_kg);
185
+ // Initial state at (t=0, r=R_far, θ=π/2, φ=0). Equatorial plane (p_θ=0).
186
+ // Affine-parameter normalization: p_t = -c² makes dt/dτ ≈ 1 far from
187
+ // horizon, so τ ≈ coord time t and tauMax can be set in units of seconds.
188
+ const x0 = [0, R_far_m, Math.PI / 2, 0];
189
+ const p_t = -c2_SI;
190
+ const p_phi = b_m * c_SI; // Killing-vector conservation: classical b = p_φ/(|p_t|/c²·c) = p_φ/c.
191
+ const p_theta = 0;
192
+ // Solve null condition g^μν p_μ p_ν = 0 for p_r at the initial point:
193
+ // g^tt p_t² + g^rr p_r² + g^φφ p_φ² = 0 (θ=π/2)
194
+ // ⇒ p_r² = (−g^tt p_t² − g^φφ p_φ²) / g^rr
195
+ const gInv0 = gInverseFn(x0);
196
+ const numerator = -gInv0[0][0] * p_t * p_t - gInv0[3][3] * p_phi * p_phi;
197
+ if (numerator < 0) {
198
+ throw new RangeError(`evaluateBE37CovariantEikonalNumerical: null condition has no real p_r at R_far=${R_far_m} (impact parameter b=${b_m} too large for this geometry; numerator=${numerator})`);
199
+ }
200
+ const p_r_magnitude = Math.sqrt(numerator / gInv0[1][1]);
201
+ // Inward motion: dr/dτ = g^rr p_r = (1-r_s/r) p_r < 0 ⇒ p_r < 0.
202
+ const p_r = -p_r_magnitude;
203
+ const initialState = {
204
+ x: x0,
205
+ p: [p_t, p_r, p_theta, p_phi],
206
+ };
207
+ // Choose tauMax to overshoot R_near with safety margin. With p_t = -c²
208
+ // and far from horizon, dr/dτ ≈ -c for b=0 (radial); slightly slower for
209
+ // non-zero b. Flat-space single-leg time = (√(R_far² − b²) − √(R_near² − b²))/c.
210
+ const flatLegFar = Math.sqrt(R_far_m * R_far_m - b_m * b_m);
211
+ const flatLegNear = Math.sqrt(R_near_m * R_near_m - b_m * b_m);
212
+ const t_flat = (flatLegFar - flatLegNear) / c_SI;
213
+ const tauMax = t_flat * 1.5;
214
+ const snapshots = integrateGeodesicGL4(initialState, {
215
+ steps,
216
+ tauMax,
217
+ gInverseFn,
218
+ dgInverseFn,
219
+ domainMinRadius: r_s * 1.01,
220
+ });
221
+ // Find the first snapshot with r ≤ R_near_m and linearly interpolate t.
222
+ let t_geodesic;
223
+ for (let i = 1; i < snapshots.length; i++) {
224
+ const rPrev = snapshots[i - 1].x[1];
225
+ const rCurr = snapshots[i].x[1];
226
+ if (rPrev > R_near_m && rCurr <= R_near_m) {
227
+ const tPrev = snapshots[i - 1].x[0];
228
+ const tCurr = snapshots[i].x[0];
229
+ // Linear interpolation: alpha = (R_near - rPrev) / (rCurr - rPrev), in [0, 1].
230
+ const alpha = (R_near_m - rPrev) / (rCurr - rPrev);
231
+ t_geodesic = tPrev + alpha * (tCurr - tPrev);
232
+ break;
233
+ }
234
+ }
235
+ if (t_geodesic === undefined) {
236
+ const rFinal = snapshots[snapshots.length - 1].x[1];
237
+ throw new Error(`evaluateBE37CovariantEikonalNumerical: photon did not reach R_near=${R_near_m} within tauMax=${tauMax} s; final r=${rFinal}. Try increasing steps or tauMax.`);
238
+ }
239
+ const shapiroDelaySec = t_geodesic - t_flat;
77
240
  return { eikonalResidual, shapiroDelaySec };
78
241
  }
79
242
  //# sourceMappingURL=be37-covariant-eikonal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"be37-covariant-eikonal.js","sourceRo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AU,GAAG,MAAM,CAAC;IAE5C,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,CAAC;AAC9C,CAAC"}
@@ -15,11 +15,10 @@ import type { EngineTensor, TensorEngine } from './tensor-engine.js';
15
15
  import type { NestedArray } from './types.js';
16
16
  /**
17
17
  * Flatten a NestedArray to a plain number[] in row-major order.
18
- * Canonical implementation. `flattenNestedArray` in lowering.ts is NOT a
19
- * duplicate it delegates here and adds an expectedSize invariant check
20
- * (throws NumericalBackendError if the flattened count mismatches). This
21
- * function deliberately omits that check for callers that do not know the
22
- * expected count ahead of time.
18
+ * Canonical implementation for this module. `flattenNestedArray` in
19
+ * lowering.ts wraps this and adds an expectedSize invariant check.
20
+ * `pderiv.ts` previously had its own identical `flattenToNumbers`
21
+ * consolidated to this function in v0.4.6 (see Task 9 of the v0.4.6 plan).
23
22
  */
24
23
  export declare function flattenNA(data: NestedArray): number[];
25
24
  /**
@@ -97,7 +96,10 @@ export declare function computeChristoffelTensor(gInverseFlat: number[], getMetr
97
96
  export declare function contractChristoffelWithOperand(GammaFlat: number[], ofFlat: number[], ofShape: ReadonlyArray<number>, freeIdxPos: number, variance: 'upper' | 'lower', N: number, engine: TensorEngine): EngineTensor;
98
97
  /**
99
98
  * Look up ∂_{mu} g from inputs.metricDerivatives.
100
- * Key format: `${metricName}_${mu}` (e.g. 'g/μ_0' for ∂_0 g).
99
+ * Key format: `${metricName}/${coordLabel}_${mu}` (e.g. 'g/x_0' where
100
+ * 'x' is the coordLabel string and '0' is the mu index). The coordLabel
101
+ * is whatever string the caller passes — typically a coordinate label
102
+ * like 'x', 't', 'r'; the literal Greek letter μ is NOT used as a key.
101
103
  * Returns a flat [N*N] array.
102
104
  *
103
105
  * Strategy 'zero': returns [N*N] zeros.
@@ -1 +1 @@
1
- {"version":3,"file":"connection-lowering-helpers.d.ts","sourceRoot":"","sources":["../../src/numerical/connection-lowering-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,K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