universal-physics-tensor 10.0.0 → 11.0.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.
- package/README.md +4 -3
- package/bin/upt.mjs +13 -1
- package/data/atlas/atlas.json +25 -25
- package/data/atlas/atlas.jsonld +1 -1
- package/data/atlas/diffusion.json +6 -6
- package/data/atlas/oscillators.json +7 -7
- package/data/atlas/waves.json +14 -14
- package/data/atlas/witness-results.json +11 -11
- package/data/bridge-catalog.json +371 -228
- package/data/bridge-catalog.schema.json +45 -7
- package/dist/atlas/applicability.d.ts.map +1 -1
- package/dist/atlas/applicability.js +21 -15
- package/dist/atlas/applicability.js.map +1 -1
- package/dist/atlas/benchmark/hybrid-retrieval.d.ts +9 -1
- package/dist/atlas/benchmark/hybrid-retrieval.d.ts.map +1 -1
- package/dist/atlas/benchmark/hybrid-retrieval.js +15 -13
- package/dist/atlas/benchmark/hybrid-retrieval.js.map +1 -1
- package/dist/atlas/benchmark/loader.js +2 -2
- package/dist/atlas/benchmark/loader.js.map +1 -1
- package/dist/atlas/benchmark/stats.d.ts +2 -2
- package/dist/atlas/benchmark/stats.d.ts.map +1 -1
- package/dist/atlas/benchmark/stats.js +15 -7
- package/dist/atlas/benchmark/stats.js.map +1 -1
- package/dist/atlas/catalog-formal-ref.d.ts +26 -3
- package/dist/atlas/catalog-formal-ref.d.ts.map +1 -1
- package/dist/atlas/catalog-formal-ref.js +52 -5
- package/dist/atlas/catalog-formal-ref.js.map +1 -1
- package/dist/atlas/chain-pipeline.d.ts.map +1 -1
- package/dist/atlas/chain-pipeline.js +7 -8
- package/dist/atlas/chain-pipeline.js.map +1 -1
- package/dist/atlas/diffusion/bridges-closure.d.ts +0 -4
- package/dist/atlas/diffusion/bridges-closure.d.ts.map +1 -1
- package/dist/atlas/diffusion/bridges-closure.js +8 -12
- package/dist/atlas/diffusion/bridges-closure.js.map +1 -1
- package/dist/atlas/diffusion/bridges.d.ts.map +1 -1
- package/dist/atlas/diffusion/bridges.js +27 -39
- package/dist/atlas/diffusion/bridges.js.map +1 -1
- package/dist/atlas/diffusion/dimensions.d.ts +6 -14
- package/dist/atlas/diffusion/dimensions.d.ts.map +1 -1
- package/dist/atlas/diffusion/dimensions.js +8 -16
- package/dist/atlas/diffusion/dimensions.js.map +1 -1
- package/dist/atlas/diffusion/models.d.ts +3 -3
- package/dist/atlas/diffusion/models.d.ts.map +1 -1
- package/dist/atlas/diffusion/models.js +5 -10
- package/dist/atlas/diffusion/models.js.map +1 -1
- package/dist/atlas/diffusion/numerics.d.ts +16 -4
- package/dist/atlas/diffusion/numerics.d.ts.map +1 -1
- package/dist/atlas/diffusion/numerics.js +38 -24
- package/dist/atlas/diffusion/numerics.js.map +1 -1
- package/dist/atlas/link-prediction.d.ts +106 -3
- package/dist/atlas/link-prediction.d.ts.map +1 -1
- package/dist/atlas/link-prediction.js +212 -66
- package/dist/atlas/link-prediction.js.map +1 -1
- package/dist/atlas/oscillators/bridges-coarse.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-coarse.js +7 -11
- package/dist/atlas/oscillators/bridges-coarse.js.map +1 -1
- package/dist/atlas/oscillators/bridges-exact.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-exact.js +6 -7
- package/dist/atlas/oscillators/bridges-exact.js.map +1 -1
- package/dist/atlas/oscillators/bridges-limits.d.ts +3 -16
- package/dist/atlas/oscillators/bridges-limits.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-limits.js +23 -34
- package/dist/atlas/oscillators/bridges-limits.js.map +1 -1
- package/dist/atlas/oscillators/dimensions.d.ts +9 -21
- package/dist/atlas/oscillators/dimensions.d.ts.map +1 -1
- package/dist/atlas/oscillators/dimensions.js +9 -21
- package/dist/atlas/oscillators/dimensions.js.map +1 -1
- package/dist/atlas/oscillators/limit-witnesses.d.ts +2 -2
- package/dist/atlas/oscillators/limit-witnesses.d.ts.map +1 -1
- package/dist/atlas/oscillators/limit-witnesses.js +17 -15
- package/dist/atlas/oscillators/limit-witnesses.js.map +1 -1
- package/dist/atlas/oscillators/models.d.ts.map +1 -1
- package/dist/atlas/oscillators/models.js +2 -6
- package/dist/atlas/oscillators/models.js.map +1 -1
- package/dist/atlas/oscillators/pendulum-motion.d.ts +29 -6
- package/dist/atlas/oscillators/pendulum-motion.d.ts.map +1 -1
- package/dist/atlas/oscillators/pendulum-motion.js +60 -40
- package/dist/atlas/oscillators/pendulum-motion.js.map +1 -1
- package/dist/atlas/oscillators/phase-translation.d.ts +0 -11
- package/dist/atlas/oscillators/phase-translation.d.ts.map +1 -1
- package/dist/atlas/oscillators/phase-translation.js +3 -4
- package/dist/atlas/oscillators/phase-translation.js.map +1 -1
- package/dist/atlas/oscillators/position-translation.d.ts +68 -7
- package/dist/atlas/oscillators/position-translation.d.ts.map +1 -1
- package/dist/atlas/oscillators/position-translation.js +123 -12
- package/dist/atlas/oscillators/position-translation.js.map +1 -1
- package/dist/atlas/oscillators/rejections.d.ts +0 -2
- package/dist/atlas/oscillators/rejections.d.ts.map +1 -1
- package/dist/atlas/oscillators/rejections.js +0 -7
- package/dist/atlas/oscillators/rejections.js.map +1 -1
- package/dist/atlas/physjs-entries.generated.d.ts +25 -24
- package/dist/atlas/physjs-entries.generated.d.ts.map +1 -1
- package/dist/atlas/physjs-entries.generated.js +25 -24
- package/dist/atlas/physjs-entries.generated.js.map +1 -1
- package/dist/atlas/physjs-ref.d.ts +34 -31
- package/dist/atlas/physjs-ref.d.ts.map +1 -1
- package/dist/atlas/physjs-ref.js +55 -53
- package/dist/atlas/physjs-ref.js.map +1 -1
- package/dist/atlas/physjs-reviewed.d.ts +1 -1
- package/dist/atlas/physjs-reviewed.js +15 -15
- package/dist/atlas/physjs-reviewed.js.map +1 -1
- package/dist/atlas/poster/statements.d.ts +0 -19
- package/dist/atlas/poster/statements.d.ts.map +1 -1
- package/dist/atlas/poster/statements.js +1 -1
- package/dist/atlas/poster/statements.js.map +1 -1
- package/dist/atlas/proof-target.d.ts +1 -1
- package/dist/atlas/proof-target.js +1 -1
- package/dist/atlas/proof-target.js.map +1 -1
- package/dist/atlas/regime.d.ts +1 -1
- package/dist/atlas/regime.d.ts.map +1 -1
- package/dist/atlas/regime.js +1 -1
- package/dist/atlas/regime.js.map +1 -1
- package/dist/atlas/text-overlap.d.ts +23 -0
- package/dist/atlas/text-overlap.d.ts.map +1 -0
- package/dist/atlas/text-overlap.js +41 -0
- package/dist/atlas/text-overlap.js.map +1 -0
- package/dist/atlas/waves/bridges-closure.d.ts.map +1 -1
- package/dist/atlas/waves/bridges-closure.js +2 -6
- package/dist/atlas/waves/bridges-closure.js.map +1 -1
- package/dist/atlas/waves/bridges.d.ts.map +1 -1
- package/dist/atlas/waves/bridges.js +32 -48
- package/dist/atlas/waves/bridges.js.map +1 -1
- package/dist/atlas/waves/models.d.ts +5 -6
- package/dist/atlas/waves/models.d.ts.map +1 -1
- package/dist/atlas/waves/models.js +7 -13
- package/dist/atlas/waves/models.js.map +1 -1
- package/dist/atlas/waves/numerics.d.ts.map +1 -1
- package/dist/atlas/waves/numerics.js +10 -3
- package/dist/atlas/waves/numerics.js.map +1 -1
- package/dist/atlas/witness-numeric.d.ts +30 -0
- package/dist/atlas/witness-numeric.d.ts.map +1 -1
- package/dist/atlas/witness-numeric.js +53 -0
- package/dist/atlas/witness-numeric.js.map +1 -1
- package/dist/atlas/witness-specs.d.ts.map +1 -1
- package/dist/atlas/witness-specs.js +19 -0
- package/dist/atlas/witness-specs.js.map +1 -1
- package/dist/atlas/witness-symbolic.d.ts +75 -3
- package/dist/atlas/witness-symbolic.d.ts.map +1 -1
- package/dist/atlas/witness-symbolic.js +116 -10
- package/dist/atlas/witness-symbolic.js.map +1 -1
- package/dist/bridges/catalog-load.d.ts.map +1 -1
- package/dist/bridges/catalog-load.js +13 -8
- package/dist/bridges/catalog-load.js.map +1 -1
- package/dist/bridges/catalog-types.d.ts +26 -2
- package/dist/bridges/catalog-types.d.ts.map +1 -1
- package/dist/bridges/catalog-types.js +11 -1
- package/dist/bridges/catalog-types.js.map +1 -1
- package/dist/bridges/evaluation-errors.d.ts +31 -1
- package/dist/bridges/evaluation-errors.d.ts.map +1 -1
- package/dist/bridges/evaluation-errors.js +20 -2
- package/dist/bridges/evaluation-errors.js.map +1 -1
- package/dist/bridges/evaluator-inputs.d.ts.map +1 -1
- package/dist/bridges/evaluator-inputs.js +7 -5
- package/dist/bridges/evaluator-inputs.js.map +1 -1
- package/dist/bridges/evaluators.d.ts.map +1 -1
- package/dist/bridges/evaluators.js +27 -12
- package/dist/bridges/evaluators.js.map +1 -1
- package/dist/bridges/expr-parse.d.ts +11 -0
- package/dist/bridges/expr-parse.d.ts.map +1 -1
- package/dist/bridges/expr-parse.js +14 -5
- package/dist/bridges/expr-parse.js.map +1 -1
- package/dist/bridges/holds.d.ts +35 -3
- package/dist/bridges/holds.d.ts.map +1 -1
- package/dist/bridges/holds.js +117 -23
- package/dist/bridges/holds.js.map +1 -1
- package/dist/bridges/notices.d.ts.map +1 -1
- package/dist/bridges/notices.js +5 -5
- package/dist/bridges/notices.js.map +1 -1
- package/dist/bridges/relation-eval.d.ts +4 -4
- package/dist/bridges/relation-eval.d.ts.map +1 -1
- package/dist/bridges/relation-eval.js +15 -16
- package/dist/bridges/relation-eval.js.map +1 -1
- package/dist/bridges/sensitivity.d.ts.map +1 -1
- package/dist/bridges/sensitivity.js +3 -3
- package/dist/bridges/sensitivity.js.map +1 -1
- package/dist/bridges/validity.d.ts +33 -0
- package/dist/bridges/validity.d.ts.map +1 -0
- package/dist/bridges/validity.js +67 -0
- package/dist/bridges/validity.js.map +1 -0
- package/dist/canonical/entries/atomic.js +1 -3
- package/dist/canonical/entries/atomic.js.map +1 -1
- package/dist/canonical/entries/condensed-matter.d.ts.map +1 -1
- package/dist/canonical/entries/condensed-matter.js +4 -5
- package/dist/canonical/entries/condensed-matter.js.map +1 -1
- package/dist/canonical/entries/dimensional-classics.d.ts.map +1 -1
- package/dist/canonical/entries/dimensional-classics.js +3 -4
- package/dist/canonical/entries/dimensional-classics.js.map +1 -1
- package/dist/canonical/entries/electromagnetism.d.ts.map +1 -1
- package/dist/canonical/entries/electromagnetism.js +4 -10
- package/dist/canonical/entries/electromagnetism.js.map +1 -1
- package/dist/canonical/entries/fluids-waves.d.ts.map +1 -1
- package/dist/canonical/entries/fluids-waves.js +3 -7
- package/dist/canonical/entries/fluids-waves.js.map +1 -1
- package/dist/canonical/entries/mechanics.d.ts.map +1 -1
- package/dist/canonical/entries/mechanics.js +4 -6
- package/dist/canonical/entries/mechanics.js.map +1 -1
- package/dist/canonical/entries/nonmonomial.d.ts.map +1 -1
- package/dist/canonical/entries/nonmonomial.js +9 -17
- package/dist/canonical/entries/nonmonomial.js.map +1 -1
- package/dist/canonical/entries/relativity.d.ts.map +1 -1
- package/dist/canonical/entries/relativity.js +6 -6
- package/dist/canonical/entries/relativity.js.map +1 -1
- package/dist/canonical/entries/thermo-nuclear-cosmo.d.ts.map +1 -1
- package/dist/canonical/entries/thermo-nuclear-cosmo.js +6 -10
- package/dist/canonical/entries/thermo-nuclear-cosmo.js.map +1 -1
- package/dist/canonical/fixed-points.d.ts +94 -0
- package/dist/canonical/fixed-points.d.ts.map +1 -0
- package/dist/canonical/fixed-points.js +81 -0
- package/dist/canonical/fixed-points.js.map +1 -0
- package/dist/canonical/linkage.d.ts.map +1 -1
- package/dist/canonical/linkage.js +25 -44
- package/dist/canonical/linkage.js.map +1 -1
- package/dist/canonical/normal-form.d.ts.map +1 -1
- package/dist/canonical/normal-form.js +5 -11
- package/dist/canonical/normal-form.js.map +1 -1
- package/dist/canonical/structural.d.ts +21 -21
- package/dist/canonical/structural.d.ts.map +1 -1
- package/dist/canonical/structural.js +40 -19
- package/dist/canonical/structural.js.map +1 -1
- package/dist/cases/brownian-sphere.d.ts +3 -3
- package/dist/cases/brownian-sphere.d.ts.map +1 -1
- package/dist/cases/brownian-sphere.js +6 -5
- package/dist/cases/brownian-sphere.js.map +1 -1
- package/dist/cases/damped-resonator.d.ts.map +1 -1
- package/dist/cases/damped-resonator.js +6 -9
- package/dist/cases/damped-resonator.js.map +1 -1
- package/dist/cases/kepler-rv.d.ts +1 -1
- package/dist/cases/kepler-rv.d.ts.map +1 -1
- package/dist/cases/kepler-rv.js +3 -2
- package/dist/cases/kepler-rv.js.map +1 -1
- package/dist/cases/lumped-cooling.d.ts +8 -3
- package/dist/cases/lumped-cooling.d.ts.map +1 -1
- package/dist/cases/lumped-cooling.js +21 -23
- package/dist/cases/lumped-cooling.js.map +1 -1
- package/dist/cases/quadrature.d.ts +7 -9
- package/dist/cases/quadrature.d.ts.map +1 -1
- package/dist/cases/quadrature.js +28 -32
- package/dist/cases/quadrature.js.map +1 -1
- package/dist/cases/resistor-noise.js +4 -4
- package/dist/cases/resistor-noise.js.map +1 -1
- package/dist/cases/skin-depth.d.ts +0 -4
- package/dist/cases/skin-depth.d.ts.map +1 -1
- package/dist/cases/skin-depth.js +3 -7
- package/dist/cases/skin-depth.js.map +1 -1
- package/dist/cli/args.d.ts +23 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +30 -8
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/bindings.d.ts.map +1 -1
- package/dist/cli/bindings.js +5 -4
- package/dist/cli/bindings.js.map +1 -1
- package/dist/cli/command.d.ts +8 -1
- package/dist/cli/command.d.ts.map +1 -1
- package/dist/cli/command.js.map +1 -1
- package/dist/cli/commands/_atlas-map.d.ts +0 -9
- package/dist/cli/commands/_atlas-map.d.ts.map +1 -1
- package/dist/cli/commands/_atlas-map.js +8 -18
- package/dist/cli/commands/_atlas-map.js.map +1 -1
- package/dist/cli/commands/_atlas-route.d.ts.map +1 -1
- package/dist/cli/commands/_atlas-route.js +6 -2
- package/dist/cli/commands/_atlas-route.js.map +1 -1
- package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
- package/dist/cli/commands/_discovery-opts.js +8 -9
- package/dist/cli/commands/_discovery-opts.js.map +1 -1
- package/dist/cli/commands/atlas.d.ts.map +1 -1
- package/dist/cli/commands/atlas.js +8 -5
- package/dist/cli/commands/atlas.js.map +1 -1
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/audit.js +8 -1
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/cli/commands/axes.d.ts.map +1 -1
- package/dist/cli/commands/axes.js +20 -1
- package/dist/cli/commands/axes.js.map +1 -1
- package/dist/cli/commands/confront.d.ts.map +1 -1
- package/dist/cli/commands/confront.js +8 -14
- package/dist/cli/commands/confront.js.map +1 -1
- package/dist/cli/commands/derive.d.ts.map +1 -1
- package/dist/cli/commands/derive.js +22 -22
- package/dist/cli/commands/derive.js.map +1 -1
- package/dist/cli/commands/discover.d.ts.map +1 -1
- package/dist/cli/commands/discover.js +6 -2
- package/dist/cli/commands/discover.js.map +1 -1
- package/dist/cli/commands/eval.d.ts.map +1 -1
- package/dist/cli/commands/eval.js +1 -0
- package/dist/cli/commands/eval.js.map +1 -1
- package/dist/cli/commands/evaluate.d.ts.map +1 -1
- package/dist/cli/commands/evaluate.js +65 -37
- package/dist/cli/commands/evaluate.js.map +1 -1
- package/dist/cli/commands/explain.d.ts.map +1 -1
- package/dist/cli/commands/explain.js +2 -1
- package/dist/cli/commands/explain.js.map +1 -1
- package/dist/cli/commands/ground.d.ts.map +1 -1
- package/dist/cli/commands/ground.js +1 -0
- package/dist/cli/commands/ground.js.map +1 -1
- package/dist/cli/commands/map.d.ts.map +1 -1
- package/dist/cli/commands/map.js +75 -5
- package/dist/cli/commands/map.js.map +1 -1
- package/dist/cli/commands/metric.d.ts.map +1 -1
- package/dist/cli/commands/metric.js +12 -9
- package/dist/cli/commands/metric.js.map +1 -1
- package/dist/cli/commands/path.d.ts +10 -0
- package/dist/cli/commands/path.d.ts.map +1 -1
- package/dist/cli/commands/path.js +25 -3
- package/dist/cli/commands/path.js.map +1 -1
- package/dist/cli/commands/probe.d.ts.map +1 -1
- package/dist/cli/commands/probe.js +59 -16
- package/dist/cli/commands/probe.js.map +1 -1
- package/dist/cli/commands/regime.d.ts.map +1 -1
- package/dist/cli/commands/regime.js +1 -0
- package/dist/cli/commands/regime.js.map +1 -1
- package/dist/cli/commands/retrieve.d.ts.map +1 -1
- package/dist/cli/commands/retrieve.js +1 -0
- package/dist/cli/commands/retrieve.js.map +1 -1
- package/dist/cli/commands/search.d.ts.map +1 -1
- package/dist/cli/commands/search.js +1 -0
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/symbolic.d.ts.map +1 -1
- package/dist/cli/commands/symbolic.js +19 -28
- package/dist/cli/commands/symbolic.js.map +1 -1
- package/dist/cli/commands/testplan.d.ts.map +1 -1
- package/dist/cli/commands/testplan.js +4 -2
- package/dist/cli/commands/testplan.js.map +1 -1
- package/dist/cli/expr-print.d.ts +0 -2
- package/dist/cli/expr-print.d.ts.map +1 -1
- package/dist/cli/expr-print.js +7 -31
- package/dist/cli/expr-print.js.map +1 -1
- package/dist/cli/main.d.ts +7 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +18 -3
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/numeric-flag.d.ts +12 -0
- package/dist/cli/numeric-flag.d.ts.map +1 -0
- package/dist/cli/numeric-flag.js +44 -0
- package/dist/cli/numeric-flag.js.map +1 -0
- package/dist/cli/output.d.ts +20 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +15 -0
- package/dist/cli/output.js.map +1 -1
- package/dist/cli/record-reach.js +2 -2
- package/dist/cli/record-reach.js.map +1 -1
- package/dist/cli/record-tables.d.ts.map +1 -1
- package/dist/cli/record-tables.js +6 -5
- package/dist/cli/record-tables.js.map +1 -1
- package/dist/cli/record.d.ts +1 -5
- package/dist/cli/record.d.ts.map +1 -1
- package/dist/cli/record.js +9 -8
- package/dist/cli/record.js.map +1 -1
- package/dist/cli/search-index.d.ts.map +1 -1
- package/dist/cli/search-index.js +7 -6
- package/dist/cli/search-index.js.map +1 -1
- package/dist/cli/statuses.d.ts +0 -2
- package/dist/cli/statuses.d.ts.map +1 -1
- package/dist/cli/statuses.js +0 -7
- package/dist/cli/statuses.js.map +1 -1
- package/dist/cli/stored-results.d.ts +7 -0
- package/dist/cli/stored-results.d.ts.map +1 -0
- package/dist/cli/stored-results.js +23 -0
- package/dist/cli/stored-results.js.map +1 -0
- package/dist/cli/version.d.ts.map +1 -1
- package/dist/cli/version.js +7 -5
- package/dist/cli/version.js.map +1 -1
- package/dist/cli-api.d.ts +34 -5
- package/dist/cli-api.d.ts.map +1 -1
- package/dist/cli-api.js +28 -4
- package/dist/cli-api.js.map +1 -1
- package/dist/composition/algebraic-equivalence.d.ts +43 -0
- package/dist/composition/algebraic-equivalence.d.ts.map +1 -0
- package/dist/composition/algebraic-equivalence.js +115 -0
- package/dist/composition/algebraic-equivalence.js.map +1 -0
- package/dist/composition/axes.d.ts +0 -6
- package/dist/composition/axes.d.ts.map +1 -1
- package/dist/composition/axes.js +6 -6
- package/dist/composition/axes.js.map +1 -1
- package/dist/composition/axis-audit.d.ts +47 -20
- package/dist/composition/axis-audit.d.ts.map +1 -1
- package/dist/composition/axis-audit.js +82 -9
- package/dist/composition/axis-audit.js.map +1 -1
- package/dist/composition/bridge-analysis.d.ts +17 -0
- package/dist/composition/bridge-analysis.d.ts.map +1 -1
- package/dist/composition/bridge-analysis.js +102 -55
- package/dist/composition/bridge-analysis.js.map +1 -1
- package/dist/composition/canonical-compare.d.ts +40 -0
- package/dist/composition/canonical-compare.d.ts.map +1 -1
- package/dist/composition/canonical-compare.js +122 -24
- package/dist/composition/canonical-compare.js.map +1 -1
- package/dist/composition/canonical-graph.d.ts +1 -1
- package/dist/composition/canonical-graph.d.ts.map +1 -1
- package/dist/composition/canonical-graph.js +9 -36
- package/dist/composition/canonical-graph.js.map +1 -1
- package/dist/composition/canonical-json.js +2 -2
- package/dist/composition/canonical-json.js.map +1 -1
- package/dist/composition/catalog-graph.d.ts.map +1 -1
- package/dist/composition/catalog-graph.js +2 -5
- package/dist/composition/catalog-graph.js.map +1 -1
- package/dist/composition/chain-candidate.d.ts +8 -0
- package/dist/composition/chain-candidate.d.ts.map +1 -1
- package/dist/composition/chain-candidate.js +9 -2
- package/dist/composition/chain-candidate.js.map +1 -1
- package/dist/composition/chain-match.d.ts +6 -3
- package/dist/composition/chain-match.d.ts.map +1 -1
- package/dist/composition/chain-match.js +4 -1
- package/dist/composition/chain-match.js.map +1 -1
- package/dist/composition/chain-result.d.ts.map +1 -1
- package/dist/composition/chain-result.js +2 -14
- package/dist/composition/chain-result.js.map +1 -1
- package/dist/composition/compose-symbolic.d.ts.map +1 -1
- package/dist/composition/compose-symbolic.js +3 -2
- package/dist/composition/compose-symbolic.js.map +1 -1
- package/dist/composition/compose.d.ts.map +1 -1
- package/dist/composition/compose.js +13 -5
- package/dist/composition/compose.js.map +1 -1
- package/dist/composition/composition-recovery.d.ts.map +1 -1
- package/dist/composition/composition-recovery.js +4 -7
- package/dist/composition/composition-recovery.js.map +1 -1
- package/dist/composition/discovery.d.ts +56 -0
- package/dist/composition/discovery.d.ts.map +1 -1
- package/dist/composition/discovery.js +114 -60
- package/dist/composition/discovery.js.map +1 -1
- package/dist/composition/edge.d.ts +21 -2
- package/dist/composition/edge.d.ts.map +1 -1
- package/dist/composition/edge.js +23 -1
- package/dist/composition/edge.js.map +1 -1
- package/dist/composition/enumerate.d.ts.map +1 -1
- package/dist/composition/enumerate.js +18 -3
- package/dist/composition/enumerate.js.map +1 -1
- package/dist/composition/evaluate-relation.d.ts +35 -11
- package/dist/composition/evaluate-relation.d.ts.map +1 -1
- package/dist/composition/evaluate-relation.js +60 -39
- package/dist/composition/evaluate-relation.js.map +1 -1
- package/dist/composition/explain.d.ts +3 -12
- package/dist/composition/explain.d.ts.map +1 -1
- package/dist/composition/explain.js +7 -20
- package/dist/composition/explain.js.map +1 -1
- package/dist/composition/expr-eval.d.ts.map +1 -1
- package/dist/composition/expr-eval.js +2 -11
- package/dist/composition/expr-eval.js.map +1 -1
- package/dist/composition/expr-simplify.d.ts +16 -0
- package/dist/composition/expr-simplify.d.ts.map +1 -1
- package/dist/composition/expr-simplify.js +15 -20
- package/dist/composition/expr-simplify.js.map +1 -1
- package/dist/composition/formula-shape.d.ts +23 -4
- package/dist/composition/formula-shape.d.ts.map +1 -1
- package/dist/composition/formula-shape.js +57 -17
- package/dist/composition/formula-shape.js.map +1 -1
- package/dist/composition/graph-structure.d.ts +98 -0
- package/dist/composition/graph-structure.d.ts.map +1 -0
- package/dist/composition/graph-structure.js +167 -0
- package/dist/composition/graph-structure.js.map +1 -0
- package/dist/composition/graph-viz-svg.d.ts.map +1 -1
- package/dist/composition/graph-viz-svg.js +1 -1
- package/dist/composition/graph-viz-svg.js.map +1 -1
- package/dist/composition/graph-viz.d.ts.map +1 -1
- package/dist/composition/graph-viz.js +8 -37
- package/dist/composition/graph-viz.js.map +1 -1
- package/dist/composition/identifiability.d.ts +91 -4
- package/dist/composition/identifiability.d.ts.map +1 -1
- package/dist/composition/identifiability.js +363 -6
- package/dist/composition/identifiability.js.map +1 -1
- package/dist/composition/index.d.ts +8 -4
- package/dist/composition/index.d.ts.map +1 -1
- package/dist/composition/index.js +3 -2
- package/dist/composition/index.js.map +1 -1
- package/dist/composition/mathts-quiet.d.ts +4 -3
- package/dist/composition/mathts-quiet.d.ts.map +1 -1
- package/dist/composition/mathts-quiet.js +4 -3
- package/dist/composition/mathts-quiet.js.map +1 -1
- package/dist/composition/mathts-scalar-symbols.d.ts.map +1 -1
- package/dist/composition/mathts-scalar-symbols.js +2 -1
- package/dist/composition/mathts-scalar-symbols.js.map +1 -1
- package/dist/composition/probe/corpus.d.ts +4 -2
- package/dist/composition/probe/corpus.d.ts.map +1 -1
- package/dist/composition/probe/corpus.js +20 -9
- package/dist/composition/probe/corpus.js.map +1 -1
- package/dist/composition/probe/dataset.d.ts +17 -0
- package/dist/composition/probe/dataset.d.ts.map +1 -1
- package/dist/composition/probe/dataset.js +95 -50
- package/dist/composition/probe/dataset.js.map +1 -1
- package/dist/composition/probe/experiment-design.d.ts +5 -1
- package/dist/composition/probe/experiment-design.d.ts.map +1 -1
- package/dist/composition/probe/experiment-design.js +44 -24
- package/dist/composition/probe/experiment-design.js.map +1 -1
- package/dist/composition/probe/falsify.d.ts.map +1 -1
- package/dist/composition/probe/falsify.js +2 -0
- package/dist/composition/probe/falsify.js.map +1 -1
- package/dist/composition/probe/fit.d.ts +6 -0
- package/dist/composition/probe/fit.d.ts.map +1 -1
- package/dist/composition/probe/fit.js +46 -22
- package/dist/composition/probe/fit.js.map +1 -1
- package/dist/composition/probe/frontier.d.ts.map +1 -1
- package/dist/composition/probe/frontier.js +33 -15
- package/dist/composition/probe/frontier.js.map +1 -1
- package/dist/composition/probe/generator.d.ts +27 -1
- package/dist/composition/probe/generator.d.ts.map +1 -1
- package/dist/composition/probe/generator.js +53 -30
- package/dist/composition/probe/generator.js.map +1 -1
- package/dist/composition/probe/index.d.ts +14 -0
- package/dist/composition/probe/index.d.ts.map +1 -1
- package/dist/composition/probe/index.js +6 -0
- package/dist/composition/probe/index.js.map +1 -1
- package/dist/composition/probe/limits.d.ts +24 -1
- package/dist/composition/probe/limits.d.ts.map +1 -1
- package/dist/composition/probe/limits.js +53 -11
- package/dist/composition/probe/limits.js.map +1 -1
- package/dist/composition/probe/pipeline.d.ts.map +1 -1
- package/dist/composition/probe/pipeline.js +10 -4
- package/dist/composition/probe/pipeline.js.map +1 -1
- package/dist/composition/probe/power-law.d.ts +121 -0
- package/dist/composition/probe/power-law.d.ts.map +1 -0
- package/dist/composition/probe/power-law.js +255 -0
- package/dist/composition/probe/power-law.js.map +1 -0
- package/dist/composition/probe/problem.d.ts +7 -4
- package/dist/composition/probe/problem.d.ts.map +1 -1
- package/dist/composition/probe/problem.js +177 -49
- package/dist/composition/probe/problem.js.map +1 -1
- package/dist/composition/probe/report.js +1 -1
- package/dist/composition/probe/report.js.map +1 -1
- package/dist/composition/probe/residual.d.ts +6 -1
- package/dist/composition/probe/residual.d.ts.map +1 -1
- package/dist/composition/probe/residual.js +9 -7
- package/dist/composition/probe/residual.js.map +1 -1
- package/dist/composition/probe/structure.d.ts +82 -17
- package/dist/composition/probe/structure.d.ts.map +1 -1
- package/dist/composition/probe/structure.js +129 -55
- package/dist/composition/probe/structure.js.map +1 -1
- package/dist/composition/probe/study.d.ts +31 -9
- package/dist/composition/probe/study.d.ts.map +1 -1
- package/dist/composition/probe/study.js +236 -181
- package/dist/composition/probe/study.js.map +1 -1
- package/dist/composition/probe/t-tail.d.ts +17 -0
- package/dist/composition/probe/t-tail.d.ts.map +1 -0
- package/dist/composition/probe/t-tail.js +32 -0
- package/dist/composition/probe/t-tail.js.map +1 -0
- package/dist/composition/probe/types.d.ts +3 -0
- package/dist/composition/probe/types.d.ts.map +1 -1
- package/dist/composition/probe/types.js.map +1 -1
- package/dist/composition/proposed-bridges.d.ts +41 -10
- package/dist/composition/proposed-bridges.d.ts.map +1 -1
- package/dist/composition/proposed-bridges.js +100 -55
- package/dist/composition/proposed-bridges.js.map +1 -1
- package/dist/composition/quantity-clusters.d.ts +48 -0
- package/dist/composition/quantity-clusters.d.ts.map +1 -0
- package/dist/composition/quantity-clusters.js +98 -0
- package/dist/composition/quantity-clusters.js.map +1 -0
- package/dist/composition/rational-exponent.d.ts +40 -0
- package/dist/composition/rational-exponent.d.ts.map +1 -0
- package/dist/composition/rational-exponent.js +65 -0
- package/dist/composition/rational-exponent.js.map +1 -0
- package/dist/composition/representative-values.d.ts +22 -0
- package/dist/composition/representative-values.d.ts.map +1 -1
- package/dist/composition/representative-values.js +23 -0
- package/dist/composition/representative-values.js.map +1 -1
- package/dist/composition/retrodiction.d.ts.map +1 -1
- package/dist/composition/retrodiction.js +2 -1
- package/dist/composition/retrodiction.js.map +1 -1
- package/dist/composition/user-equation.d.ts.map +1 -1
- package/dist/composition/user-equation.js +2 -2
- package/dist/composition/user-equation.js.map +1 -1
- package/dist/core/assignment.d.ts +19 -0
- package/dist/core/assignment.d.ts.map +1 -0
- package/dist/core/assignment.js +19 -0
- package/dist/core/assignment.js.map +1 -0
- package/dist/core/compare.d.ts +32 -0
- package/dist/core/compare.d.ts.map +1 -0
- package/dist/core/compare.js +46 -0
- package/dist/core/compare.js.map +1 -0
- package/dist/core/constants.d.ts +30 -30
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +47 -30
- package/dist/core/constants.js.map +1 -1
- package/dist/core/data-file.d.ts +7 -0
- package/dist/core/data-file.d.ts.map +1 -1
- package/dist/core/data-file.js +17 -0
- package/dist/core/data-file.js.map +1 -1
- package/dist/core/format.d.ts +36 -0
- package/dist/core/format.d.ts.map +1 -0
- package/dist/core/format.js +39 -0
- package/dist/core/format.js.map +1 -0
- package/dist/core/hash.d.ts +14 -0
- package/dist/core/hash.d.ts.map +1 -0
- package/dist/core/hash.js +17 -0
- package/dist/core/hash.js.map +1 -0
- package/dist/core/json-schema.d.ts +2 -0
- package/dist/core/json-schema.d.ts.map +1 -1
- package/dist/core/json-schema.js +14 -13
- package/dist/core/json-schema.js.map +1 -1
- package/dist/core/labeled-tensor.d.ts.map +1 -1
- package/dist/core/labeled-tensor.js +0 -8
- package/dist/core/labeled-tensor.js.map +1 -1
- package/dist/core/mathts-read.d.ts +25 -0
- package/dist/core/mathts-read.d.ts.map +1 -0
- package/dist/core/mathts-read.js +51 -0
- package/dist/core/mathts-read.js.map +1 -0
- package/dist/core/tensor.d.ts.map +1 -1
- package/dist/core/tensor.js +24 -0
- package/dist/core/tensor.js.map +1 -1
- package/dist/core/types.d.ts +5 -5
- package/dist/diff/bridge-gradient.d.ts +19 -6
- package/dist/diff/bridge-gradient.d.ts.map +1 -1
- package/dist/diff/bridge-gradient.js +19 -11
- package/dist/diff/bridge-gradient.js.map +1 -1
- package/dist/diff/bridge-specs.d.ts.map +1 -1
- package/dist/diff/bridge-specs.js +3 -0
- package/dist/diff/bridge-specs.js.map +1 -1
- package/dist/dimensional/algebra.d.ts +18 -0
- package/dist/dimensional/algebra.d.ts.map +1 -1
- package/dist/dimensional/algebra.js +41 -1
- package/dist/dimensional/algebra.js.map +1 -1
- package/dist/dimensional/ast-builders.d.ts +7 -0
- package/dist/dimensional/ast-builders.d.ts.map +1 -1
- package/dist/dimensional/ast-builders.js +11 -0
- package/dist/dimensional/ast-builders.js.map +1 -1
- package/dist/dimensional/ast-leaves.d.ts +81 -0
- package/dist/dimensional/ast-leaves.d.ts.map +1 -0
- package/dist/dimensional/ast-leaves.js +146 -0
- package/dist/dimensional/ast-leaves.js.map +1 -0
- package/dist/dimensional/buckingham.d.ts.map +1 -1
- package/dist/dimensional/buckingham.js +15 -27
- package/dist/dimensional/buckingham.js.map +1 -1
- package/dist/dimensional/constant-rows.js +9 -9
- package/dist/dimensional/constant-rows.js.map +1 -1
- package/dist/dimensional/dimension-inference.d.ts.map +1 -1
- package/dist/dimensional/dimension-inference.js +1 -2
- package/dist/dimensional/dimension-inference.js.map +1 -1
- package/dist/dimensional/errors.d.ts +1 -1
- package/dist/dimensional/errors.d.ts.map +1 -1
- package/dist/dimensional/errors.js +1 -15
- package/dist/dimensional/errors.js.map +1 -1
- package/dist/dimensional/exact-scale.d.ts +0 -17
- package/dist/dimensional/exact-scale.d.ts.map +1 -1
- package/dist/dimensional/exact-scale.js +8 -8
- package/dist/dimensional/exact-scale.js.map +1 -1
- package/dist/dimensional/gauge-field.d.ts.map +1 -1
- package/dist/dimensional/gauge-field.js +2 -2
- package/dist/dimensional/gauge-field.js.map +1 -1
- package/dist/dimensional/hyphen-names.d.ts +12 -2
- package/dist/dimensional/hyphen-names.d.ts.map +1 -1
- package/dist/dimensional/hyphen-names.js +44 -19
- package/dist/dimensional/hyphen-names.js.map +1 -1
- package/dist/dimensional/metric.d.ts.map +1 -1
- package/dist/dimensional/metric.js +0 -1
- package/dist/dimensional/metric.js.map +1 -1
- package/dist/dimensional/symbolic-constants.d.ts +9 -0
- package/dist/dimensional/symbolic-constants.d.ts.map +1 -1
- package/dist/dimensional/symbolic-constants.js +13 -1
- package/dist/dimensional/symbolic-constants.js.map +1 -1
- package/dist/dimensional/types.d.ts +36 -0
- package/dist/dimensional/types.d.ts.map +1 -1
- package/dist/dimensional/types.js +45 -7
- package/dist/dimensional/types.js.map +1 -1
- package/dist/dimensional/unit-data.js +2 -2
- package/dist/dimensional/unit-data.js.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/numerical/christoffel-flat.d.ts.map +1 -1
- package/dist/numerical/christoffel-flat.js +3 -2
- package/dist/numerical/christoffel-flat.js.map +1 -1
- package/dist/numerical/covariant-eikonal.d.ts.map +1 -1
- package/dist/numerical/covariant-eikonal.js +34 -11
- package/dist/numerical/covariant-eikonal.js.map +1 -1
- package/dist/numerical/curvature-lowering-helpers.js +3 -2
- package/dist/numerical/curvature-lowering-helpers.js.map +1 -1
- package/dist/numerical/errors.d.ts.map +1 -1
- package/dist/numerical/errors.js +0 -3
- package/dist/numerical/errors.js.map +1 -1
- package/dist/numerical/finite-difference.d.ts +22 -0
- package/dist/numerical/finite-difference.d.ts.map +1 -0
- package/dist/numerical/finite-difference.js +27 -0
- package/dist/numerical/finite-difference.js.map +1 -0
- package/dist/numerical/geodesic-integrator.d.ts.map +1 -1
- package/dist/numerical/geodesic-integrator.js +22 -14
- package/dist/numerical/geodesic-integrator.js.map +1 -1
- package/dist/numerical/geometrized.d.ts.map +1 -1
- package/dist/numerical/geometrized.js +0 -1
- package/dist/numerical/geometrized.js.map +1 -1
- package/dist/numerical/mathts-engine.d.ts.map +1 -1
- package/dist/numerical/mathts-engine.js +10 -24
- package/dist/numerical/mathts-engine.js.map +1 -1
- package/dist/numerical/metric-inverse.d.ts.map +1 -1
- package/dist/numerical/metric-inverse.js +83 -46
- package/dist/numerical/metric-inverse.js.map +1 -1
- package/dist/numerical/null-ray-integrator.d.ts +2 -1
- package/dist/numerical/null-ray-integrator.d.ts.map +1 -1
- package/dist/numerical/null-ray-integrator.js +12 -12
- package/dist/numerical/null-ray-integrator.js.map +1 -1
- package/dist/numerical/painleve-gullstrand-metric.js +2 -2
- package/dist/numerical/painleve-gullstrand-metric.js.map +1 -1
- package/dist/numerical/perihelion-finder.d.ts +0 -36
- package/dist/numerical/perihelion-finder.d.ts.map +1 -1
- package/dist/numerical/perihelion-finder.js +41 -87
- package/dist/numerical/perihelion-finder.js.map +1 -1
- package/dist/numerical/quadrature.d.ts.map +1 -1
- package/dist/numerical/quadrature.js +8 -10
- package/dist/numerical/quadrature.js.map +1 -1
- package/dist/numerical/rk4-trajectory.d.ts +10 -0
- package/dist/numerical/rk4-trajectory.d.ts.map +1 -0
- package/dist/numerical/rk4-trajectory.js +37 -0
- package/dist/numerical/rk4-trajectory.js.map +1 -0
- package/dist/numerical/schwarzschild.d.ts +14 -0
- package/dist/numerical/schwarzschild.d.ts.map +1 -0
- package/dist/numerical/schwarzschild.js +17 -0
- package/dist/numerical/schwarzschild.js.map +1 -0
- package/dist/numerical/spacetime-metrics.d.ts +12 -0
- package/dist/numerical/spacetime-metrics.d.ts.map +1 -1
- package/dist/numerical/spacetime-metrics.js +72 -56
- package/dist/numerical/spacetime-metrics.js.map +1 -1
- package/dist/numerical/statistics.d.ts +24 -0
- package/dist/numerical/statistics.d.ts.map +1 -0
- package/dist/numerical/statistics.js +52 -0
- package/dist/numerical/statistics.js.map +1 -0
- package/dist/numerical/tensor-engine.d.ts +21 -0
- package/dist/numerical/tensor-engine.d.ts.map +1 -1
- package/dist/numerical/tensor-engine.js +12 -0
- package/dist/numerical/tensor-engine.js.map +1 -1
- package/dist/relations/regime.d.ts +10 -0
- package/dist/relations/regime.d.ts.map +1 -1
- package/dist/relations/regime.js +18 -1
- package/dist/relations/regime.js.map +1 -1
- package/package.json +7 -7
package/dist/core/tensor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tensor.js","sourceRoot":"","sources":["../../src/core/tensor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAkBH,OAA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I,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;YACrD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,CAAC,CAAC,SAAS,KAAK,SAAS,IAAI,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS,EAAE,CAAC;YAC7D,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,CAAC,CAAC,QAAQ,KAAK,SAAS,IAAI,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;YAC1D,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,OAAO,CACrB,IAA4B,EAC5B,OAAkC,EAClC,UAAwC,EACxC,MAAoB;IAEpB,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;IAC3C,KAAK,MAAM,GAAG,IAAI,IAAI;QAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5C,KAAK,MAAM,MAAM,IAAI,OAAO;QAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,KAAK,MAAM,SAAS,IAAI,UAAU;QAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC9D,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * Universal Physics Tensor\n *\n * Core implementation of the rank-N tensor living in product space:\n * Π ∈ H_scale ⊗ H_force ⊗ H_symmetry ⊗ H_info ⊗ H_dim ⊗ H_topo\n *\n * Decomposition: Π = L + B + E\n * Where:\n * - L: Known laws (diagonal elements)\n * - B: Bridge equations (off-diagonal elements)\n * - E: Emergent phenomena (higher-order correlations)\n */\n\nimport type {\n TensorConfig,\n TensorIndices,\n PhysicalLaw,\n BridgeEquation,\n EmergentPhenomenon,\n PhysicalScale,\n Force,\n} from './types.js';\nimport type {\n Cell,\n CellConfidence,\n LawCell,\n BridgeCell,\n EmergenceCell,\n} from './cell.js';\nimport { lawToCell, bridgeToCell, emergenceToCell } from './cell.js';\nimport type { FluxRule, FluxReport, FluxDiagnostic } from './flux-rules.js';\nimport { runRules, V07_CELL_RULES, FluxViolationError } from './flux-rules.js';\n\n/**\n * The entry an `addCell` call is about to replace, held so a flux-rule\n * failure can put it back (fail-atomic on a replacement, not only on a\n * fresh id).\n */\ntype PreviousEntry =\n | { readonly kind: 'law'; readonly law: PhysicalLaw }\n | { readonly kind: 'bridge'; readonly bridge: BridgeEquation }\n | { readonly kind: 'emergence'; readonly phenomenon: EmergentPhenomenon };\n\n/**\n * Map the string-vocabulary {@link CellConfidence} to a representative\n * numeric value in [0,1] for the legacy `addLaw` / `addBridge` /\n * `addEmergence` path (each validates `confidence >= 0 && <= 1`).\n *\n * Internal-only — consumers see the string vocabulary on `Cell`. The\n * numeric value is a storage detail, not a public-API contract. Per\n * Adam+Eve Eve-R3, this is the REVERSE direction of the (rejected)\n * `confidenceToStatus` adapter: that one was rejected because it\n * could overwrite curated catalog `status` fields with derived labels.\n * This one is safe because the caller has already declared their\n * string intent; the function just picks a representative number for\n * the legacy path's range check.\n *\n * @internal\n */\nfunction statusToConfidenceNumber(c: CellConfidence): number {\n switch (c) {\n case 'established': return 0.95;\n case 'speculative': return 0.6;\n case 'highly-speculative': return 0.3;\n default: {\n const _exhaustive: never = c;\n void _exhaustive;\n throw new Error(`Unknown CellConfidence: ${c as string}`);\n }\n }\n}\n\n/**\n * Adapter: `LawCell` → `PhysicalLaw` (legacy shape). Internal-only.\n * @internal\n */\nfunction cellToLaw(cell: LawCell): PhysicalLaw {\n return {\n id: cell.id,\n name: cell.name,\n equation: cell.equation,\n scales: [...cell.scales],\n forces: [...cell.forces],\n symmetries: [...cell.symmetries],\n confidence: statusToConfidenceNumber(cell.confidence),\n ...(cell.informationMeasures ? { informationMeasures: [...cell.informationMeasures] } : {}),\n ...(cell.dimensions ? { dimensions: [...cell.dimensions] } : {}),\n ...(cell.topologies ? { topologies: [...cell.topologies] } : {}),\n ...(cell.references ? { references: [...cell.references] } : {}),\n };\n}\n\n/**\n * Adapter: `BridgeCell` → `BridgeEquation` (legacy shape). Internal-only.\n * @internal\n */\nfunction cellToBridge(cell: BridgeCell): BridgeEquation {\n return {\n id: cell.id,\n name: cell.name,\n source: cell.source,\n target: cell.target,\n equation: cell.equation,\n confidence: statusToConfidenceNumber(cell.confidence),\n validated: cell.validated,\n description: cell.description,\n };\n}\n\n/**\n * Adapter: `EmergenceCell` → `EmergentPhenomenon` (legacy shape).\n * Maps `cell.equation` to `EmergentPhenomenon.description` (the legacy\n * interface uses `description` for the mathematical content); a\n * separate `cell.description` (prose context) is appended if present.\n * @internal\n */\nfunction cellToEmergence(cell: EmergenceCell): EmergentPhenomenon {\n const description = cell.description\n ? `${cell.equation}\\n\\n${cell.description}`\n : cell.equation;\n return {\n id: cell.id,\n name: cell.name,\n order: cell.order,\n indices: [...cell.indices],\n description,\n confidence: statusToConfidenceNumber(cell.confidence),\n };\n}\n\n/**\n * The rank-6 universal physics tensor Π = L + B + E: a sparse store of\n * physical-law / bridge / emergence cells indexed by regime coordinates.\n *\n * @public\n */\nexport class UniversalTensor {\n private readonly config: Required<TensorConfig>;\n private readonly knownLaws: Map<string, PhysicalLaw>;\n private readonly bridgeEquations: Map<string, BridgeEquation>;\n private readonly emergentPhenomena: Map<string, EmergentPhenomenon>;\n\n /**\n * Sparse tensor storage: only store non-zero elements.\n * Key: serialized tensor indices\n * Value: set of equation IDs occupying that cell (multiple laws/bridges\n * may coexist in a single tensor cell without overwriting each other).\n */\n private readonly tensorData: Map<string, Set<string>>;\n\n /**\n * v0.7-p2 Phase 2 Task 2.3: Rule set used by `addCell` (ERROR-tier\n * violations throw) and by `fluxDiagnostics()` (re-runs across all\n * populated cells). Default = `V07_CELL_RULES` (Rule 2 + Rule 3\n * from `flux-rules.ts`). Rule 1 (dimensional consistency) fires\n * from the catalog adapter (Phase 3), not from `addCell`.\n *\n * Per Decision #9, this field is `@internal`. No public mutator\n * is exposed in v0.7 (rule customization is a v0.8+ concern).\n */\n private readonly fluxRules: ReadonlyArray<FluxRule>;\n\n constructor(config: TensorConfig) {\n // Runtime validation (strict TS catches these at compile time, but JS\n // consumers bypass the type system — we validate defensively here).\n if (![3, 4, 5, 6].includes(config.rank)) {\n throw new RangeError(`TensorConfig.rank must be 3, 4, 5, or 6; got ${config.rank}`);\n }\n if (!Array.isArray(config.scales) || config.scales.length === 0) {\n throw new TypeError('TensorConfig.scales must be a non-empty array');\n }\n if (!Array.isArray(config.forces) || config.forces.length === 0) {\n throw new TypeError('TensorConfig.forces must be a non-empty array');\n }\n\n // Apply defaults\n this.config = {\n rank: config.rank,\n scales: config.scales,\n forces: config.forces,\n symmetries: config.symmetries && config.symmetries.length > 0\n ? config.symmetries\n : ['poincare', 'gauge'],\n informationMeasures: config.informationMeasures && config.informationMeasures.length > 0\n ? config.informationMeasures\n : ['vonNeumann', 'shannon'],\n sparse: config.sparse ?? true,\n };\n\n this.knownLaws = new Map();\n this.bridgeEquations = new Map();\n this.emergentPhenomena = new Map();\n this.tensorData = new Map();\n this.fluxRules = V07_CELL_RULES;\n }\n\n /**\n * Add a known physical law to the tensor.\n * Returns true if newly added, false if it replaced an existing law with the same id.\n * If replacing, stale cell entries from the previous law are removed first.\n */\n public addLaw(law: PhysicalLaw): boolean {\n this.validateId(law.id, 'PhysicalLaw');\n if (!(law.confidence >= 0 && law.confidence <= 1)) {\n throw new RangeError(`PhysicalLaw.confidence must be in [0,1]; got ${law.confidence}`);\n }\n this.validateAxisMembership(law.scales, 'scales', this.config.scales);\n this.validateAxisMembership(law.forces, 'forces', this.config.forces);\n this.validateAxisMembership(law.symmetries, 'symmetries', this.config.symmetries);\n this.validateAxisMembership(\n law.informationMeasures,\n 'informationMeasures',\n this.config.informationMeasures\n );\n this.validateFiniteIntegerArray(law.dimensions, 'dimensions');\n this.validateFiniteIntegerArray(law.topologies, 'topologies');\n const previous = this.knownLaws.get(law.id);\n if (previous) {\n // Remove stale cell entries from the prior version before writing new ones.\n for (const scale of previous.scales) {\n for (const force of previous.forces) {\n this.removeFromCell(this.serializeIndices({ scale, force }), law.id);\n }\n }\n }\n this.knownLaws.set(law.id, law);\n\n // Store in diagonal elements for all scale/force combinations.\n // Multiple laws may occupy the same cell; we accumulate rather than overwrite.\n for (const scale of law.scales) {\n for (const force of law.forces) {\n const key = this.serializeIndices({ scale, force });\n this.addToCell(key, law.id);\n }\n }\n return previous === undefined;\n }\n\n /**\n * Add a bridge equation connecting regimes.\n * Returns true if newly added, false if it replaced an existing bridge with the same id.\n * If replacing, stale cell entries from the previous bridge are removed first.\n */\n public addBridge(bridge: BridgeEquation): boolean {\n this.validateId(bridge.id, 'BridgeEquation');\n if (!(bridge.confidence >= 0 && bridge.confidence <= 1)) {\n throw new RangeError(`BridgeEquation.confidence must be in [0,1]; got ${bridge.confidence}`);\n }\n // Bridges are off-diagonal by definition — reject source == target\n // (including the degenerate case where both are empty {}).\n const sourceKey = this.serializeIndices(bridge.source);\n const targetKey = this.serializeIndices(bridge.target);\n if (sourceKey === targetKey) {\n throw new RangeError(\n `BridgeEquation source must differ from target in at least one index; id=${bridge.id}` +\n (sourceKey === '' ? ' (both were empty {})' : '')\n );\n }\n const previous = this.bridgeEquations.get(bridge.id);\n if (previous) {\n this.removeFromCell(this.bridgeCellKey(previous.source, previous.target), bridge.id);\n }\n this.bridgeEquations.set(bridge.id, bridge);\n\n // Store in off-diagonal elements. Multiple bridges between the same\n // source/target regime pair are accumulated in the same cell.\n this.addToCell(this.bridgeCellKey(bridge.source, bridge.target), bridge.id);\n return previous === undefined;\n }\n\n /**\n * Reject empty or whitespace-only IDs — almost always caller error.\n */\n private validateId(id: string, kind: string): void {\n if (typeof id !== 'string' || id.trim() === '') {\n throw new TypeError(`${kind}.id must be a non-empty string`);\n }\n }\n\n /**\n * Reject axis values that are not declared in the tensor's config.\n * Prevents silent drift between TensorConfig (declared axes) and actual stored content.\n */\n private validateAxisMembership<T extends string>(\n values: readonly T[] | undefined,\n axisName: string,\n declared: readonly T[]\n ): void {\n if (!values) return;\n for (const v of values) {\n if (!declared.includes(v)) {\n throw new RangeError(\n `${axisName} value '${v}' is not declared in TensorConfig.${axisName}=[${declared.join(', ')}]`\n );\n }\n }\n }\n\n /**\n * Reject non-finite or non-integer numeric axis values (dimensions, topologies).\n * Integer values (including 0, negative integers) are allowed;\n * NaN, Infinity, and non-integers are rejected.\n */\n private validateFiniteIntegerArray(\n values: readonly number[] | undefined,\n axisName: string\n ): void {\n if (!values) return;\n for (const v of values) {\n if (!Number.isFinite(v) || !Number.isInteger(v)) {\n throw new RangeError(\n `${axisName} values must be finite integers; got ${v}`\n );\n }\n }\n }\n\n /**\n * Compose the cell key for a bridge equation's source→target indices.\n */\n private bridgeCellKey(source: TensorIndices, target: TensorIndices): string {\n return this.serializeIndices(source) + ' -> ' + this.serializeIndices(target);\n }\n\n /**\n * Accumulate an equation ID into the tensor cell at the given key.\n * Creates a new Set if the cell is empty.\n */\n private addToCell(key: string, equationId: string): void {\n let cell = this.tensorData.get(key);\n if (!cell) {\n cell = new Set();\n this.tensorData.set(key, cell);\n }\n cell.add(equationId);\n }\n\n /**\n * Remove an equation ID from a tensor cell. Prunes empty cells.\n */\n private removeFromCell(key: string, equationId: string): void {\n const cell = this.tensorData.get(key);\n if (!cell) return;\n cell.delete(equationId);\n if (cell.size === 0) this.tensorData.delete(key);\n }\n\n /**\n * Add an emergent phenomenon.\n * Returns true if newly added, false if it replaced an existing phenomenon.\n */\n public addEmergence(phenomenon: EmergentPhenomenon): boolean {\n this.validateId(phenomenon.id, 'EmergentPhenomenon');\n if (!Number.isInteger(phenomenon.order) || phenomenon.order < 3) {\n throw new RangeError(\n `EmergentPhenomenon.order must be an integer >= 3 (higher-order correlations); got ${phenomenon.order}`\n );\n }\n if (!(phenomenon.confidence >= 0 && phenomenon.confidence <= 1)) {\n throw new RangeError(\n `EmergentPhenomenon.confidence must be in [0,1]; got ${phenomenon.confidence}`\n );\n }\n const previous = this.emergentPhenomena.get(phenomenon.id);\n if (previous) {\n for (const indices of previous.indices) {\n const key = this.serializeIndices(indices);\n if (key) this.removeFromCell(key, phenomenon.id);\n }\n }\n this.emergentPhenomena.set(phenomenon.id, phenomenon);\n\n // Populate tensorData at each declared index-tuple, matching the L and B\n // components' storage pattern so the Π = L + B + E decomposition is\n // uniformly represented in the sparse tensor.\n for (const indices of phenomenon.indices) {\n const key = this.serializeIndices(indices);\n if (key) this.addToCell(key, phenomenon.id);\n }\n return previous === undefined;\n }\n\n /**\n * Add a typed `Cell` (LawCell, BridgeCell, or EmergenceCell) to the\n * tensor. Dispatches by the cell's `kind` discriminator to the\n * existing `addLaw` / `addBridge` / `addEmergence` paths via internal\n * adapters that translate the string-vocabulary `confidence` to the\n * legacy numeric range.\n *\n * Returns the same boolean the dispatched method returns: `true` if\n * newly added, `false` if it replaced an existing entry with the same\n * id.\n *\n * v0.7 Proposal 3 Phase 2 Task 2.1. Internal callers that want\n * type-safe ingestion through the discriminated union use `addCell`;\n * callers that want the old typed methods continue to use `addLaw` /\n * `addBridge` / `addEmergence` directly.\n *\n * @public\n */\n public addCell(cell: Cell): boolean {\n // v0.7-p2 Phase 2 Task 2.3: dispatch to legacy add method FIRST\n // (catches structural-validation throws on bad inputs), then run\n // flux rules. ERROR-tier diagnostics throw FluxViolationError and\n // roll back the legacy add (fail-atomic per Decision #4). The add may\n // REPLACE an entry with the same id, so the entry that was there is\n // snapshotted first and put back on rollback; deleting the id would\n // erase a good record because its replacement was bad.\n const previous = this.snapshotEntry(cell);\n let newlyAdded: boolean;\n switch (cell.kind) {\n case 'law':\n newlyAdded = this.addLaw(cellToLaw(cell));\n break;\n case 'bridge':\n newlyAdded = this.addBridge(cellToBridge(cell));\n break;\n case 'emergence':\n newlyAdded = this.addEmergence(cellToEmergence(cell));\n break;\n default: {\n const _exhaustive: never = cell;\n void _exhaustive;\n throw new Error(\n `UniversalTensor.addCell: unknown cell kind: ${(cell as Cell).kind}`,\n );\n }\n }\n\n // Run rules. WARNING/INFO diagnostics are accumulated for the\n // next fluxDiagnostics() call (recomputed on demand per Eve-R8\n // — no mutable pendingDiagnostics field). ERROR-tier throws.\n const report = runRules(cell, this.fluxRules);\n if (report.errorCount > 0) {\n const errDiag = report.diagnostics.find((d) => d.severity === 'error');\n if (errDiag) {\n // Roll back the legacy add before throwing (fail-atomic).\n this.rollbackCell(cell, previous);\n throw new FluxViolationError(errDiag.ruleName, errDiag.cellId, errDiag.message);\n }\n }\n return newlyAdded;\n }\n\n /** The stored entry `cell.id` currently names in its own kind's map, if any. */\n private snapshotEntry(cell: Cell): PreviousEntry | undefined {\n switch (cell.kind) {\n case 'law': {\n const law = this.knownLaws.get(cell.id);\n return law === undefined ? undefined : { kind: 'law', law };\n }\n case 'bridge': {\n const bridge = this.bridgeEquations.get(cell.id);\n return bridge === undefined ? undefined : { kind: 'bridge', bridge };\n }\n case 'emergence': {\n const phenomenon = this.emergentPhenomena.get(cell.id);\n return phenomenon === undefined ? undefined : { kind: 'emergence', phenomenon };\n }\n default: {\n const _exhaustive: never = cell;\n void _exhaustive;\n return undefined;\n }\n }\n }\n\n /**\n * Internal helper: roll back the legacy `addLaw`/`addBridge`/\n * `addEmergence` storage for a cell that just failed a rule check.\n * Removes the freshly stored entry and, when the add replaced an\n * existing entry, stores that entry again through the same add path\n * (it passed structural validation when it was first stored). Used by\n * `addCell` to maintain fail-atomic semantics on ERROR-tier rule\n * violations.\n *\n * @internal\n */\n private rollbackCell(cell: Cell, previous: PreviousEntry | undefined): void {\n switch (cell.kind) {\n case 'law': {\n const law = this.knownLaws.get(cell.id);\n if (!law) return;\n this.knownLaws.delete(cell.id);\n for (const scale of law.scales) {\n for (const force of law.forces) {\n this.removeFromCell(this.serializeIndices({ scale, force }), cell.id);\n }\n }\n if (previous?.kind === 'law') this.addLaw(previous.law);\n return;\n }\n case 'bridge': {\n const bridge = this.bridgeEquations.get(cell.id);\n if (!bridge) return;\n this.bridgeEquations.delete(cell.id);\n this.removeFromCell(this.bridgeCellKey(bridge.source, bridge.target), cell.id);\n if (previous?.kind === 'bridge') this.addBridge(previous.bridge);\n return;\n }\n case 'emergence': {\n const ph = this.emergentPhenomena.get(cell.id);\n if (!ph) return;\n this.emergentPhenomena.delete(cell.id);\n for (const indices of ph.indices) {\n const key = this.serializeIndices(indices);\n if (key) this.removeFromCell(key, cell.id);\n }\n if (previous?.kind === 'emergence') this.addEmergence(previous.phenomenon);\n return;\n }\n default: {\n const _exhaustive: never = cell;\n void _exhaustive;\n }\n }\n }\n\n // -------------------------------------------------------------------------\n // v0.7-p2 Phase 2 Tasks 2.1, 2.2, 2.3 — populated-cells query + flux\n // -------------------------------------------------------------------------\n\n /**\n * Number of distinct (key, value) pairs in the underlying sparse\n * storage. Counts UNIQUE coordinates that hold at least one entry.\n *\n * Note: a single multi-scale `LawCell` (e.g.\n * `scales: ['quantum', 'classical']`, `forces: ['gravitational']`)\n * fans out to 2 coordinates, so `populatedCount()` returns 2.\n * Use `populatedCells()` for the deduped count of distinct `Cell`\n * objects.\n *\n * @public\n */\n public populatedCount(): number {\n return this.tensorData.size;\n }\n\n /**\n * All cells currently in the tensor, deduplicated by `id`. Each\n * underlying entry (law, bridge, emergence) is converted back to\n * its `Cell` representation via the inverse adapters in `cell.ts`.\n *\n * Per Eve-R15 semantics: `populatedCells().length` is the count of\n * distinct `Cell` objects (one per `id`). `populatedCount()` counts\n * unique TENSOR COORDINATES (one per fan-out per Decision #6),\n * which may be larger.\n *\n * @public\n */\n public populatedCells(): ReadonlyArray<Cell> {\n const cells: Cell[] = [];\n for (const law of this.knownLaws.values()) cells.push(lawToCell(law));\n for (const bridge of this.bridgeEquations.values()) cells.push(bridgeToCell(bridge));\n for (const ph of this.emergentPhenomena.values()) cells.push(emergenceToCell(ph));\n return cells;\n }\n\n /**\n * For each populated coordinate, enumerate the single-axis-flip\n * neighbors that are NOT currently populated. Each \"neighbor\" is\n * a `TensorIndices` value that differs from a populated coordinate\n * in exactly one axis, where the differing axis value is drawn\n * from the config-declared set for that axis (Decision #10).\n *\n * Integer axes (`dimension`, `topology`) are NOT enumerable from\n * `TensorConfig` (no declared range exists) and are treated as\n * wildcards — single-axis flips along those axes are NOT\n * generated.\n *\n * Returns a deduplicated `ReadonlyArray<TensorIndices>` (no two\n * elements serialize to the same key under `serializeIndices`).\n *\n * @public\n */\n public unpopulatedNeighborhoods(): ReadonlyArray<TensorIndices> {\n const populated = new Set(this.tensorData.keys());\n const unique = new Map<string, TensorIndices>();\n\n for (const populatedKey of this.tensorData.keys()) {\n const parsed = this.deserializeKey(populatedKey);\n if (!parsed) continue;\n for (const neighbor of this.enumerateAxisFlips(parsed)) {\n const key = this.serializeIndices(neighbor);\n if (key === '' || populated.has(key) || unique.has(key)) continue;\n unique.set(key, neighbor);\n }\n }\n return [...unique.values()];\n }\n\n /**\n * Run the registered flux rules across every populated cell and\n * return an aggregated `FluxReport`. Re-runs on every call\n * (no cached `pendingDiagnostics` field — Eve-R8 resolution).\n *\n * @public\n */\n public fluxDiagnostics(): FluxReport {\n const diagnostics: FluxDiagnostic[] = [];\n let errorCount = 0;\n let warningCount = 0;\n let infoCount = 0;\n\n for (const cell of this.populatedCells()) {\n const report = runRules(cell, this.fluxRules);\n diagnostics.push(...report.diagnostics);\n errorCount += report.errorCount;\n warningCount += report.warningCount;\n infoCount += report.infoCount;\n }\n return { diagnostics, errorCount, warningCount, infoCount };\n }\n\n // -------------------------------------------------------------------------\n // Phase 2 internal helpers\n // -------------------------------------------------------------------------\n\n /**\n * Parse a key produced by `serializeIndices` back into a\n * `TensorIndices` value. Returns null if the key includes a bridge\n * separator (' -> '), since bridge keys are off-diagonal and don't\n * correspond to a single `TensorIndices` coordinate.\n *\n * @internal\n */\n private deserializeKey(key: string): TensorIndices | null {\n if (key.includes(' -> ')) return null; // bridge key — not a single coordinate\n if (key === '') return {};\n const out: { [k: string]: unknown } = {};\n for (const part of key.split('|')) {\n const colon = part.indexOf(':');\n if (colon === -1) continue;\n const axis = part.slice(0, colon);\n const value = part.slice(colon + 1);\n switch (axis) {\n case 'scale': out.scale = value; break;\n case 'force': out.force = value; break;\n case 'sym': out.symmetry = value; break;\n case 'info': out.information = value; break;\n case 'dim': out.dimension = Number(value); break;\n case 'topo': out.topology = Number(value); break;\n }\n }\n return out as TensorIndices;\n }\n\n /**\n * Enumerate single-axis-flip neighbors of `coord`. For each\n * enumerable axis (scale, force, symmetry, information), generate\n * a neighbor with that axis replaced by every OTHER config-declared\n * value. The integer axes (dimension, topology) are wildcards\n * and not enumerated.\n *\n * @internal\n */\n private *enumerateAxisFlips(coord: TensorIndices): Generator<TensorIndices> {\n const axes: Array<{\n key: keyof TensorIndices;\n values: readonly string[];\n }> = [\n { key: 'scale', values: this.config.scales },\n { key: 'force', values: this.config.forces },\n { key: 'symmetry', values: this.config.symmetries },\n { key: 'information', values: this.config.informationMeasures },\n ];\n\n for (const { key, values } of axes) {\n if (coord[key] === undefined) continue;\n for (const alt of values) {\n if (alt === coord[key]) continue;\n yield { ...coord, [key]: alt };\n }\n }\n }\n\n /**\n * Return the IDs of laws and emergent phenomena stored at the diagonal cell\n * addressed by the given indices.\n * For bridge-equation cells (off-diagonal, source→target), use getBridgeCellContents instead.\n */\n public getCellContents(indices: TensorIndices): string[] {\n const key = this.serializeIndices(indices);\n const cell = this.tensorData.get(key);\n return cell ? [...cell] : [];\n }\n\n /**\n * Return the IDs of bridge equations stored at the off-diagonal cell\n * addressed by the given source/target indices.\n */\n public getBridgeCellContents(source: TensorIndices, target: TensorIndices): string[] {\n const key = this.bridgeCellKey(source, target);\n const cell = this.tensorData.get(key);\n return cell ? [...cell] : [];\n }\n\n /**\n * Query tensor for laws applicable to specific regime\n */\n public queryLaws(indices: TensorIndices): PhysicalLaw[] {\n const results: PhysicalLaw[] = [];\n\n for (const law of this.knownLaws.values()) {\n if (this.lawMatchesQuery(law, indices)) {\n results.push(law);\n }\n }\n\n return results;\n }\n\n /**\n * Find bridge equations connecting two regimes\n */\n public findBridges(source: TensorIndices, target: TensorIndices): BridgeEquation[] {\n const results: BridgeEquation[] = [];\n\n for (const bridge of this.bridgeEquations.values()) {\n if (\n this.indicesMatch(bridge.source, source) &&\n this.indicesMatch(bridge.target, target)\n ) {\n results.push(bridge);\n }\n }\n\n return results;\n }\n\n /**\n * Get all known laws\n */\n public getLaws(): PhysicalLaw[] {\n return [...this.knownLaws.values()];\n }\n\n /**\n * Get all bridge equations\n */\n public getBridges(): BridgeEquation[] {\n return [...this.bridgeEquations.values()];\n }\n\n /**\n * Get all emergent phenomena\n */\n public getEmergence(): EmergentPhenomenon[] {\n return [...this.emergentPhenomena.values()];\n }\n\n /**\n * Get tensor statistics\n */\n public getStats() {\n // occupiedCells = number of distinct (diagonal or off-diagonal) tensor cells\n // that hold at least one equation ID. Each cell may hold multiple IDs (Set).\n let totalEntries = 0;\n for (const cell of this.tensorData.values()) totalEntries += cell.size;\n return {\n rank: this.config.rank,\n knownLaws: this.knownLaws.size,\n bridgeEquations: this.bridgeEquations.size,\n emergentPhenomena: this.emergentPhenomena.size,\n occupiedCells: this.tensorData.size,\n totalEntries,\n sparse: this.config.sparse,\n };\n }\n\n /**\n * Serialize tensor indices to string key.\n * Uses !== undefined checks so that dimension/topology values of 0\n * (e.g., trivial winding number, genus-0 surface) are preserved.\n */\n private serializeIndices(indices: TensorIndices): string {\n const parts: string[] = [];\n\n if (indices.scale !== undefined) parts.push(`scale:${indices.scale}`);\n if (indices.force !== undefined) parts.push(`force:${indices.force}`);\n if (indices.symmetry !== undefined) parts.push(`sym:${indices.symmetry}`);\n if (indices.information !== undefined) parts.push(`info:${indices.information}`);\n if (indices.dimension !== undefined) parts.push(`dim:${indices.dimension}`);\n if (indices.topology !== undefined) parts.push(`topo:${indices.topology}`);\n\n return parts.join('|');\n }\n\n /**\n * Check if a law matches query indices.\n * If the query specifies an index dimension that the law does not declare\n * (e.g., the law has no informationMeasures but the query asks for one),\n * the law is excluded — querying on an undeclared index cannot match.\n */\n private lawMatchesQuery(law: PhysicalLaw, query: TensorIndices): boolean {\n if (query.scale && !law.scales.includes(query.scale)) {\n return false;\n }\n\n if (query.force && !law.forces.includes(query.force)) {\n return false;\n }\n\n if (query.symmetry && !law.symmetries.includes(query.symmetry)) {\n return false;\n }\n\n if (query.information) {\n if (!law.informationMeasures || !law.informationMeasures.includes(query.information)) {\n return false;\n }\n }\n\n if (query.dimension !== undefined) {\n if (!law.dimensions || !law.dimensions.includes(query.dimension)) {\n return false;\n }\n }\n\n if (query.topology !== undefined) {\n if (!law.topologies || !law.topologies.includes(query.topology)) {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * Check if two tensor indices match\n */\n private indicesMatch(a: TensorIndices, b: TensorIndices): boolean {\n if (b.scale && a.scale !== b.scale) {\n return false;\n }\n\n if (b.force && a.force !== b.force) {\n return false;\n }\n\n if (b.symmetry && a.symmetry !== b.symmetry) {\n return false;\n }\n\n if (b.information && a.information !== b.information) {\n return false;\n }\n\n if (b.dimension !== undefined && a.dimension !== b.dimension) {\n return false;\n }\n\n if (b.topology !== undefined && a.topology !== b.topology) {\n return false;\n }\n\n return true;\n }\n}\n\n/**\n * Factory: build a populated `UniversalTensor` from three typed cell\n * arrays plus a `TensorConfig`.\n *\n * Makes the \"'+' in Π = L + B + E is disjoint union, not algebraic\"\n * invariant concrete: the only way to construct a populated\n * `UniversalTensor` from typed cells is to pass three typed arrays.\n * There is no `add(c1: Cell, c2: Cell): Cell` because cells never\n * compose at the cell level — composition happens at the tensor\n * level (Proposals 2 and 6 territory).\n *\n * **Provenance note**: the proposals doc §4.2 line 299 sketches\n * `compose(L, B, E): UniversalTensor` without a `config` argument.\n * This signature closes a proposals-doc gap — `UniversalTensor`'s\n * constructor requires `rank` / `scales` / `forces`, none of which\n * can be inferred from the three cell arrays alone. `compose` is\n * this sprint's invention, not a proposals-doc commitment.\n *\n * Co-located with `UniversalTensor` (moved from `cell.ts`, 2026-06-19) to\n * break the `tensor.ts ↔ cell.ts` RUNTIME import cycle: `cell.ts` now depends\n * on `tensor.ts` for types only, while this factory — the one cell-side symbol\n * that instantiated `UniversalTensor` at runtime — lives beside the class.\n *\n * @public\n */\nexport function compose(\n laws: ReadonlyArray<LawCell>,\n bridges: ReadonlyArray<BridgeCell>,\n emergences: ReadonlyArray<EmergenceCell>,\n config: TensorConfig,\n): UniversalTensor {\n const tensor = new UniversalTensor(config);\n for (const law of laws) tensor.addCell(law);\n for (const bridge of bridges) tensor.addCell(bridge);\n for (const emergence of emergences) tensor.addCell(emergence);\n return tensor;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tensor.js","sourceRoot":"","sources":["../../src/core/tensor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAkBH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAY/E;;;;;;;;;;;;;;;GAeG;AACH,SAAS,wBAAwB,CAAC,CAAiB;IACjD,QAAQ,CAAC,EAAE,CAAC;QACV,KAAK,aAAa,EAAE,OAAO,IAAI,CAAC;QAChC,KAAK,aAAa,EAAE,OAAO,GAAG,CAAC;QAC/B,KAAK,oBAAoB,EAAE,OAAO,GAAG,CAAC;QACtC,SAAS,CAAC;YACR,MAAM,WAAW,GAAU,CAAC,CAAC;YAC7B,KAAK,WAAW,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAW,EAAE,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,SAAS,CAAC,IAAa;IAC9B,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,QAAQ,EAAE,IAAI,CA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AAS,CAAC,CAAC;IAC9D,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * Universal Physics Tensor\n *\n * Core implementation of the rank-N tensor living in product space:\n * Π ∈ H_scale ⊗ H_force ⊗ H_symmetry ⊗ H_info ⊗ H_dim ⊗ H_topo\n *\n * Decomposition: Π = L + B + E\n * Where:\n * - L: Known laws (diagonal elements)\n * - B: Bridge equations (off-diagonal elements)\n * - E: Emergent phenomena (higher-order correlations)\n */\n\nimport type {\n TensorConfig,\n TensorIndices,\n PhysicalLaw,\n BridgeEquation,\n EmergentPhenomenon,\n PhysicalScale,\n Force,\n} from './types.js';\nimport type {\n Cell,\n CellConfidence,\n LawCell,\n BridgeCell,\n EmergenceCell,\n} from './cell.js';\nimport { lawToCell, bridgeToCell, emergenceToCell } from './cell.js';\nimport { Axes } from './axes-registry.js';\nimport type { FluxRule, FluxReport, FluxDiagnostic } from './flux-rules.js';\nimport { runRules, V07_CELL_RULES, FluxViolationError } from './flux-rules.js';\n\n/**\n * The entry an `addCell` call is about to replace, held so a flux-rule\n * failure can put it back (fail-atomic on a replacement, not only on a\n * fresh id).\n */\ntype PreviousEntry =\n | { readonly kind: 'law'; readonly law: PhysicalLaw }\n | { readonly kind: 'bridge'; readonly bridge: BridgeEquation }\n | { readonly kind: 'emergence'; readonly phenomenon: EmergentPhenomenon };\n\n/**\n * Map the string-vocabulary {@link CellConfidence} to a representative\n * numeric value in [0,1] for the legacy `addLaw` / `addBridge` /\n * `addEmergence` path (each validates `confidence >= 0 && <= 1`).\n *\n * Internal-only — consumers see the string vocabulary on `Cell`. The\n * numeric value is a storage detail, not a public-API contract. Per\n * Adam+Eve Eve-R3, this is the REVERSE direction of the (rejected)\n * `confidenceToStatus` adapter: that one was rejected because it\n * could overwrite curated catalog `status` fields with derived labels.\n * This one is safe because the caller has already declared their\n * string intent; the function just picks a representative number for\n * the legacy path's range check.\n *\n * @internal\n */\nfunction statusToConfidenceNumber(c: CellConfidence): number {\n switch (c) {\n case 'established': return 0.95;\n case 'speculative': return 0.6;\n case 'highly-speculative': return 0.3;\n default: {\n const _exhaustive: never = c;\n void _exhaustive;\n throw new Error(`Unknown CellConfidence: ${c as string}`);\n }\n }\n}\n\n/**\n * Adapter: `LawCell` → `PhysicalLaw` (legacy shape). Internal-only.\n * @internal\n */\nfunction cellToLaw(cell: LawCell): PhysicalLaw {\n return {\n id: cell.id,\n name: cell.name,\n equation: cell.equation,\n scales: [...cell.scales],\n forces: [...cell.forces],\n symmetries: [...cell.symmetries],\n confidence: statusToConfidenceNumber(cell.confidence),\n ...(cell.informationMeasures ? { informationMeasures: [...cell.informationMeasures] } : {}),\n ...(cell.dimensions ? { dimensions: [...cell.dimensions] } : {}),\n ...(cell.topologies ? { topologies: [...cell.topologies] } : {}),\n ...(cell.references ? { references: [...cell.references] } : {}),\n };\n}\n\n/**\n * Adapter: `BridgeCell` → `BridgeEquation` (legacy shape). Internal-only.\n * @internal\n */\nfunction cellToBridge(cell: BridgeCell): BridgeEquation {\n return {\n id: cell.id,\n name: cell.name,\n source: cell.source,\n target: cell.target,\n equation: cell.equation,\n confidence: statusToConfidenceNumber(cell.confidence),\n validated: cell.validated,\n description: cell.description,\n };\n}\n\n/**\n * Adapter: `EmergenceCell` → `EmergentPhenomenon` (legacy shape).\n * Maps `cell.equation` to `EmergentPhenomenon.description` (the legacy\n * interface uses `description` for the mathematical content); a\n * separate `cell.description` (prose context) is appended if present.\n * @internal\n */\nfunction cellToEmergence(cell: EmergenceCell): EmergentPhenomenon {\n const description = cell.description\n ? `${cell.equation}\\n\\n${cell.description}`\n : cell.equation;\n return {\n id: cell.id,\n name: cell.name,\n order: cell.order,\n indices: [...cell.indices],\n description,\n confidence: statusToConfidenceNumber(cell.confidence),\n };\n}\n\n/**\n * Refuse a configured axis value the registry does not name. `admitted` is the\n * registry namespace for that axis (`Axes.scale`, …), whose keys are the values.\n */\nfunction requireAxisValues(field: string, values: readonly unknown[], admitted: Readonly<Record<string, unknown>>): void {\n if (!Array.isArray(values)) throw new TypeError(`TensorConfig.${field} must be an array`);\n const known = Object.keys(admitted);\n for (const value of values) {\n if (typeof value !== 'string' || !known.includes(value)) {\n throw new RangeError(`TensorConfig.${field}: '${String(value)}' is not an axis value; the registry names ${known.join(', ')}`);\n }\n }\n}\n\n/**\n * The rank-6 universal physics tensor Π = L + B + E: a sparse store of\n * physical-law / bridge / emergence cells indexed by regime coordinates.\n *\n * @public\n */\nexport class UniversalTensor {\n private readonly config: Required<TensorConfig>;\n private readonly knownLaws: Map<string, PhysicalLaw>;\n private readonly bridgeEquations: Map<string, BridgeEquation>;\n private readonly emergentPhenomena: Map<string, EmergentPhenomenon>;\n\n /**\n * Sparse tensor storage: only store non-zero elements.\n * Key: serialized tensor indices\n * Value: set of equation IDs occupying that cell (multiple laws/bridges\n * may coexist in a single tensor cell without overwriting each other).\n */\n private readonly tensorData: Map<string, Set<string>>;\n\n /**\n * v0.7-p2 Phase 2 Task 2.3: Rule set used by `addCell` (ERROR-tier\n * violations throw) and by `fluxDiagnostics()` (re-runs across all\n * populated cells). Default = `V07_CELL_RULES` (Rule 2 + Rule 3\n * from `flux-rules.ts`). Rule 1 (dimensional consistency) fires\n * from the catalog adapter (Phase 3), not from `addCell`.\n *\n * Per Decision #9, this field is `@internal`. No public mutator\n * is exposed in v0.7 (rule customization is a v0.8+ concern).\n */\n private readonly fluxRules: ReadonlyArray<FluxRule>;\n\n constructor(config: TensorConfig) {\n // Runtime validation (strict TS catches these at compile time, but JS\n // consumers bypass the type system — we validate defensively here).\n if (![3, 4, 5, 6].includes(config.rank)) {\n throw new RangeError(`TensorConfig.rank must be 3, 4, 5, or 6; got ${config.rank}`);\n }\n if (!Array.isArray(config.scales) || config.scales.length === 0) {\n throw new TypeError('TensorConfig.scales must be a non-empty array');\n }\n if (!Array.isArray(config.forces) || config.forces.length === 0) {\n throw new TypeError('TensorConfig.forces must be a non-empty array');\n }\n // Each value is one the axis registry names: `scales: ['nope']` used to build a tensor over\n // an axis value nothing else in the library knows.\n requireAxisValues('scales', config.scales, Axes.scale);\n requireAxisValues('forces', config.forces, Axes.force);\n if (config.symmetries !== undefined) requireAxisValues('symmetries', config.symmetries, Axes.symmetry);\n if (config.informationMeasures !== undefined) {\n requireAxisValues('informationMeasures', config.informationMeasures, Axes.information);\n }\n\n // Apply defaults\n this.config = {\n rank: config.rank,\n scales: config.scales,\n forces: config.forces,\n symmetries: config.symmetries && config.symmetries.length > 0\n ? config.symmetries\n : ['poincare', 'gauge'],\n informationMeasures: config.informationMeasures && config.informationMeasures.length > 0\n ? config.informationMeasures\n : ['vonNeumann', 'shannon'],\n sparse: config.sparse ?? true,\n };\n\n this.knownLaws = new Map();\n this.bridgeEquations = new Map();\n this.emergentPhenomena = new Map();\n this.tensorData = new Map();\n this.fluxRules = V07_CELL_RULES;\n }\n\n /**\n * Add a known physical law to the tensor.\n * Returns true if newly added, false if it replaced an existing law with the same id.\n * If replacing, stale cell entries from the previous law are removed first.\n */\n public addLaw(law: PhysicalLaw): boolean {\n this.validateId(law.id, 'PhysicalLaw');\n if (!(law.confidence >= 0 && law.confidence <= 1)) {\n throw new RangeError(`PhysicalLaw.confidence must be in [0,1]; got ${law.confidence}`);\n }\n this.validateAxisMembership(law.scales, 'scales', this.config.scales);\n this.validateAxisMembership(law.forces, 'forces', this.config.forces);\n this.validateAxisMembership(law.symmetries, 'symmetries', this.config.symmetries);\n this.validateAxisMembership(\n law.informationMeasures,\n 'informationMeasures',\n this.config.informationMeasures\n );\n this.validateFiniteIntegerArray(law.dimensions, 'dimensions');\n this.validateFiniteIntegerArray(law.topologies, 'topologies');\n const previous = this.knownLaws.get(law.id);\n if (previous) {\n // Remove stale cell entries from the prior version before writing new ones.\n for (const scale of previous.scales) {\n for (const force of previous.forces) {\n this.removeFromCell(this.serializeIndices({ scale, force }), law.id);\n }\n }\n }\n this.knownLaws.set(law.id, law);\n\n // Store in diagonal elements for all scale/force combinations.\n // Multiple laws may occupy the same cell; we accumulate rather than overwrite.\n for (const scale of law.scales) {\n for (const force of law.forces) {\n const key = this.serializeIndices({ scale, force });\n this.addToCell(key, law.id);\n }\n }\n return previous === undefined;\n }\n\n /**\n * Add a bridge equation connecting regimes.\n * Returns true if newly added, false if it replaced an existing bridge with the same id.\n * If replacing, stale cell entries from the previous bridge are removed first.\n */\n public addBridge(bridge: BridgeEquation): boolean {\n this.validateId(bridge.id, 'BridgeEquation');\n if (!(bridge.confidence >= 0 && bridge.confidence <= 1)) {\n throw new RangeError(`BridgeEquation.confidence must be in [0,1]; got ${bridge.confidence}`);\n }\n // Bridges are off-diagonal by definition — reject source == target\n // (including the degenerate case where both are empty {}).\n const sourceKey = this.serializeIndices(bridge.source);\n const targetKey = this.serializeIndices(bridge.target);\n if (sourceKey === targetKey) {\n throw new RangeError(\n `BridgeEquation source must differ from target in at least one index; id=${bridge.id}` +\n (sourceKey === '' ? ' (both were empty {})' : '')\n );\n }\n const previous = this.bridgeEquations.get(bridge.id);\n if (previous) {\n this.removeFromCell(this.bridgeCellKey(previous.source, previous.target), bridge.id);\n }\n this.bridgeEquations.set(bridge.id, bridge);\n\n // Store in off-diagonal elements. Multiple bridges between the same\n // source/target regime pair are accumulated in the same cell.\n this.addToCell(this.bridgeCellKey(bridge.source, bridge.target), bridge.id);\n return previous === undefined;\n }\n\n /**\n * Reject empty or whitespace-only IDs — almost always caller error.\n */\n private validateId(id: string, kind: string): void {\n if (typeof id !== 'string' || id.trim() === '') {\n throw new TypeError(`${kind}.id must be a non-empty string`);\n }\n }\n\n /**\n * Reject axis values that are not declared in the tensor's config.\n * Prevents silent drift between TensorConfig (declared axes) and actual stored content.\n */\n private validateAxisMembership<T extends string>(\n values: readonly T[] | undefined,\n axisName: string,\n declared: readonly T[]\n ): void {\n if (!values) return;\n for (const v of values) {\n if (!declared.includes(v)) {\n throw new RangeError(\n `${axisName} value '${v}' is not declared in TensorConfig.${axisName}=[${declared.join(', ')}]`\n );\n }\n }\n }\n\n /**\n * Reject non-finite or non-integer numeric axis values (dimensions, topologies).\n * Integer values (including 0, negative integers) are allowed;\n * NaN, Infinity, and non-integers are rejected.\n */\n private validateFiniteIntegerArray(\n values: readonly number[] | undefined,\n axisName: string\n ): void {\n if (!values) return;\n for (const v of values) {\n if (!Number.isFinite(v) || !Number.isInteger(v)) {\n throw new RangeError(\n `${axisName} values must be finite integers; got ${v}`\n );\n }\n }\n }\n\n /**\n * Compose the cell key for a bridge equation's source→target indices.\n */\n private bridgeCellKey(source: TensorIndices, target: TensorIndices): string {\n return this.serializeIndices(source) + ' -> ' + this.serializeIndices(target);\n }\n\n /**\n * Accumulate an equation ID into the tensor cell at the given key.\n * Creates a new Set if the cell is empty.\n */\n private addToCell(key: string, equationId: string): void {\n let cell = this.tensorData.get(key);\n if (!cell) {\n cell = new Set();\n this.tensorData.set(key, cell);\n }\n cell.add(equationId);\n }\n\n /**\n * Remove an equation ID from a tensor cell. Prunes empty cells.\n */\n private removeFromCell(key: string, equationId: string): void {\n const cell = this.tensorData.get(key);\n if (!cell) return;\n cell.delete(equationId);\n if (cell.size === 0) this.tensorData.delete(key);\n }\n\n /**\n * Add an emergent phenomenon.\n * Returns true if newly added, false if it replaced an existing phenomenon.\n */\n public addEmergence(phenomenon: EmergentPhenomenon): boolean {\n this.validateId(phenomenon.id, 'EmergentPhenomenon');\n if (!Number.isInteger(phenomenon.order) || phenomenon.order < 3) {\n throw new RangeError(\n `EmergentPhenomenon.order must be an integer >= 3 (higher-order correlations); got ${phenomenon.order}`\n );\n }\n if (!(phenomenon.confidence >= 0 && phenomenon.confidence <= 1)) {\n throw new RangeError(\n `EmergentPhenomenon.confidence must be in [0,1]; got ${phenomenon.confidence}`\n );\n }\n const previous = this.emergentPhenomena.get(phenomenon.id);\n if (previous) {\n for (const indices of previous.indices) {\n const key = this.serializeIndices(indices);\n if (key) this.removeFromCell(key, phenomenon.id);\n }\n }\n this.emergentPhenomena.set(phenomenon.id, phenomenon);\n\n // Populate tensorData at each declared index-tuple, matching the L and B\n // components' storage pattern so the Π = L + B + E decomposition is\n // uniformly represented in the sparse tensor.\n for (const indices of phenomenon.indices) {\n const key = this.serializeIndices(indices);\n if (key) this.addToCell(key, phenomenon.id);\n }\n return previous === undefined;\n }\n\n /**\n * Add a typed `Cell` (LawCell, BridgeCell, or EmergenceCell) to the\n * tensor. Dispatches by the cell's `kind` discriminator to the\n * existing `addLaw` / `addBridge` / `addEmergence` paths via internal\n * adapters that translate the string-vocabulary `confidence` to the\n * legacy numeric range.\n *\n * Returns the same boolean the dispatched method returns: `true` if\n * newly added, `false` if it replaced an existing entry with the same\n * id.\n *\n * v0.7 Proposal 3 Phase 2 Task 2.1. Internal callers that want\n * type-safe ingestion through the discriminated union use `addCell`;\n * callers that want the old typed methods continue to use `addLaw` /\n * `addBridge` / `addEmergence` directly.\n *\n * @public\n */\n public addCell(cell: Cell): boolean {\n // v0.7-p2 Phase 2 Task 2.3: dispatch to legacy add method FIRST\n // (catches structural-validation throws on bad inputs), then run\n // flux rules. ERROR-tier diagnostics throw FluxViolationError and\n // roll back the legacy add (fail-atomic per Decision #4). The add may\n // REPLACE an entry with the same id, so the entry that was there is\n // snapshotted first and put back on rollback; deleting the id would\n // erase a good record because its replacement was bad.\n const previous = this.snapshotEntry(cell);\n let newlyAdded: boolean;\n switch (cell.kind) {\n case 'law':\n newlyAdded = this.addLaw(cellToLaw(cell));\n break;\n case 'bridge':\n newlyAdded = this.addBridge(cellToBridge(cell));\n break;\n case 'emergence':\n newlyAdded = this.addEmergence(cellToEmergence(cell));\n break;\n default: {\n const _exhaustive: never = cell;\n void _exhaustive;\n throw new Error(\n `UniversalTensor.addCell: unknown cell kind: ${(cell as Cell).kind}`,\n );\n }\n }\n\n // Run rules. WARNING/INFO diagnostics are accumulated for the\n // next fluxDiagnostics() call (recomputed on demand per Eve-R8\n // — no mutable pendingDiagnostics field). ERROR-tier throws.\n const report = runRules(cell, this.fluxRules);\n if (report.errorCount > 0) {\n const errDiag = report.diagnostics.find((d) => d.severity === 'error');\n if (errDiag) {\n // Roll back the legacy add before throwing (fail-atomic).\n this.rollbackCell(cell, previous);\n throw new FluxViolationError(errDiag.ruleName, errDiag.cellId, errDiag.message);\n }\n }\n return newlyAdded;\n }\n\n /** The stored entry `cell.id` currently names in its own kind's map, if any. */\n private snapshotEntry(cell: Cell): PreviousEntry | undefined {\n switch (cell.kind) {\n case 'law': {\n const law = this.knownLaws.get(cell.id);\n return law === undefined ? undefined : { kind: 'law', law };\n }\n case 'bridge': {\n const bridge = this.bridgeEquations.get(cell.id);\n return bridge === undefined ? undefined : { kind: 'bridge', bridge };\n }\n case 'emergence': {\n const phenomenon = this.emergentPhenomena.get(cell.id);\n return phenomenon === undefined ? undefined : { kind: 'emergence', phenomenon };\n }\n default: {\n const _exhaustive: never = cell;\n void _exhaustive;\n return undefined;\n }\n }\n }\n\n /**\n * Internal helper: roll back the legacy `addLaw`/`addBridge`/\n * `addEmergence` storage for a cell that just failed a rule check.\n * Removes the freshly stored entry and, when the add replaced an\n * existing entry, stores that entry again through the same add path\n * (it passed structural validation when it was first stored). Used by\n * `addCell` to maintain fail-atomic semantics on ERROR-tier rule\n * violations.\n *\n * @internal\n */\n private rollbackCell(cell: Cell, previous: PreviousEntry | undefined): void {\n switch (cell.kind) {\n case 'law': {\n const law = this.knownLaws.get(cell.id);\n if (!law) return;\n this.knownLaws.delete(cell.id);\n for (const scale of law.scales) {\n for (const force of law.forces) {\n this.removeFromCell(this.serializeIndices({ scale, force }), cell.id);\n }\n }\n if (previous?.kind === 'law') this.addLaw(previous.law);\n return;\n }\n case 'bridge': {\n const bridge = this.bridgeEquations.get(cell.id);\n if (!bridge) return;\n this.bridgeEquations.delete(cell.id);\n this.removeFromCell(this.bridgeCellKey(bridge.source, bridge.target), cell.id);\n if (previous?.kind === 'bridge') this.addBridge(previous.bridge);\n return;\n }\n case 'emergence': {\n const ph = this.emergentPhenomena.get(cell.id);\n if (!ph) return;\n this.emergentPhenomena.delete(cell.id);\n for (const indices of ph.indices) {\n const key = this.serializeIndices(indices);\n if (key) this.removeFromCell(key, cell.id);\n }\n if (previous?.kind === 'emergence') this.addEmergence(previous.phenomenon);\n return;\n }\n default: {\n const _exhaustive: never = cell;\n void _exhaustive;\n }\n }\n }\n\n // -------------------------------------------------------------------------\n // v0.7-p2 Phase 2 Tasks 2.1, 2.2, 2.3 — populated-cells query + flux\n // -------------------------------------------------------------------------\n\n /**\n * Number of distinct (key, value) pairs in the underlying sparse\n * storage. Counts UNIQUE coordinates that hold at least one entry.\n *\n * Note: a single multi-scale `LawCell` (e.g.\n * `scales: ['quantum', 'classical']`, `forces: ['gravitational']`)\n * fans out to 2 coordinates, so `populatedCount()` returns 2.\n * Use `populatedCells()` for the deduped count of distinct `Cell`\n * objects.\n *\n * @public\n */\n public populatedCount(): number {\n return this.tensorData.size;\n }\n\n /**\n * All cells currently in the tensor, deduplicated by `id`. Each\n * underlying entry (law, bridge, emergence) is converted back to\n * its `Cell` representation via the inverse adapters in `cell.ts`.\n *\n * Per Eve-R15 semantics: `populatedCells().length` is the count of\n * distinct `Cell` objects (one per `id`). `populatedCount()` counts\n * unique TENSOR COORDINATES (one per fan-out per Decision #6),\n * which may be larger.\n *\n * @public\n */\n public populatedCells(): ReadonlyArray<Cell> {\n const cells: Cell[] = [];\n for (const law of this.knownLaws.values()) cells.push(lawToCell(law));\n for (const bridge of this.bridgeEquations.values()) cells.push(bridgeToCell(bridge));\n for (const ph of this.emergentPhenomena.values()) cells.push(emergenceToCell(ph));\n return cells;\n }\n\n /**\n * For each populated coordinate, enumerate the single-axis-flip\n * neighbors that are NOT currently populated. Each \"neighbor\" is\n * a `TensorIndices` value that differs from a populated coordinate\n * in exactly one axis, where the differing axis value is drawn\n * from the config-declared set for that axis (Decision #10).\n *\n * Integer axes (`dimension`, `topology`) are NOT enumerable from\n * `TensorConfig` (no declared range exists) and are treated as\n * wildcards — single-axis flips along those axes are NOT\n * generated.\n *\n * Returns a deduplicated `ReadonlyArray<TensorIndices>` (no two\n * elements serialize to the same key under `serializeIndices`).\n *\n * @public\n */\n public unpopulatedNeighborhoods(): ReadonlyArray<TensorIndices> {\n const populated = new Set(this.tensorData.keys());\n const unique = new Map<string, TensorIndices>();\n\n for (const populatedKey of this.tensorData.keys()) {\n const parsed = this.deserializeKey(populatedKey);\n if (!parsed) continue;\n for (const neighbor of this.enumerateAxisFlips(parsed)) {\n const key = this.serializeIndices(neighbor);\n if (key === '' || populated.has(key) || unique.has(key)) continue;\n unique.set(key, neighbor);\n }\n }\n return [...unique.values()];\n }\n\n /**\n * Run the registered flux rules across every populated cell and\n * return an aggregated `FluxReport`. Re-runs on every call\n * (no cached `pendingDiagnostics` field — Eve-R8 resolution).\n *\n * @public\n */\n public fluxDiagnostics(): FluxReport {\n const diagnostics: FluxDiagnostic[] = [];\n let errorCount = 0;\n let warningCount = 0;\n let infoCount = 0;\n\n for (const cell of this.populatedCells()) {\n const report = runRules(cell, this.fluxRules);\n diagnostics.push(...report.diagnostics);\n errorCount += report.errorCount;\n warningCount += report.warningCount;\n infoCount += report.infoCount;\n }\n return { diagnostics, errorCount, warningCount, infoCount };\n }\n\n // -------------------------------------------------------------------------\n // Phase 2 internal helpers\n // -------------------------------------------------------------------------\n\n /**\n * Parse a key produced by `serializeIndices` back into a\n * `TensorIndices` value. Returns null if the key includes a bridge\n * separator (' -> '), since bridge keys are off-diagonal and don't\n * correspond to a single `TensorIndices` coordinate.\n *\n * @internal\n */\n private deserializeKey(key: string): TensorIndices | null {\n if (key.includes(' -> ')) return null; // bridge key — not a single coordinate\n if (key === '') return {};\n const out: { [k: string]: unknown } = {};\n for (const part of key.split('|')) {\n const colon = part.indexOf(':');\n if (colon === -1) continue;\n const axis = part.slice(0, colon);\n const value = part.slice(colon + 1);\n switch (axis) {\n case 'scale': out.scale = value; break;\n case 'force': out.force = value; break;\n case 'sym': out.symmetry = value; break;\n case 'info': out.information = value; break;\n case 'dim': out.dimension = Number(value); break;\n case 'topo': out.topology = Number(value); break;\n }\n }\n return out as TensorIndices;\n }\n\n /**\n * Enumerate single-axis-flip neighbors of `coord`. For each\n * enumerable axis (scale, force, symmetry, information), generate\n * a neighbor with that axis replaced by every OTHER config-declared\n * value. The integer axes (dimension, topology) are wildcards\n * and not enumerated.\n *\n * @internal\n */\n private *enumerateAxisFlips(coord: TensorIndices): Generator<TensorIndices> {\n const axes: Array<{\n key: keyof TensorIndices;\n values: readonly string[];\n }> = [\n { key: 'scale', values: this.config.scales },\n { key: 'force', values: this.config.forces },\n { key: 'symmetry', values: this.config.symmetries },\n { key: 'information', values: this.config.informationMeasures },\n ];\n\n for (const { key, values } of axes) {\n if (coord[key] === undefined) continue;\n for (const alt of values) {\n if (alt === coord[key]) continue;\n yield { ...coord, [key]: alt };\n }\n }\n }\n\n /**\n * Return the IDs of laws and emergent phenomena stored at the diagonal cell\n * addressed by the given indices.\n * For bridge-equation cells (off-diagonal, source→target), use getBridgeCellContents instead.\n */\n public getCellContents(indices: TensorIndices): string[] {\n const key = this.serializeIndices(indices);\n const cell = this.tensorData.get(key);\n return cell ? [...cell] : [];\n }\n\n /**\n * Return the IDs of bridge equations stored at the off-diagonal cell\n * addressed by the given source/target indices.\n */\n public getBridgeCellContents(source: TensorIndices, target: TensorIndices): string[] {\n const key = this.bridgeCellKey(source, target);\n const cell = this.tensorData.get(key);\n return cell ? [...cell] : [];\n }\n\n /**\n * Query tensor for laws applicable to specific regime\n */\n public queryLaws(indices: TensorIndices): PhysicalLaw[] {\n const results: PhysicalLaw[] = [];\n\n for (const law of this.knownLaws.values()) {\n if (this.lawMatchesQuery(law, indices)) {\n results.push(law);\n }\n }\n\n return results;\n }\n\n /**\n * Find bridge equations connecting two regimes\n */\n public findBridges(source: TensorIndices, target: TensorIndices): BridgeEquation[] {\n const results: BridgeEquation[] = [];\n\n for (const bridge of this.bridgeEquations.values()) {\n if (\n this.indicesMatch(bridge.source, source) &&\n this.indicesMatch(bridge.target, target)\n ) {\n results.push(bridge);\n }\n }\n\n return results;\n }\n\n /**\n * Get all known laws\n */\n public getLaws(): PhysicalLaw[] {\n return [...this.knownLaws.values()];\n }\n\n /**\n * Get all bridge equations\n */\n public getBridges(): BridgeEquation[] {\n return [...this.bridgeEquations.values()];\n }\n\n /**\n * Get all emergent phenomena\n */\n public getEmergence(): EmergentPhenomenon[] {\n return [...this.emergentPhenomena.values()];\n }\n\n /**\n * Get tensor statistics\n */\n public getStats() {\n // occupiedCells = number of distinct (diagonal or off-diagonal) tensor cells\n // that hold at least one equation ID. Each cell may hold multiple IDs (Set).\n let totalEntries = 0;\n for (const cell of this.tensorData.values()) totalEntries += cell.size;\n return {\n rank: this.config.rank,\n knownLaws: this.knownLaws.size,\n bridgeEquations: this.bridgeEquations.size,\n emergentPhenomena: this.emergentPhenomena.size,\n occupiedCells: this.tensorData.size,\n totalEntries,\n sparse: this.config.sparse,\n };\n }\n\n /**\n * Serialize tensor indices to string key.\n * Uses !== undefined checks so that dimension/topology values of 0\n * (e.g., trivial winding number, genus-0 surface) are preserved.\n */\n private serializeIndices(indices: TensorIndices): string {\n const parts: string[] = [];\n\n if (indices.scale !== undefined) parts.push(`scale:${indices.scale}`);\n if (indices.force !== undefined) parts.push(`force:${indices.force}`);\n if (indices.symmetry !== undefined) parts.push(`sym:${indices.symmetry}`);\n if (indices.information !== undefined) parts.push(`info:${indices.information}`);\n if (indices.dimension !== undefined) parts.push(`dim:${indices.dimension}`);\n if (indices.topology !== undefined) parts.push(`topo:${indices.topology}`);\n\n return parts.join('|');\n }\n\n /**\n * Check if a law matches query indices.\n * If the query specifies an index dimension that the law does not declare\n * (e.g., the law has no informationMeasures but the query asks for one),\n * the law is excluded — querying on an undeclared index cannot match.\n */\n private lawMatchesQuery(law: PhysicalLaw, query: TensorIndices): boolean {\n if (query.scale && !law.scales.includes(query.scale)) {\n return false;\n }\n\n if (query.force && !law.forces.includes(query.force)) {\n return false;\n }\n\n if (query.symmetry && !law.symmetries.includes(query.symmetry)) {\n return false;\n }\n\n if (query.information) {\n if (!law.informationMeasures || !law.informationMeasures.includes(query.information)) {\n return false;\n }\n }\n\n if (query.dimension !== undefined) {\n if (!law.dimensions || !law.dimensions.includes(query.dimension)) {\n return false;\n }\n }\n\n if (query.topology !== undefined) {\n if (!law.topologies || !law.topologies.includes(query.topology)) {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * Check if two tensor indices match\n */\n private indicesMatch(a: TensorIndices, b: TensorIndices): boolean {\n if (b.scale && a.scale !== b.scale) {\n return false;\n }\n\n if (b.force && a.force !== b.force) {\n return false;\n }\n\n if (b.symmetry && a.symmetry !== b.symmetry) {\n return false;\n }\n\n if (b.information && a.information !== b.information) {\n return false;\n }\n\n if (b.dimension !== undefined && a.dimension !== b.dimension) {\n return false;\n }\n\n if (b.topology !== undefined && a.topology !== b.topology) {\n return false;\n }\n\n return true;\n }\n}\n\n/**\n * Factory: build a populated `UniversalTensor` from three typed cell\n * arrays plus a `TensorConfig`.\n *\n * Makes the \"'+' in Π = L + B + E is disjoint union, not algebraic\"\n * invariant concrete: the only way to construct a populated\n * `UniversalTensor` from typed cells is to pass three typed arrays.\n * There is no `add(c1: Cell, c2: Cell): Cell` because cells never\n * compose at the cell level — composition happens at the tensor\n * level (Proposals 2 and 6 territory).\n *\n * **Provenance note**: the proposals doc §4.2 line 299 sketches\n * `compose(L, B, E): UniversalTensor` without a `config` argument.\n * This signature closes a proposals-doc gap — `UniversalTensor`'s\n * constructor requires `rank` / `scales` / `forces`, none of which\n * can be inferred from the three cell arrays alone. `compose` is\n * this sprint's invention, not a proposals-doc commitment.\n *\n * Co-located with `UniversalTensor` (moved from `cell.ts`, 2026-06-19) to\n * break the `tensor.ts ↔ cell.ts` RUNTIME import cycle: `cell.ts` now depends\n * on `tensor.ts` for types only, while this factory — the one cell-side symbol\n * that instantiated `UniversalTensor` at runtime — lives beside the class.\n *\n * @public\n */\nexport function compose(\n laws: ReadonlyArray<LawCell>,\n bridges: ReadonlyArray<BridgeCell>,\n emergences: ReadonlyArray<EmergenceCell>,\n config: TensorConfig,\n): UniversalTensor {\n const tensor = new UniversalTensor(config);\n for (const law of laws) tensor.addCell(law);\n for (const bridge of bridges) tensor.addCell(bridge);\n for (const emergence of emergences) tensor.addCell(emergence);\n return tensor;\n}\n"]}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -125,13 +125,13 @@ export declare const PhysicalConstants: {
|
|
|
125
125
|
readonly c: 299792458;
|
|
126
126
|
readonly h: 6.62607015e-34;
|
|
127
127
|
readonly hbar: number;
|
|
128
|
-
readonly G:
|
|
128
|
+
readonly G: number;
|
|
129
129
|
readonly kB: 1.380649e-23;
|
|
130
130
|
readonly e: 1.602176634e-19;
|
|
131
|
-
readonly alpha:
|
|
132
|
-
readonly lP:
|
|
133
|
-
readonly tP:
|
|
134
|
-
readonly mP:
|
|
131
|
+
readonly alpha: number;
|
|
132
|
+
readonly lP: number;
|
|
133
|
+
readonly tP: number;
|
|
134
|
+
readonly mP: number;
|
|
135
135
|
readonly H0: number;
|
|
136
136
|
};
|
|
137
137
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -46,6 +46,14 @@ export interface BridgeDiffSpec<Input> {
|
|
|
46
46
|
readonly defaults: Partial<Input>;
|
|
47
47
|
/** The bridge's scalar evaluator. */
|
|
48
48
|
readonly evaluate: (input: Input) => number;
|
|
49
|
+
/**
|
|
50
|
+
* The smallest magnitude the relative step is taken against, per parameter:
|
|
51
|
+
* for `|x| < floor` the step is `floor·relStep`. A parameter that is zero at
|
|
52
|
+
* a point of interest (an eccentricity on a circular orbit) needs its scale
|
|
53
|
+
* stated here, because a relative step at zero is no step. A parameter not
|
|
54
|
+
* named here has no floor: the step is `|x|·relStep`, and `x = 0` is refused.
|
|
55
|
+
*/
|
|
56
|
+
readonly stepFloors?: Readonly<Partial<Record<keyof Input & string, number>>>;
|
|
49
57
|
}
|
|
50
58
|
/**
|
|
51
59
|
* Result of {@link bridgeGradientNumerical}: the bridge's scalar `value`
|
|
@@ -63,12 +71,17 @@ export interface BridgeNumericalGradientResult {
|
|
|
63
71
|
* way to differentiate the catalog's plain-JS closed forms without
|
|
64
72
|
* rewriting them. Needs no engine and is synchronous.
|
|
65
73
|
*
|
|
66
|
-
* For each differentiable param with value `x` it uses
|
|
67
|
-
* `h = max(|x|,
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* `
|
|
71
|
-
*
|
|
74
|
+
* For each differentiable param with value `x` it uses the relative step
|
|
75
|
+
* `h = max(|x|, floor)·cbrt(eps)`, where `floor` is the spec's
|
|
76
|
+
* {@link BridgeDiffSpec.stepFloors} entry for that param (0 when the spec
|
|
77
|
+
* states none), and the ACTUAL representable denominator
|
|
78
|
+
* `dx = (x + h) − (x − h)` (`numerical/finite-difference`) — so the
|
|
79
|
+
* perturbation survives floating-point rounding at astrophysical scales
|
|
80
|
+
* (`M ≈ 2e30 kg`) and stays relative at atomic ones (a charge of 1.6e-19
|
|
81
|
+
* takes a step of 1e-24, not the 6e-6 an absolute floor of 1 gave). A param
|
|
82
|
+
* at exactly 0 with no stated floor is refused with a `RangeError`: there is
|
|
83
|
+
* no scale to step by. The supplied `params` must contain every key in
|
|
84
|
+
* `spec.paramNames`; non-differentiable fields come from `spec.defaults`.
|
|
72
85
|
*
|
|
73
86
|
* @public
|
|
74
87
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-gradient.d.ts","sourceRoot":"","sources":["../../src/diff/bridge-gradient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"bridge-gradient.d.ts","sourceRoot":"","sources":["../../src/diff/bridge-gradient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH;;;;;;;;;;GAUG;AACH,MAAM,WAAW,cAAc,CAAC,KAAK;IACnC,2GAA2G;IAC3G,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,iDAAiD;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC;IACzD;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAClC,qCAAqC;IACrC,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC;IAC5C;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;CAC/E;AAED;;;;;;GAMG;AACH,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACrD;AAUD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAC3C,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC,EAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACnC,6BAA6B,CAiD/B"}
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
*
|
|
19
19
|
* @module diff/bridge-gradient
|
|
20
20
|
*/
|
|
21
|
+
import { centralPartial } from '../numerical/finite-difference.js';
|
|
21
22
|
/**
|
|
22
23
|
* Relative step for central differences: `cbrt(eps)` balances the `O(h²)`
|
|
23
24
|
* truncation error against the `O(eps/h)` round-off error (the central-diff
|
|
@@ -30,12 +31,17 @@ const CENTRAL_DIFF_REL_STEP = Math.cbrt(Number.EPSILON); // ≈ 6.06e-6
|
|
|
30
31
|
* way to differentiate the catalog's plain-JS closed forms without
|
|
31
32
|
* rewriting them. Needs no engine and is synchronous.
|
|
32
33
|
*
|
|
33
|
-
* For each differentiable param with value `x` it uses
|
|
34
|
-
* `h = max(|x|,
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* `
|
|
38
|
-
*
|
|
34
|
+
* For each differentiable param with value `x` it uses the relative step
|
|
35
|
+
* `h = max(|x|, floor)·cbrt(eps)`, where `floor` is the spec's
|
|
36
|
+
* {@link BridgeDiffSpec.stepFloors} entry for that param (0 when the spec
|
|
37
|
+
* states none), and the ACTUAL representable denominator
|
|
38
|
+
* `dx = (x + h) − (x − h)` (`numerical/finite-difference`) — so the
|
|
39
|
+
* perturbation survives floating-point rounding at astrophysical scales
|
|
40
|
+
* (`M ≈ 2e30 kg`) and stays relative at atomic ones (a charge of 1.6e-19
|
|
41
|
+
* takes a step of 1e-24, not the 6e-6 an absolute floor of 1 gave). A param
|
|
42
|
+
* at exactly 0 with no stated floor is refused with a `RangeError`: there is
|
|
43
|
+
* no scale to step by. The supplied `params` must contain every key in
|
|
44
|
+
* `spec.paramNames`; non-differentiable fields come from `spec.defaults`.
|
|
39
45
|
*
|
|
40
46
|
* @public
|
|
41
47
|
*/
|
|
@@ -70,11 +76,13 @@ export function bridgeGradientNumerical(spec, params, opts) {
|
|
|
70
76
|
const gradient = {};
|
|
71
77
|
for (const k of spec.paramNames) {
|
|
72
78
|
const x = params[k];
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
const floor = spec.stepFloors?.[k] ?? 0;
|
|
80
|
+
const h = Math.max(Math.abs(x), floor) * relStep;
|
|
81
|
+
if (!(h > 0)) {
|
|
82
|
+
throw new RangeError(`bridgeGradientNumerical: ${spec.bridgeId}: param '${k}' is ${x} and the spec states no stepFloors['${k}'], ` +
|
|
83
|
+
`so a relative central-difference step has no scale; state the parameter's scale in the spec's stepFloors.`);
|
|
84
|
+
}
|
|
85
|
+
gradient[k] = centralPartial((p) => spec.evaluate(buildInput({ key: k, val: p[k] })), { [k]: x }, k, h);
|
|
78
86
|
}
|
|
79
87
|
return { value, gradient };
|
|
80
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-gradient.js","sourceRoot":"","sources":["../../src/diff/bridge-gradient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"bridge-gradient.js","sourceRoot":"","sources":["../../src/diff/bridge-gradient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAoDnE;;;;;GAKG;AACH,MAAM,qBAAqB,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY;AAErE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,uBAAuB,CACrC,IAA2B,EAC3B,MAA8B,EAC9B,IAAoC;IAEpC,MAAM,OAAO,GAAG,IAAI,EAAE,OAAO,IAAI,qBAAqB,CAAC;IACvD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,IAAI,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,UAAU,CAClB,4BAA4B,IAAI,CAAC,QAAQ,mDAAmD,OAAO,GAAG;YACtG,6FAA6F,CAC9F,CAAC;IACJ,CAAC;IAED,4EAA4E;IAC5E,yEAAyE;IACzE,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;QAChC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,SAAS,CACjB,4BAA4B,IAAI,CAAC,QAAQ,kCAAkC,CAAC,IAAI;gBAChF,QAAQ,MAAM,CAAC,CAAC,CAAC,gEAAgE,CAClF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,0EAA0E;IA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AC,CAAC,CAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3G,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAC7B,CAAC","sourcesContent":["/**\n * Bridge-parameter differentiation by central finite differences.\n *\n * A {@link BridgeDiffSpec} wraps one catalog closed form (a plain-JS scalar\n * function over a named-field struct) and names which fields vary.\n * {@link bridgeGradientNumerical} perturbs those fields and returns the\n * gradient keyed by field name.\n *\n * There is no engine-AD path over a spec. `evaluate` returns a `number`, and\n * a number carries no autograd tape, so reverse- or forward-mode AD of a spec\n * is unreachable by construction; the function that once offered it\n * (`bridgeGradient`) threw for every shipped spec and was removed. The exact\n * AD path is {@link bridgeGradientAST} in `bridge-ast-gradient.ts`, which\n * lowers the bridge's symbolic RHS through `@danielsimonjr/mathts-autograd`.\n *\n * This module lives in `src/diff/` (P8 Decision #1), not in `src/bridges/`,\n * so the catalog closed forms stay untouched.\n *\n * @module diff/bridge-gradient\n */\n\nimport { centralPartial } from '../numerical/finite-difference.js';\n\n/**\n * Specification of a differentiable bridge: which parameters can vary, in\n * what order the gradient reports them, the fixed inputs, and the bridge's\n * scalar evaluator.\n *\n * `paramNames` is the report order. For a Shapiro-delay spec with\n * `paramNames: ['M_kg', 'R_far_m', 'R_near_m']`, the gradient returned by\n * `bridgeGradientNumerical` has keys in that insertion order.\n *\n * @public\n */\nexport interface BridgeDiffSpec<Input> {\n /** Catalog id used in error messages (for example the relation that uses the covariant-eikonal method). */\n readonly bridgeId: string;\n /** Display name (e.g., 'Shapiro time delay'). */\n readonly name: string;\n /**\n * Which Input keys vary, in report order. All names must be present in the\n * frozen `Input` struct as `number`-valued keys.\n */\n readonly paramNames: ReadonlyArray<keyof Input & string>;\n /**\n * The non-differentiable input fields (those NOT in `paramNames`). The\n * evaluator receives `defaults` merged with the varying params.\n */\n readonly defaults: Partial<Input>;\n /** The bridge's scalar evaluator. */\n readonly evaluate: (input: Input) => number;\n /**\n * The smallest magnitude the relative step is taken against, per parameter:\n * for `|x| < floor` the step is `floor·relStep`. A parameter that is zero at\n * a point of interest (an eccentricity on a circular orbit) needs its scale\n * stated here, because a relative step at zero is no step. A parameter not\n * named here has no floor: the step is `|x|·relStep`, and `x = 0` is refused.\n */\n readonly stepFloors?: Readonly<Partial<Record<keyof Input & string, number>>>;\n}\n\n/**\n * Result of {@link bridgeGradientNumerical}: the bridge's scalar `value`\n * at the supplied point, plus the `gradient` of partial derivatives keyed\n * by `paramName` (insertion follows `spec.paramNames` order).\n *\n * @public\n */\nexport interface BridgeNumericalGradientResult {\n readonly value: number;\n readonly gradient: Readonly<Record<string, number>>;\n}\n\n/**\n * Relative step for central differences: `cbrt(eps)` balances the `O(h²)`\n * truncation error against the `O(eps/h)` round-off error (the central-diff\n * optimum). `sqrt(eps)` — the FORWARD-diff optimum — would leave precision on\n * the table for central differences.\n */\nconst CENTRAL_DIFF_REL_STEP = Math.cbrt(Number.EPSILON); // ≈ 6.06e-6\n\n/**\n * Gradient of a bridge evaluator by **central finite differences** — the\n * way to differentiate the catalog's plain-JS closed forms without\n * rewriting them. Needs no engine and is synchronous.\n *\n * For each differentiable param with value `x` it uses the relative step\n * `h = max(|x|, floor)·cbrt(eps)`, where `floor` is the spec's\n * {@link BridgeDiffSpec.stepFloors} entry for that param (0 when the spec\n * states none), and the ACTUAL representable denominator\n * `dx = (x + h) − (x − h)` (`numerical/finite-difference`) — so the\n * perturbation survives floating-point rounding at astrophysical scales\n * (`M ≈ 2e30 kg`) and stays relative at atomic ones (a charge of 1.6e-19\n * takes a step of 1e-24, not the 6e-6 an absolute floor of 1 gave). A param\n * at exactly 0 with no stated floor is refused with a `RangeError`: there is\n * no scale to step by. The supplied `params` must contain every key in\n * `spec.paramNames`; non-differentiable fields come from `spec.defaults`.\n *\n * @public\n */\nexport function bridgeGradientNumerical<Input>(\n spec: BridgeDiffSpec<Input>,\n params: Record<string, number>,\n opts?: { readonly relStep?: number },\n): BridgeNumericalGradientResult {\n const relStep = opts?.relStep ?? CENTRAL_DIFF_REL_STEP;\n if (!Number.isFinite(relStep) || relStep <= 0) {\n throw new RangeError(\n `bridgeGradientNumerical: ${spec.bridgeId}: relStep must be a positive finite number, got ${relStep} ` +\n `(a zero/non-finite step collapses the central-difference denominator to 0 → NaN gradients).`,\n );\n }\n\n // Every paramName must be a FINITE number. (`typeof NaN === 'number'`, so a\n // bare typeof check let NaN/∞ flow into a silently non-finite gradient.)\n for (const k of spec.paramNames) {\n if (!Number.isFinite(params[k])) {\n throw new TypeError(\n `bridgeGradientNumerical: ${spec.bridgeId}: missing or non-finite param '${k}' ` +\n `(got ${params[k]}). All paramNames must be finite numbers in the params object.`,\n );\n }\n }\n\n // Build the full Input struct (defaults + differentiable params), with an\n // optional single-param override for the perturbed evaluations. The\n // `Input` generic has no runtime schema: `spec.paramNames` is declared as\n // keys of `Input`, and `defaults` is a `Partial<Input>`, so the merged\n // record is an `Input` by the spec's own contract; the cast states that.\n const buildInput = (override?: { key: string; val: number }): Input => {\n const input = { ...spec.defaults } as Record<string, unknown>;\n for (const k of spec.paramNames) input[k] = params[k];\n if (override) input[override.key] = override.val;\n return input as unknown as Input;\n };\n\n const value = spec.evaluate(buildInput());\n\n const gradient: Record<string, number> = {};\n for (const k of spec.paramNames) {\n const x = params[k];\n const floor = spec.stepFloors?.[k] ?? 0;\n const h = Math.max(Math.abs(x), floor) * relStep;\n if (!(h > 0)) {\n throw new RangeError(\n `bridgeGradientNumerical: ${spec.bridgeId}: param '${k}' is ${x} and the spec states no stepFloors['${k}'], ` +\n `so a relative central-difference step has no scale; state the parameter's scale in the spec's stepFloors.`,\n );\n }\n gradient[k] = centralPartial((p) => spec.evaluate(buildInput({ key: k, val: p[k]! })), { [k]: x }, k, h);\n }\n\n return { value, gradient };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-specs.d.ts","sourceRoot":"","sources":["../../src/diff/bridge-specs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGnE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAKlE;AAsBD,gFAAgF;AAChF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,+GAA+G;AAC/G,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,mGAAmG;IACnG,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,oEAAoE;AACpE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,uFAAuF;AACvF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAUD,uEAAuE;AACvE,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAC,YAAY,CAM3D,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,uBAAuB,EAAE,cAAc,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"bridge-specs.d.ts","sourceRoot":"","sources":["../../src/diff/bridge-specs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,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|
@@ -60,6 +60,9 @@ export const PERIHELION_ADVANCE_DIFF = {
|
|
|
60
60
|
paramNames: ['M_kg', 'a_m', 'eccentricity'],
|
|
61
61
|
defaults: {},
|
|
62
62
|
evaluate: (input) => evaluateAliased(perihelion, input),
|
|
63
|
+
// The eccentricity is a dimensionless number in [0, 1): its scale is 1, so a circular orbit
|
|
64
|
+
// (eccentricity 0) still takes the step 1·∛ε, the step every orbit took before the floor was stated.
|
|
65
|
+
stepFloors: { eccentricity: 1 },
|
|
63
66
|
};
|
|
64
67
|
/** Hawking temperature. Differentiable in mass. @public */
|
|
65
68
|
export const HAWKING_TEMPERATURE_DIFF = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-specs.js","sourceRoot":"","sources":["../../src/diff/bridge-specs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAyB;IACxD,IAAI,QAAQ,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,2BAA2B,QAAQ,CAAC,EAAE,mDAAmD,CAAC,CAAC;IAC7G,CAAC;IACD,OAAO,QAAQ,CAAC,SAAS,CAAC;AAC5B,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAc;IACxC,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7E,IAAI,KAAK,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,yCAAyC,MAAM,GAAG,CAAC,CAAC;IAC7F,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,eAAe,CAAC,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E,YAAY,EAAE,CAAC,EAAE;CAChC,CAAC;AAEF,2DAA2D;AAC3D,MAAM,CAAC,MAAM,wBAAwB,GAAiC;IACpE,QAAQ,EAAE,cAAc,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACnD,IAAI,EAAE,qBAAqB;IAC3B,UAAU,EAAE,CAAC,MAAM,CAAC;IACpB,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,OAAO,EAAE,KAAK,CAAC;CACrD,CAAC;AAEF,kFAAkF;AAClF,MAAM,CAAC,MAAM,qBAAqB,GAAqC;IACrE,QAAQ,EAAE,cAAc,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;IACvD,IAAI,EAAE,kBAAkB;IACxB,UAAU,EAAE,CAAC,cAAc,EAAE,QAAQ,EAAE,SAAS,CAAC;IACjD,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,WAAW,EAAE,KAAK,CAAC;CACzD,CAAC;AAEF,4DAA4D;AAC5D,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,kBAAkB;IAClB,uBAAuB;IACvB,wBAAwB;IACxB,qBAAqB;CACb,CAAC","sourcesContent":["/**\n * Differentiable relations projected from the catalog. The scalar is the\n * catalog expression. Parameter names are the relation's aliases.\n *\n * @module diff/bridge-specs\n */\n\nimport type { BridgeDiffSpec } from './bridge-gradient.js';\nimport { catalogEdgeKey, catalogRelations } from '../bridges/catalog-load.js';\nimport type { CatalogRelation } from '../bridges/catalog-types.js';\nimport { evaluateCatalogRelation } from '../bridges/relation-eval.js';\n\n/**\n * The catalog id a differentiable relation is labelled by. A relation with no\n * catalog id is not a catalog bridge and gets no `be-<n>` label; it throws\n * rather than defaulting to `be-0`.\n * @internal\n */\nexport function requireCatalogId(relation: CatalogRelation): number {\n if (relation.catalogId === null) {\n throw new Error(`bridge-specs: relation '${relation.id}' has no catalog id and cannot be labelled be-<n>`);\n }\n return relation.catalogId;\n}\n\nfunction relationWithSource(source: string): CatalogRelation {\n const found = catalogRelations().find((row) => row.sources.includes(source));\n if (found === undefined) throw new Error(`bridge-specs: no relation has source '${source}'`);\n return found;\n}\n\nfunction evaluateAliased(relation: CatalogRelation, input: object): number {\n const record = input as Record<string, number | undefined>;\n const bound: Record<string, number> = {};\n for (const source of relation.sources) {\n const alias = (relation.aliases[source] ?? []).find((key) => record[key] !== undefined);\n const key = alias ?? (record[source] !== undefined ? source : undefined);\n if (key === undefined) throw new Error(`${relation.id}: missing ${source}`);\n const value = record[key];\n if (value === undefined) throw new Error(`${relation.id}: missing ${source}`);\n bound[source] = value;\n }\n return evaluateCatalogRelation(relation, bound);\n}\n\n/** Inputs of {@link SHAPIRO_DELAY_DIFF}: the mass and the two radii. @public */\nexport interface ShapiroInput {\n readonly M_kg: number;\n readonly R_far_m: number;\n readonly R_near_m: number;\n}\n\n/** Inputs of {@link PERIHELION_ADVANCE_DIFF}: mass, semi-major axis, eccentricity, optional period. @public */\nexport interface PerihelionInput {\n readonly M_kg: number;\n readonly a_m: number;\n /** Orbital eccentricity, 0 ≤ e < 1. A bare `e` is the elementary charge, so it is not this key. */\n readonly eccentricity: number;\n readonly T_yr?: number;\n}\n\n/** Inputs of {@link HAWKING_TEMPERATURE_DIFF}: the mass. @public */\nexport interface HawkingInput {\n readonly M_kg: number;\n}\n\n/** Inputs of {@link DECOHERENCE_RATE_DIFF}: the rate and the two couplings. @public */\nexport interface DecoherenceInput {\n readonly gamma0_per_s: number;\n readonly lambda: number;\n readonly lambda0: number;\n}\n\nconst shapiro = relationWithSource('far-radius');\nconst perihelion = relationWithSource('semi-major-axis');\nconst hawking = catalogRelations().find(\n (row) => row.target === 'hawking-temperature' && row.sources.length === 1 && row.sources[0] === 'mass',\n);\nif (hawking === undefined) throw new Error('bridge-specs: no Hawking temperature relation');\nconst decoherence = relationWithSource('system-environment-coupling');\n\n/** Shapiro delay. Differentiable in mass and the two radii. @public */\nexport const SHAPIRO_DELAY_DIFF: BridgeDiffSpec<ShapiroInput> = {\n bridgeId: catalogEdgeKey(requireCatalogId(shapiro)),\n name: 'Shapiro time delay',\n paramNames: ['M_kg', 'R_far_m', 'R_near_m'],\n defaults: {},\n evaluate: (input) => evaluateAliased(shapiro, input),\n};\n\n/** Perihelion advance in radians per orbit. @public */\nexport const PERIHELION_ADVANCE_DIFF: BridgeDiffSpec<PerihelionInput> = {\n bridgeId: catalogEdgeKey(requireCatalogId(perihelion)),\n name: 'Perihelion advance (radian per orbit)',\n paramNames: ['M_kg', 'a_m', 'eccentricity'],\n defaults: {},\n evaluate: (input) => evaluateAliased(perihelion, input),\n // The eccentricity is a dimensionless number in [0, 1): its scale is 1, so a circular orbit\n // (eccentricity 0) still takes the step 1·∛ε, the step every orbit took before the floor was stated.\n stepFloors: { eccentricity: 1 },\n};\n\n/** Hawking temperature. Differentiable in mass. @public */\nexport const HAWKING_TEMPERATURE_DIFF: BridgeDiffSpec<HawkingInput> = {\n bridgeId: catalogEdgeKey(requireCatalogId(hawking)),\n name: 'Hawking temperature',\n paramNames: ['M_kg'],\n defaults: {},\n evaluate: (input) => evaluateAliased(hawking, input),\n};\n\n/** Decoherence rate. Differentiable in the rate and the two couplings. @public */\nexport const DECOHERENCE_RATE_DIFF: BridgeDiffSpec<DecoherenceInput> = {\n bridgeId: catalogEdgeKey(requireCatalogId(decoherence)),\n name: 'Decoherence rate',\n paramNames: ['gamma0_per_s', 'lambda', 'lambda0'],\n defaults: {},\n evaluate: (input) => evaluateAliased(decoherence, input),\n};\n\n/** Catalog relations this module differentiates. @public */\nexport const DIFFERENTIABLE_RELATIONS = [\n SHAPIRO_DELAY_DIFF,\n PERIHELION_ADVANCE_DIFF,\n HAWKING_TEMPERATURE_DIFF,\n DECOHERENCE_RATE_DIFF,\n] as const;\n"]}
|
|
@@ -17,6 +17,17 @@ import { Dimension } from './types.js';
|
|
|
17
17
|
* @public
|
|
18
18
|
*/
|
|
19
19
|
export { DimensionMismatchError } from './errors.js';
|
|
20
|
+
/** The seven SI bases, in the order every exponent list is written. @internal */
|
|
21
|
+
export declare const BASES: readonly ['L', 'M', 'T', 'I', 'Theta', 'N', 'J'];
|
|
22
|
+
/** Exact zero on every base; a base missing from a partial object reads as 0. @internal */
|
|
23
|
+
export declare function isDimensionless(d: Dimension): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Exact equality on every base, no tolerance: the predicate for exponents that
|
|
26
|
+
* were never computed. {@link equals} is the tolerant one for exponents that
|
|
27
|
+
* were (a fractional power reached by different op chains).
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export declare function exactlyEquals(a: Dimension, b: Dimension): boolean;
|
|
20
31
|
/** Product of two dimensions: exponents add per base. */
|
|
21
32
|
export declare function multiply(a: Dimension, b: Dimension): Dimension;
|
|
22
33
|
/** Quotient of two dimensions: exponents subtract per base. */
|
|
@@ -57,4 +68,11 @@ export declare function subtract(a: Dimension, b: Dimension): Dimension;
|
|
|
57
68
|
* Bases with exponent 0 are omitted; exponent 1 is written without "^1".
|
|
58
69
|
*/
|
|
59
70
|
export declare function format(d: Dimension): string;
|
|
71
|
+
/** Each base with its coherent SI unit, kilogram first (the order `siUnitOf` prints). @internal */
|
|
72
|
+
export declare const SI_BASE: readonly (readonly [keyof Dimension, string])[];
|
|
73
|
+
/**
|
|
74
|
+
* A dimension as SI base units, numerator before one `/` (`m^3/(kg*s^2)`), a bare denominator as
|
|
75
|
+
* negative powers (`s^-1`), and `1` when dimensionless: the forms `parseUnit` reads back.
|
|
76
|
+
*/
|
|
77
|
+
export declare function siUnitOf(dim: Dimension): string;
|
|
60
78
|
//# sourceMappingURL=algebra.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"algebra.d.ts","sourceRoot":"","sources":["../../src/dimensional/algebra.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAoB,MAAM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CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,GAAG,SAAS,CAS9D;AAED;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAgB3C;AAED,mGAAmG;AACnG,eAAO,MAAM,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,SAAS,EAAE,MAAM,CAAC,CAAC,EAQlE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM,CAQ/C"}
|
|
@@ -18,7 +18,21 @@ import { DimensionMismatchError } from './errors.js';
|
|
|
18
18
|
* @public
|
|
19
19
|
*/
|
|
20
20
|
export { DimensionMismatchError } from './errors.js';
|
|
21
|
-
|
|
21
|
+
/** The seven SI bases, in the order every exponent list is written. @internal */
|
|
22
|
+
export const BASES = ['L', 'M', 'T', 'I', 'Theta', 'N', 'J'];
|
|
23
|
+
/** Exact zero on every base; a base missing from a partial object reads as 0. @internal */
|
|
24
|
+
export function isDimensionless(d) {
|
|
25
|
+
return BASES.every((base) => (d[base] ?? 0) === 0);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Exact equality on every base, no tolerance: the predicate for exponents that
|
|
29
|
+
* were never computed. {@link equals} is the tolerant one for exponents that
|
|
30
|
+
* were (a fractional power reached by different op chains).
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export function exactlyEquals(a, b) {
|
|
34
|
+
return BASES.every((base) => (a[base] ?? 0) === (b[base] ?? 0));
|
|
35
|
+
}
|
|
22
36
|
/** Product of two dimensions: exponents add per base. */
|
|
23
37
|
export function multiply(a, b) {
|
|
24
38
|
const out = {};
|
|
@@ -116,4 +130,30 @@ export function format(d) {
|
|
|
116
130
|
return '[1]';
|
|
117
131
|
return `[${parts.join(' ')}]`;
|
|
118
132
|
}
|
|
133
|
+
/** Each base with its coherent SI unit, kilogram first (the order `siUnitOf` prints). @internal */
|
|
134
|
+
export const SI_BASE = [
|
|
135
|
+
['M', 'kg'],
|
|
136
|
+
['L', 'm'],
|
|
137
|
+
['T', 's'],
|
|
138
|
+
['I', 'A'],
|
|
139
|
+
['Theta', 'K'],
|
|
140
|
+
['N', 'mol'],
|
|
141
|
+
['J', 'cd'],
|
|
142
|
+
];
|
|
143
|
+
/**
|
|
144
|
+
* A dimension as SI base units, numerator before one `/` (`m^3/(kg*s^2)`), a bare denominator as
|
|
145
|
+
* negative powers (`s^-1`), and `1` when dimensionless: the forms `parseUnit` reads back.
|
|
146
|
+
*/
|
|
147
|
+
export function siUnitOf(dim) {
|
|
148
|
+
const factor = (u, e) => (e === 1 ? u : `${u}^${e}`);
|
|
149
|
+
const num = SI_BASE.filter(([k]) => dim[k] > 0).map(([k, u]) => factor(u, dim[k]));
|
|
150
|
+
const den = SI_BASE.filter(([k]) => dim[k] < 0).map(([k, u]) => factor(u, -dim[k]));
|
|
151
|
+
if (num.length === 0 && den.length === 0)
|
|
152
|
+
return '1';
|
|
153
|
+
if (num.length === 0)
|
|
154
|
+
return SI_BASE.filter(([k]) => dim[k] < 0).map(([k, u]) => factor(u, dim[k])).join('*');
|
|
155
|
+
if (den.length === 0)
|
|
156
|
+
return num.join('*');
|
|
157
|
+
return `${num.join('*')}/${den.length === 1 ? den[0] : `(${den.join('*')})`}`;
|
|
158
|
+
}
|
|
119
159
|
//# sourceMappingURL=algebra.js.map
|