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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gauge-field.js","sourceRoot":"","sources":["../../src/dimensional/gauge-field.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ACJ,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG;QAC3B,OAAO,EAAE,IAAI,CAAC,OAAO;KACtB,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Gauge-field AST primitives for Wheeler-Feynman absorber-theory\n * time-symmetric electrodynamics.\n *\n * Wheeler-Feynman absorber theory (Wheeler & Feynman 1945\n * Rev. Mod. Phys. 17:157; Wheeler & Feynman 1949\n * Rev. Mod. Phys. 21:425) uses TIME-SYMMETRIC electrodynamics:\n * radiation reaction arises from the half-retarded +\n * half-advanced potential combination\n *\n * A_μ(x) = (1/2) [A_μ^ret(x) + A_μ^adv(x)].\n *\n * Under the absorber boundary condition (every emitted disturbance\n * is fully absorbed by future matter), this symmetric form is\n * physically equivalent to retarded-only Maxwell.\n *\n * Two primitives are provided:\n *\n * 1. `GaugeFieldNode` — tags an EM gauge field with its\n * \"arrow of time\": retarded (Liénard-Wiechert advanced\n * Green's function), advanced (retarded Green's function\n * — past-directed), or symmetric (half-half combination).\n * The consumer supplies the dimension (SI: V·s/m =\n * { L:1, M:1, T:-2, I:-1 }) or works with the ratio which\n * is dimensionless.\n *\n * 2. `TimeSymmetryPredicateNode` — asserts that the\n * dimensionless time-symmetry residual\n * |A_ret − A_adv| / |A_ret + A_adv| is bounded by ε.\n * Identically 0 under the absorber boundary condition.\n * This is a PREDICATE node (like `EinsteinFieldEquationNode`)\n * — not a value-producing expression.\n *\n * Phase 1 demonstrator pattern: follows\n * `src/dimensional/klein-gordon-equation.ts` (field-equation-helpers\n * pattern, Phase 1 of TensorEquationNode generalization).\n *\n * @see docs/architecture/archive/v0.7-be-x-reencoding-design-note.md §BE-50\n * @module dimensional/gauge-field\n */\n\nimport type { Dimension } from './types.js';\nimport { validateComponentDimension } from './field-equation-helpers.js';\n\n// ---------------------------------------------------------------------------\n// GaugeFieldNode\n// ---------------------------------------------------------------------------\n\n/**\n * Arrow-of-time tag for an electromagnetic gauge potential.\n *\n * - `'retarded'` — propagator uses the retarded Green's function\n * (∝ Liénard-Wiechert advanced solution); causal, future-directed.\n * - `'advanced'` — propagator uses the advanced Green's function\n * (∝ Liénard-Wiechert retarded solution); anti-causal, past-directed.\n * - `'symmetric'` — half-retarded + half-advanced combination\n * (Wheeler-Feynman's A_μ = (1/2)[A_μ^ret + A_μ^adv]).\n *\n * @public\n */\nexport type ArrowOfTime = 'retarded' | 'advanced' | 'symmetric';\n\n/**\n * AST node for an electromagnetic gauge potential A_μ with an explicit\n * arrow-of-time tag.\n *\n * The `dim` field carries the SI dimension of the gauge field. For the\n * Wheeler-Feynman time-symmetry ratio, the dimension of the numerator\n * and denominator cancel, yielding a dimensionless result — but the\n * `dim` field is required so the validator can confirm that both the\n * retarded and advanced fields in a `TimeSymmetryPredicateNode` share\n * the same dimension (the ratio is well-defined only if they do).\n *\n * Canonical SI dim of the magnetic vector potential A_μ:\n * [A] = V·s/m = kg·m/(A·s²) = { L: 1, M: 1, T: -2, I: -1 }\n *\n * @public\n */\nexport interface GaugeFieldNode {\n /** Discriminator: `'gauge-field'`. */\n readonly kind: 'gauge-field';\n /** Human-readable field name (e.g., `'A_ret'`, `'A_adv'`, `'A_mu'`). */\n readonly name: string;\n /**\n * Arrow-of-time tag. Documents whether this field was computed using\n * the retarded Green's function, the advanced Green's function, or\n * the symmetric half-half combination.\n */\n readonly arrowOfTime: ArrowOfTime;\n /**\n * SI dimension of the gauge field. Both retarded and advanced fields\n * must share the same dimension for the time-symmetry ratio to be\n * well-defined (dimensionless by cancellation).\n */\n readonly dim: Dimension;\n}\n\n// ---------------------------------------------------------------------------\n// TimeSymmetryPredicateNode\n// ---------------------------------------------------------------------------\n\n/**\n * AST predicate node for the Wheeler-Feynman time-symmetry condition.\n *\n * Asserts that the dimensionless time-symmetry residual\n *\n * |A_ret − A_adv| / |A_ret + A_adv| ≤ ε\n *\n * is bounded by `epsilon`. Under the absorber boundary condition\n * (Wheeler & Feynman 1945), this residual is identically 0 on\n * physical states. A non-zero `epsilon` documents the allowable\n * deviation (e.g., a Cramer 1986 experimental bound of 10⁻²).\n *\n * This is a PREDICATE node (like `EinsteinFieldEquationNode`) —\n * not a value-producing expression. Numerical evaluation of the\n * residual for specific field amplitudes is out of scope; the catalog\n * relation be-50 that consumes this node has no numerical evaluator.\n *\n * @public\n */\nexport interface TimeSymmetryPredicateNode {\n /** Discriminator: `'time-symmetry-predicate'`. */\n readonly kind: 'time-symmetry-predicate';\n /**\n * The retarded gauge potential A_μ^ret.\n * Must have `arrowOfTime: 'retarded'`.\n */\n readonly retarded: GaugeFieldNode;\n /**\n * The advanced gauge potential A_μ^adv.\n * Must have `arrowOfTime: 'advanced'`.\n */\n readonly advanced: GaugeFieldNode;\n /**\n * Bound on the time-symmetry residual: |A_ret − A_adv| / |A_ret + A_adv| ≤ epsilon.\n * Must be strictly positive and finite.\n * Set to a small value (e.g., 1e-3) to encode an experimental bound,\n * or to `Number.EPSILON` to assert near-exact absorber-theory symmetry.\n */\n readonly epsilon: number;\n}\n\n// ---------------------------------------------------------------------------\n// Validators\n// ---------------------------------------------------------------------------\n\n/**\n * Validate a `GaugeFieldNode`.\n *\n * Three predicates:\n * 1. `name` must be a non-empty string.\n * 2. `arrowOfTime` must be one of `'retarded'`, `'advanced'`, `'symmetric'`.\n * 3. `dim` must be a valid `Dimension` object (all 7 SI exponents present\n * as finite numbers).\n *\n * Throws `Error` with `'gauge-field'` in the message on any failure.\n *\n * @public\n */\nexport function validateGaugeField(node: GaugeFieldNode): void {\n if (typeof node.name !== 'string' || node.name.trim().length === 0) {\n throw new Error(\n `GaugeFieldNode: gauge-field name must be a non-empty string ` +\n `(got ${JSON.stringify(node.name)}).`,\n );\n }\n\n const validArrows: ReadonlyArray<ArrowOfTime> = ['retarded', 'advanced', 'symmetric'];\n if (!validArrows.includes(node.arrowOfTime)) {\n throw new Error(\n `GaugeFieldNode: gauge-field arrowOfTime must be 'retarded', 'advanced', ` +\n `or 'symmetric' (got ${JSON.stringify(node.arrowOfTime)}).`,\n );\n }\n\n const dim = node.dim;\n const axes: ReadonlyArray<keyof Dimension> = ['L', 'M', 'T', 'I', 'Theta', 'N', 'J'];\n for (const ax of axes) {\n if (typeof dim[ax] !== 'number' || !Number.isFinite(dim[ax])) {\n throw new Error(\n `GaugeFieldNode: gauge-field dim.${ax} must be a finite number ` +\n `(got ${JSON.stringify(dim[ax])} for field '${node.name}').`,\n );\n }\n }\n}\n\n/**\n * Result of validating a `TimeSymmetryPredicateNode`.\n *\n * @public\n */\nexport interface TimeSymmetryPredicateValidationResult {\n /**\n * The shared dimension of the retarded and advanced gauge fields.\n * The ratio |A_ret − A_adv| / |A_ret + A_adv| is dimensionless\n * because this dimension cancels.\n */\n readonly fieldDim: Dimension;\n /** The validated epsilon bound (> 0, finite). */\n readonly epsilon: number;\n}\n\n/**\n * Validate a `TimeSymmetryPredicateNode`.\n *\n * Four predicates (following the field-equation-helpers pattern):\n *\n * 1. **Arrow-of-time tags** — `retarded.arrowOfTime` must be\n * `'retarded'`; `advanced.arrowOfTime` must be `'advanced'`.\n * 2. **Per-field validity** — both `GaugeFieldNode`s pass\n * `validateGaugeField`.\n * 3. **Dimension equality** — `retarded.dim` and `advanced.dim`\n * must match (so the ratio is dimensionless by cancellation).\n * Uses `validateComponentDimension` from field-equation-helpers.\n * 4. **Epsilon bound** — `epsilon` must be strictly positive and\n * finite (`epsilon > 0` and `Number.isFinite(epsilon)`).\n *\n * Error messages contain `'symmetry'` for arrow-of-time mismatches\n * and `'dimension'` for dim-equality failures (error-keyword\n * discipline shared with EinsteinFieldEquationNode and\n * KleinGordonEquationNode).\n *\n * @public\n */\nexport function validateTimeSymmetryPredicate(\n node: TimeSymmetryPredicateNode,\n): TimeSymmetryPredicateValidationResult {\n // Predicate 1a: retarded field's arrow-of-time must be 'retarded'.\n if (node.retarded.arrowOfTime !== 'retarded') {\n throw new Error(\n `TimeSymmetryPredicateNode: symmetry mismatch — retarded field ` +\n `'${node.retarded.name}' must have arrowOfTime: 'retarded' ` +\n `(got '${node.retarded.arrowOfTime}'). The time-symmetry predicate ` +\n `requires A_ret to carry the retarded arrow-of-time tag.`,\n );\n }\n\n // Predicate 1b: advanced field's arrow-of-time must be 'advanced'.\n if (node.advanced.arrowOfTime !== 'advanced') {\n throw new Error(\n `TimeSymmetryPredicateNode: symmetry mismatch — advanced field ` +\n `'${node.advanced.name}' must have arrowOfTime: 'advanced' ` +\n `(got '${node.advanced.arrowOfTime}'). The time-symmetry predicate ` +\n `requires A_adv to carry the advanced arrow-of-time tag.`,\n );\n }\n\n // Predicate 2: both GaugeFieldNodes pass individual validation.\n validateGaugeField(node.retarded);\n validateGaugeField(node.advanced);\n\n // Predicate 3: retarded.dim and advanced.dim must match.\n // Uses validateComponentDimension from field-equation-helpers — same\n // helper used by KleinGordonEquationNode and EinsteinFieldEquationNode.\n validateComponentDimension(\n 'TimeSymmetryPredicateNode',\n `advanced field '${node.advanced.name}' dim`,\n node.advanced.dim,\n node.retarded.dim,\n `A_ret and A_adv must share the same dimension so that the ratio ` +\n `|A_ret − A_adv| / |A_ret + A_adv| is dimensionless by cancellation.`,\n );\n\n // Predicate 4: epsilon must be strictly positive and finite.\n if (!Number.isFinite(node.epsilon) || node.epsilon <= 0) {\n throw new Error(\n `TimeSymmetryPredicateNode: epsilon must be a strictly positive finite ` +\n `number (got ${node.epsilon}). epsilon bounds the time-symmetry residual ` +\n `|A_ret − A_adv| / |A_ret + A_adv| ≤ epsilon.`,\n );\n }\n\n return {\n fieldDim: node.retarded.dim,\n epsilon: node.epsilon,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"gauge-field.js","sourceRoot":"","sources":["../../src/dimensional/gauge-field.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAoGzE,8EAA8E;AAC9E,aAA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wheeler-Feynman absorber theory (Wheeler & Feynman 1945\n * Rev. Mod. Phys. 17:157; Wheeler & Feynman 1949\n * Rev. Mod. Phys. 21:425) uses TIME-SYMMETRIC electrodynamics:\n * radiation reaction arises from the half-retarded +\n * half-advanced potential combination\n *\n * A_μ(x) = (1/2) [A_μ^ret(x) + A_μ^adv(x)].\n *\n * Under the absorber boundary condition (every emitted disturbance\n * is fully absorbed by future matter), this symmetric form is\n * physically equivalent to retarded-only Maxwell.\n *\n * Two primitives are provided:\n *\n * 1. `GaugeFieldNode` — tags an EM gauge field with its\n * \"arrow of time\": retarded (Liénard-Wiechert advanced\n * Green's function), advanced (retarded Green's function\n * — past-directed), or symmetric (half-half combination).\n * The consumer supplies the dimension (SI: V·s/m =\n * { L:1, M:1, T:-2, I:-1 }) or works with the ratio which\n * is dimensionless.\n *\n * 2. `TimeSymmetryPredicateNode` — asserts that the\n * dimensionless time-symmetry residual\n * |A_ret − A_adv| / |A_ret + A_adv| is bounded by ε.\n * Identically 0 under the absorber boundary condition.\n * This is a PREDICATE node (like `EinsteinFieldEquationNode`)\n * — not a value-producing expression.\n *\n * Phase 1 demonstrator pattern: follows\n * `src/dimensional/klein-gordon-equation.ts` (field-equation-helpers\n * pattern, Phase 1 of TensorEquationNode generalization).\n *\n * @see docs/architecture/archive/v0.7-be-x-reencoding-design-note.md §BE-50\n * @module dimensional/gauge-field\n */\n\nimport type { Dimension } from './types.js';\nimport { BASES } from './algebra.js';\nimport { validateComponentDimension } from './field-equation-helpers.js';\n\n// ---------------------------------------------------------------------------\n// GaugeFieldNode\n// ---------------------------------------------------------------------------\n\n/**\n * Arrow-of-time tag for an electromagnetic gauge potential.\n *\n * - `'retarded'` — propagator uses the retarded Green's function\n * (∝ Liénard-Wiechert advanced solution); causal, future-directed.\n * - `'advanced'` — propagator uses the advanced Green's function\n * (∝ Liénard-Wiechert retarded solution); anti-causal, past-directed.\n * - `'symmetric'` — half-retarded + half-advanced combination\n * (Wheeler-Feynman's A_μ = (1/2)[A_μ^ret + A_μ^adv]).\n *\n * @public\n */\nexport type ArrowOfTime = 'retarded' | 'advanced' | 'symmetric';\n\n/**\n * AST node for an electromagnetic gauge potential A_μ with an explicit\n * arrow-of-time tag.\n *\n * The `dim` field carries the SI dimension of the gauge field. For the\n * Wheeler-Feynman time-symmetry ratio, the dimension of the numerator\n * and denominator cancel, yielding a dimensionless result — but the\n * `dim` field is required so the validator can confirm that both the\n * retarded and advanced fields in a `TimeSymmetryPredicateNode` share\n * the same dimension (the ratio is well-defined only if they do).\n *\n * Canonical SI dim of the magnetic vector potential A_μ:\n * [A] = V·s/m = kg·m/(A·s²) = { L: 1, M: 1, T: -2, I: -1 }\n *\n * @public\n */\nexport interface GaugeFieldNode {\n /** Discriminator: `'gauge-field'`. */\n readonly kind: 'gauge-field';\n /** Human-readable field name (e.g., `'A_ret'`, `'A_adv'`, `'A_mu'`). */\n readonly name: string;\n /**\n * Arrow-of-time tag. Documents whether this field was computed using\n * the retarded Green's function, the advanced Green's function, or\n * the symmetric half-half combination.\n */\n readonly arrowOfTime: ArrowOfTime;\n /**\n * SI dimension of the gauge field. Both retarded and advanced fields\n * must share the same dimension for the time-symmetry ratio to be\n * well-defined (dimensionless by cancellation).\n */\n readonly dim: Dimension;\n}\n\n// ---------------------------------------------------------------------------\n// TimeSymmetryPredicateNode\n// ---------------------------------------------------------------------------\n\n/**\n * AST predicate node for the Wheeler-Feynman time-symmetry condition.\n *\n * Asserts that the dimensionless time-symmetry residual\n *\n * |A_ret − A_adv| / |A_ret + A_adv| ≤ ε\n *\n * is bounded by `epsilon`. Under the absorber boundary condition\n * (Wheeler & Feynman 1945), this residual is identically 0 on\n * physical states. A non-zero `epsilon` documents the allowable\n * deviation (e.g., a Cramer 1986 experimental bound of 10⁻²).\n *\n * This is a PREDICATE node (like `EinsteinFieldEquationNode`) —\n * not a value-producing expression. Numerical evaluation of the\n * residual for specific field amplitudes is out of scope; the catalog\n * relation be-50 that consumes this node has no numerical evaluator.\n *\n * @public\n */\nexport interface TimeSymmetryPredicateNode {\n /** Discriminator: `'time-symmetry-predicate'`. */\n readonly kind: 'time-symmetry-predicate';\n /**\n * The retarded gauge potential A_μ^ret.\n * Must have `arrowOfTime: 'retarded'`.\n */\n readonly retarded: GaugeFieldNode;\n /**\n * The advanced gauge potential A_μ^adv.\n * Must have `arrowOfTime: 'advanced'`.\n */\n readonly advanced: GaugeFieldNode;\n /**\n * Bound on the time-symmetry residual: |A_ret − A_adv| / |A_ret + A_adv| ≤ epsilon.\n * Must be strictly positive and finite.\n * Set to a small value (e.g., 1e-3) to encode an experimental bound,\n * or to `Number.EPSILON` to assert near-exact absorber-theory symmetry.\n */\n readonly epsilon: number;\n}\n\n// ---------------------------------------------------------------------------\n// Validators\n// ---------------------------------------------------------------------------\n\n/**\n * Validate a `GaugeFieldNode`.\n *\n * Three predicates:\n * 1. `name` must be a non-empty string.\n * 2. `arrowOfTime` must be one of `'retarded'`, `'advanced'`, `'symmetric'`.\n * 3. `dim` must be a valid `Dimension` object (all 7 SI exponents present\n * as finite numbers).\n *\n * Throws `Error` with `'gauge-field'` in the message on any failure.\n *\n * @public\n */\nexport function validateGaugeField(node: GaugeFieldNode): void {\n if (typeof node.name !== 'string' || node.name.trim().length === 0) {\n throw new Error(\n `GaugeFieldNode: gauge-field name must be a non-empty string ` +\n `(got ${JSON.stringify(node.name)}).`,\n );\n }\n\n const validArrows: ReadonlyArray<ArrowOfTime> = ['retarded', 'advanced', 'symmetric'];\n if (!validArrows.includes(node.arrowOfTime)) {\n throw new Error(\n `GaugeFieldNode: gauge-field arrowOfTime must be 'retarded', 'advanced', ` +\n `or 'symmetric' (got ${JSON.stringify(node.arrowOfTime)}).`,\n );\n }\n\n const dim = node.dim;\n for (const ax of BASES) {\n if (typeof dim[ax] !== 'number' || !Number.isFinite(dim[ax])) {\n throw new Error(\n `GaugeFieldNode: gauge-field dim.${ax} must be a finite number ` +\n `(got ${JSON.stringify(dim[ax])} for field '${node.name}').`,\n );\n }\n }\n}\n\n/**\n * Result of validating a `TimeSymmetryPredicateNode`.\n *\n * @public\n */\nexport interface TimeSymmetryPredicateValidationResult {\n /**\n * The shared dimension of the retarded and advanced gauge fields.\n * The ratio |A_ret − A_adv| / |A_ret + A_adv| is dimensionless\n * because this dimension cancels.\n */\n readonly fieldDim: Dimension;\n /** The validated epsilon bound (> 0, finite). */\n readonly epsilon: number;\n}\n\n/**\n * Validate a `TimeSymmetryPredicateNode`.\n *\n * Four predicates (following the field-equation-helpers pattern):\n *\n * 1. **Arrow-of-time tags** — `retarded.arrowOfTime` must be\n * `'retarded'`; `advanced.arrowOfTime` must be `'advanced'`.\n * 2. **Per-field validity** — both `GaugeFieldNode`s pass\n * `validateGaugeField`.\n * 3. **Dimension equality** — `retarded.dim` and `advanced.dim`\n * must match (so the ratio is dimensionless by cancellation).\n * Uses `validateComponentDimension` from field-equation-helpers.\n * 4. **Epsilon bound** — `epsilon` must be strictly positive and\n * finite (`epsilon > 0` and `Number.isFinite(epsilon)`).\n *\n * Error messages contain `'symmetry'` for arrow-of-time mismatches\n * and `'dimension'` for dim-equality failures (error-keyword\n * discipline shared with EinsteinFieldEquationNode and\n * KleinGordonEquationNode).\n *\n * @public\n */\nexport function validateTimeSymmetryPredicate(\n node: TimeSymmetryPredicateNode,\n): TimeSymmetryPredicateValidationResult {\n // Predicate 1a: retarded field's arrow-of-time must be 'retarded'.\n if (node.retarded.arrowOfTime !== 'retarded') {\n throw new Error(\n `TimeSymmetryPredicateNode: symmetry mismatch — retarded field ` +\n `'${node.retarded.name}' must have arrowOfTime: 'retarded' ` +\n `(got '${node.retarded.arrowOfTime}'). The time-symmetry predicate ` +\n `requires A_ret to carry the retarded arrow-of-time tag.`,\n );\n }\n\n // Predicate 1b: advanced field's arrow-of-time must be 'advanced'.\n if (node.advanced.arrowOfTime !== 'advanced') {\n throw new Error(\n `TimeSymmetryPredicateNode: symmetry mismatch — advanced field ` +\n `'${node.advanced.name}' must have arrowOfTime: 'advanced' ` +\n `(got '${node.advanced.arrowOfTime}'). The time-symmetry predicate ` +\n `requires A_adv to carry the advanced arrow-of-time tag.`,\n );\n }\n\n // Predicate 2: both GaugeFieldNodes pass individual validation.\n validateGaugeField(node.retarded);\n validateGaugeField(node.advanced);\n\n // Predicate 3: retarded.dim and advanced.dim must match.\n // Uses validateComponentDimension from field-equation-helpers — same\n // helper used by KleinGordonEquationNode and EinsteinFieldEquationNode.\n validateComponentDimension(\n 'TimeSymmetryPredicateNode',\n `advanced field '${node.advanced.name}' dim`,\n node.advanced.dim,\n node.retarded.dim,\n `A_ret and A_adv must share the same dimension so that the ratio ` +\n `|A_ret − A_adv| / |A_ret + A_adv| is dimensionless by cancellation.`,\n );\n\n // Predicate 4: epsilon must be strictly positive and finite.\n if (!Number.isFinite(node.epsilon) || node.epsilon <= 0) {\n throw new Error(\n `TimeSymmetryPredicateNode: epsilon must be a strictly positive finite ` +\n `number (got ${node.epsilon}). epsilon bounds the time-symmetry residual ` +\n `|A_ret − A_adv| / |A_ret + A_adv| ≤ epsilon.`,\n );\n }\n\n return {\n fieldDim: node.retarded.dim,\n epsilon: node.epsilon,\n };\n}\n"]}
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Kebab catalog names are one token. A parser that treats `-` as subtraction
|
|
3
|
-
* splits them.
|
|
4
|
-
* shorter one
|
|
3
|
+
* splits them. Leftmost longest match, so a longer declared name or constant
|
|
4
|
+
* spelling wins over a shorter one inside it.
|
|
5
5
|
*
|
|
6
6
|
* @module dimensional/hyphen-names
|
|
7
7
|
*/
|
|
8
|
+
/** `s` with every regular-expression metacharacter escaped, so it matches itself. @internal */
|
|
9
|
+
export declare function escapeRegExp(s: string): string;
|
|
8
10
|
/**
|
|
9
11
|
* Rewrite declared kebab-case names to underscores. Names without a hyphen
|
|
10
12
|
* stay. A hyphen that is not a declared name stays subtraction.
|
|
13
|
+
*
|
|
14
|
+
* Each hyphenated word is scanned left to right, segment by segment; at each
|
|
15
|
+
* segment the longest run of segments that is a declared name (written with
|
|
16
|
+
* underscores) or a registered constant's hyphenated spelling (written as the
|
|
17
|
+
* constant's primary name: `speed-of-light` is `c`) is taken, a declared name
|
|
18
|
+
* before a constant spelling of the same length. So a declared name inside a
|
|
19
|
+
* longer constant spelling does not win: `reduced-planck-constant` is `hbar`,
|
|
20
|
+
* not `reduced - planck_constant`.
|
|
11
21
|
*/
|
|
12
22
|
export declare function rewriteCatalogHyphens(text: string, catalogNames: ReadonlySet<string> | Iterable<string>): string;
|
|
13
23
|
//# sourceMappingURL=hyphen-names.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hyphen-names.d.ts","sourceRoot":"","sources":["../../src/dimensional/hyphen-names.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"hyphen-names.d.ts","sourceRoot":"","sources":["../../src/dimensional/hyphen-names.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,+FAA+F;AAC/F,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE9C;AAKD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,GACnD,MAAM,CAGR"}
|
|
@@ -1,35 +1,60 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Kebab catalog names are one token. A parser that treats `-` as subtraction
|
|
3
|
-
* splits them.
|
|
4
|
-
* shorter one
|
|
3
|
+
* splits them. Leftmost longest match, so a longer declared name or constant
|
|
4
|
+
* spelling wins over a shorter one inside it.
|
|
5
5
|
*
|
|
6
6
|
* @module dimensional/hyphen-names
|
|
7
7
|
*/
|
|
8
8
|
import { constantRecord } from './symbolic-constants.js';
|
|
9
|
-
|
|
9
|
+
/** `s` with every regular-expression metacharacter escaped, so it matches itself. @internal */
|
|
10
|
+
export function escapeRegExp(s) {
|
|
10
11
|
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
11
12
|
}
|
|
13
|
+
/** A hyphenated spelling a registered constant could have: letters and digits, no underscore. */
|
|
14
|
+
const CONSTANT_SPELLING = /^[A-Za-z][A-Za-z0-9]*(?:-[A-Za-z0-9]+)+$/;
|
|
12
15
|
/**
|
|
13
16
|
* Rewrite declared kebab-case names to underscores. Names without a hyphen
|
|
14
17
|
* stay. A hyphen that is not a declared name stays subtraction.
|
|
18
|
+
*
|
|
19
|
+
* Each hyphenated word is scanned left to right, segment by segment; at each
|
|
20
|
+
* segment the longest run of segments that is a declared name (written with
|
|
21
|
+
* underscores) or a registered constant's hyphenated spelling (written as the
|
|
22
|
+
* constant's primary name: `speed-of-light` is `c`) is taken, a declared name
|
|
23
|
+
* before a constant spelling of the same length. So a declared name inside a
|
|
24
|
+
* longer constant spelling does not win: `reduced-planck-constant` is `hbar`,
|
|
25
|
+
* not `reduced - planck_constant`.
|
|
15
26
|
*/
|
|
16
27
|
export function rewriteCatalogHyphens(text, catalogNames) {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
const declared = new Set([...catalogNames].filter((n) => n.includes('-')));
|
|
29
|
+
return text.replace(/[A-Za-z0-9_]+(?:-[A-Za-z0-9_]+)+/g, (word) => rewriteWord(word, declared));
|
|
30
|
+
}
|
|
31
|
+
/** One hyphenated word, rewritten by the leftmost-longest segment scan. */
|
|
32
|
+
function rewriteWord(word, declared) {
|
|
33
|
+
const segments = word.split('-');
|
|
34
|
+
const out = [];
|
|
35
|
+
let i = 0;
|
|
36
|
+
while (i < segments.length) {
|
|
37
|
+
let taken;
|
|
38
|
+
for (let end = segments.length; end > i + 1 && taken === undefined; end--) {
|
|
39
|
+
const candidate = segments.slice(i, end).join('-');
|
|
40
|
+
if (declared.has(candidate)) {
|
|
41
|
+
taken = { end, token: candidate.replace(/-/g, '_') };
|
|
42
|
+
}
|
|
43
|
+
else if (CONSTANT_SPELLING.test(candidate)) {
|
|
44
|
+
const record = constantRecord(candidate);
|
|
45
|
+
if (record !== undefined)
|
|
46
|
+
taken = { end, token: record.name };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (taken === undefined) {
|
|
50
|
+
out.push(segments[i]);
|
|
51
|
+
i += 1;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
out.push(taken.token);
|
|
55
|
+
i = taken.end;
|
|
56
|
+
}
|
|
25
57
|
}
|
|
26
|
-
|
|
27
|
-
// primary name (`c`), whether or not the caller declared it: the formula then reads the baked
|
|
28
|
-
// value, and the hyphens are not subtractions.
|
|
29
|
-
out = out.replace(/(?<![A-Za-z0-9_])[A-Za-z][A-Za-z0-9]*(?:-[A-Za-z0-9]+)+(?![A-Za-z0-9_])/g, (word) => {
|
|
30
|
-
const record = constantRecord(word);
|
|
31
|
-
return record === undefined ? word : record.name;
|
|
32
|
-
});
|
|
33
|
-
return out;
|
|
58
|
+
return out.join('-');
|
|
34
59
|
}
|
|
35
60
|
//# sourceMappingURL=hyphen-names.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hyphen-names.js","sourceRoot":"","sources":["../../src/dimensional/hyphen-names.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,
|
|
1
|
+
{"version":3,"file":"hyphen-names.js","sourceRoot":"","sources":["../../src/dimensional/hyphen-names.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,+FAA+F;AAC/F,MAAM,UAAU,YAAY,CAAC,CAAS;IACpC,OAAO,CAAC,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC;AAED,iGAAiG;AACjG,MAAM,iBAAiB,GAA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C,CAAC;gBACzC,IAAI,MAAM,KAAK,SAAS;oBAAE,KAAK,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;YAChE,CAAC;QACH,CAAC;QACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAE,CAAC,CAAC;YACvB,CAAC,IAAI,CAAC,CAAC;QACT,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC;QAChB,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC","sourcesContent":["/**\n * Kebab catalog names are one token. A parser that treats `-` as subtraction\n * splits them. Leftmost longest match, so a longer declared name or constant\n * spelling wins over a shorter one inside it.\n *\n * @module dimensional/hyphen-names\n */\n\nimport { constantRecord } from './symbolic-constants.js';\n\n/** `s` with every regular-expression metacharacter escaped, so it matches itself. @internal */\nexport function escapeRegExp(s: string): string {\n return s.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\n/** A hyphenated spelling a registered constant could have: letters and digits, no underscore. */\nconst CONSTANT_SPELLING = /^[A-Za-z][A-Za-z0-9]*(?:-[A-Za-z0-9]+)+$/;\n\n/**\n * Rewrite declared kebab-case names to underscores. Names without a hyphen\n * stay. A hyphen that is not a declared name stays subtraction.\n *\n * Each hyphenated word is scanned left to right, segment by segment; at each\n * segment the longest run of segments that is a declared name (written with\n * underscores) or a registered constant's hyphenated spelling (written as the\n * constant's primary name: `speed-of-light` is `c`) is taken, a declared name\n * before a constant spelling of the same length. So a declared name inside a\n * longer constant spelling does not win: `reduced-planck-constant` is `hbar`,\n * not `reduced - planck_constant`.\n */\nexport function rewriteCatalogHyphens(\n text: string,\n catalogNames: ReadonlySet<string> | Iterable<string>,\n): string {\n const declared = new Set([...catalogNames].filter((n) => n.includes('-')));\n return text.replace(/[A-Za-z0-9_]+(?:-[A-Za-z0-9_]+)+/g, (word) => rewriteWord(word, declared));\n}\n\n/** One hyphenated word, rewritten by the leftmost-longest segment scan. */\nfunction rewriteWord(word: string, declared: ReadonlySet<string>): string {\n const segments = word.split('-');\n const out: string[] = [];\n let i = 0;\n while (i < segments.length) {\n let taken: { readonly end: number; readonly token: string } | undefined;\n for (let end = segments.length; end > i + 1 && taken === undefined; end--) {\n const candidate = segments.slice(i, end).join('-');\n if (declared.has(candidate)) {\n taken = { end, token: candidate.replace(/-/g, '_') };\n } else if (CONSTANT_SPELLING.test(candidate)) {\n const record = constantRecord(candidate);\n if (record !== undefined) taken = { end, token: record.name };\n }\n }\n if (taken === undefined) {\n out.push(segments[i]!);\n i += 1;\n } else {\n out.push(taken.token);\n i = taken.end;\n }\n }\n return out.join('-');\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metric.d.ts","sourceRoot":"","sources":["../../src/dimensional/metric.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAClB,2BAA2B,EAC3B,cAAc,EACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI/C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,EACnC,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,MAAM,EACjB,kBAAkB,CAAC,EAAE,UAAU,GAAG,MAAM,G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AE,CAAC,CAAC,IAAI;QACZ,OAAO,EAAE;YACP,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE;YAC5B,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE;SACtC;QACD,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,GAAG,EAAE,CAAC,CAAC,GAAG;KACX,CAAC;IACF,IAAI,CAAC,CAAC,kBAAkB,KAAK,SAAS,EAAE,CAAC;QACtC,QAAgE,CAAC,kBAAkB;YAClF,CAAC,CAAC,kBAAkB,CAAC;IACzB,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC;AAC/D,CAAC","sourcesContent":["/**\n * User-facing constructors and ergonomic helpers for v0.3.0 metric-layer\n * AST nodes. The substantive logic (alpha-conversion) lives in raise() /\n * lower() (added in Task 8 — this file's initial revision contains only\n * the trivial constructors).\n *\n * Per docs/specification/Part-VIII-Metric-Layer.md §VIII.5 (raise/lower\n * contract) and §VIII.1 (grammar).\n *\n * @module dimensional/metric\n */\n\nimport type { Dimension } from './types.js';\nimport { DIMENSIONLESS } from './types.js';\nimport { freshLabel } from './fresh-label.js';\nimport type { TensorIndex } from './tensor.js';\nimport type { TensorProductNode } from './tensor.js';\nimport type {\n MetricTensorNode,\n KroneckerDeltaNode,\n TensorPartialDerivativeNode,\n CovariantIndex,\n} from './metric-validators.js';\nimport type { ExprNode } from './validator.js';\nimport { validate } from './validator.js';\nimport { MetricSignatureError, UPTError } from './errors.js';\n\n/**\n * Construct a metric-tensor node.\n *\n * @param name Symbolic name of the metric (e.g. `'g'`).\n * @param indices Exactly two TensorIndex entries (rank-2 requirement).\n * @param dim Physical dimension of the metric components.\n * @param signature Comma-separated `'+'`/`'-'` signs (e.g. `'+,-,-,-'`).\n * @param derivativeStrategy Optional hint for the numerical engine:\n * how to compute ∂g for Christoffel / ∇_μ. `'zero'` = constant metric\n * (∂g=0, Γ=0, ∇_μ=∂_μ); `'supplied'` = caller provides ∂g components;\n * `'computed'` (the default) = the lowering treats a raw-tensor metric\n * input as constant (∂g=0) — nothing is auto-differentiated. Metric\n * closures in `inputs.fields` take the curvature paths, which\n * finite-difference the closures.\n * Omit to leave the field absent (engine defaults to `'computed'`).\n */\nexport function metric(\n name: string,\n indices: ReadonlyArray<TensorIndex>,\n dim: Dimension,\n signature: string,\n derivativeStrategy?: 'computed' | 'zero' | 'supplied',\n): MetricTensorNode {\n const node: {\n kind: 'metric-tensor';\n name: string;\n indices: ReadonlyArray<TensorIndex>;\n signature: string;\n dim: Dimension;\n derivativeStrategy?: 'computed' | 'zero' | 'supplied';\n } = { kind: 'metric-tensor', name, indices, signature, dim };\n if (derivativeStrategy !== undefined) node.derivativeStrategy = derivativeStrategy;\n return node;\n}\n\n/**\n * Construct a Kronecker delta δ^upperLabel_lowerLabel.\n * Parameter order: upper first, lower second (canonical δ^μ_ν).\n * dim defaults to DIMENSIONLESS (Design §13 Q3 locked).\n */\nexport function kronecker(\n upperLabel: string,\n lowerLabel: string,\n dim: Dimension = DIMENSIONLESS,\n): KroneckerDeltaNode {\n return {\n kind: 'kronecker-delta',\n indices: [\n { label: upperLabel, variance: 'upper' },\n { label: lowerLabel, variance: 'lower' },\n ],\n dim,\n };\n}\n\n/**\n * Construct a tensor-partial-derivative. wrtIndex.variance MUST be 'lower'\n * — TypeScript enforces this via the CovariantIndex type.\n */\nexport function pderiv(\n of: ExprNode,\n wrt: ExprNode,\n wrtIndex: CovariantIndex,\n): TensorPartialDerivativeNode {\n return { kind: 'tensor-partial-derivative', of, wrt, wrtIndex };\n}\n\n/** Thrown by raise() / lower() when the operand's label is absent or has\n * the wrong variance for the requested operation. Private to this module\n * (not part of the public error surface per Design §6). */\nclass RaiseLowerInvalidLabelError extends UPTError {\n constructor(message: string) {\n super(message);\n this.name = 'RaiseLowerInvalidLabelError';\n Object.setPrototypeOf(this, RaiseLowerInvalidLabelError.prototype);\n }\n}\n\n/**\n * Collect free-index labels from an ExprNode by calling validate(). Returns\n * a map from label → variance (whichever side has count > 0). Note: this\n * performs a full subtree validation on `operand`; cost is acceptable for\n * typical raise/lower call sites (operand is a small subtree).\n */\nfunction collectFreeIndexLabels(node: ExprNode): Map<string, 'upper' | 'lower'> {\n const result = validate(node);\n const labels = new Map<string, 'upper' | 'lower'>();\n for (const [label, counts] of result.freeIndices) {\n if (counts.upper > 0) labels.set(label, 'upper');\n else if (counts.lower > 0) labels.set(label, 'lower');\n }\n return labels;\n}\n\n/**\n * Raise an index of `operand` via the inverse metric `gInverse`.\n *\n * Internal alpha-conversion: one of `gInverse`'s labels is renamed to\n * match `label` (so the Einstein-summation contraction picks it up);\n * the other is renamed to a fresh label that doesn't collide with any\n * free index in `operand`. The fresh label becomes the resulting\n * tensor-product's only new free index.\n *\n * Per Part-VIII §VIII.5 (raise/lower contract).\n *\n * Throws:\n * - MetricSignatureError if gInverse isn't both-upper\n * - RaiseLowerInvalidLabelError if label is absent or already upper in operand\n */\nexport function raise(\n operand: ExprNode,\n gInverse: MetricTensorNode,\n label: string,\n): TensorProductNode {\n if (\n gInverse.indices[0].variance !== 'upper' ||\n gInverse.indices[1].variance !== 'upper'\n ) {\n throw new MetricSignatureError(\n gInverse.name,\n `raise() requires both indices of the inverse metric to have variance 'upper'`,\n );\n }\n const operandLabels = collectFreeIndexLabels(operand);\n const operandVariance = operandLabels.get(label);\n if (operandVariance === undefined) {\n throw new RaiseLowerInvalidLabelError(\n `raise(): label '${label}' is not a free index of the operand. ` +\n `Operand free indices: ${Array.from(operandLabels.keys()).join(', ') || '(none)'}.`,\n );\n }\n if (operandVariance === 'upper') {\n throw new RaiseLowerInvalidLabelError(\n `raise(): label '${label}' is already 'upper' in the operand. ` +\n `Use lower() to lower it, or pick a different label.`,\n );\n }\n\n // Alpha-conversion: rename gInverse[0] → label (the dummy that contracts);\n // gInverse[1] → freshLabel(gInverse[1].label, operand-free-labels).\n const taken = new Set(operandLabels.keys());\n taken.add(label);\n const renamed = freshLabel(gInverse.indices[1].label, taken);\n\n const renamedGInverse: MetricTensorNode = {\n kind: 'metric-tensor',\n name: gInverse.name,\n indices: [\n { label, variance: 'upper' },\n { label: renamed, variance: 'upper' },\n ],\n signature: gInverse.signature,\n dim: gInverse.dim,\n };\n if (gInverse.derivativeStrategy !== undefined) {\n (renamedGInverse as { derivativeStrategy: typeof gInverse.derivativeStrategy }).derivativeStrategy =\n gInverse.derivativeStrategy;\n }\n\n return { kind: 'tensor-product', args: [renamedGInverse, operand] };\n}\n\n/**\n * Lower an index of `operand` via the covariant metric `g`.\n * Symmetric to raise(). Per Part-VIII §VIII.5.\n *\n * Throws:\n * - MetricSignatureError if g isn't both-lower\n * - RaiseLowerInvalidLabelError if label is absent or already lower in operand\n */\nexport function lower(\n operand: ExprNode,\n g: MetricTensorNode,\n label: string,\n): TensorProductNode {\n if (\n g.indices[0].variance !== 'lower' ||\n g.indices[1].variance !== 'lower'\n ) {\n throw new MetricSignatureError(\n g.name,\n `lower() requires both indices of the metric to have variance 'lower'`,\n );\n }\n const operandLabels = collectFreeIndexLabels(operand);\n const operandVariance = operandLabels.get(label);\n if (operandVariance === undefined) {\n throw new RaiseLowerInvalidLabelError(\n `lower(): label '${label}' is not a free index of the operand. ` +\n `Operand free indices: ${Array.from(operandLabels.keys()).join(', ') || '(none)'}.`,\n );\n }\n if (operandVariance === 'lower') {\n throw new RaiseLowerInvalidLabelError(\n `lower(): label '${label}' is already 'lower' in the operand. ` +\n `Use raise() to raise it, or pick a different label.`,\n );\n }\n\n const taken = new Set(operandLabels.keys());\n taken.add(label);\n const renamed = freshLabel(g.indices[1].label, taken);\n\n const renamedG: MetricTensorNode = {\n kind: 'metric-tensor',\n name: g.name,\n indices: [\n { label, variance: 'lower' },\n { label: renamed, variance: 'lower' },\n ],\n signature: g.signature,\n dim: g.dim,\n };\n if (g.derivativeStrategy !== undefined) {\n (renamedG as { derivativeStrategy: typeof g.derivativeStrategy }).derivativeStrategy =\n g.derivativeStrategy;\n }\n\n return { kind: 'tensor-product', args: [renamedG, operand] };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"metric.js","sourceRoot":"","sources":["../../src/dimensional/metric.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAU9C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE7D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,MAAM,CACpB,IAAY,EACZ,OAAmC,EACnC,GAAc,EACd,SAAiB,EACjB,kBAAqD;IAErD,MAAM,IAAI,GAON,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;IAC7D,IAAI,kBAAkB,KAAK,SAAS;QAAE,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IACnF,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CACvB,UAAkB,EAClB,UAAkB,EAClB,GAAG,GAAc,aAAa;IAE9B,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE;YACP,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE;YACxC,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE;SACzC;QACD,GAAG;KACJ,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,MAAM,CACpB,EAAY,EACZ,GAAa,EACb,QAAwB;IAExB,OAAO,EAAE,IAAI,EAAE,2BAA2B,EAAE,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAClE,CAAC;AAED;;4DAE4D;AAC5D,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tC,QAAgE,CAAC,kBAAkB;YAClF,CAAC,CAAC,kBAAkB,CAAC;IACzB,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC;AAC/D,CAAC","sourcesContent":["/**\n * User-facing constructors and ergonomic helpers for v0.3.0 metric-layer\n * AST nodes. The substantive logic (alpha-conversion) lives in raise() /\n * lower() (added in Task 8 — this file's initial revision contains only\n * the trivial constructors).\n *\n * Per docs/specification/Part-VIII-Metric-Layer.md §VIII.5 (raise/lower\n * contract) and §VIII.1 (grammar).\n *\n * @module dimensional/metric\n */\n\nimport type { Dimension } from './types.js';\nimport { DIMENSIONLESS } from './types.js';\nimport { freshLabel } from './fresh-label.js';\nimport type { TensorIndex } from './tensor.js';\nimport type { TensorProductNode } from './tensor.js';\nimport type {\n MetricTensorNode,\n KroneckerDeltaNode,\n TensorPartialDerivativeNode,\n CovariantIndex,\n} from './metric-validators.js';\nimport type { ExprNode } from './validator.js';\nimport { validate } from './validator.js';\nimport { MetricSignatureError, UPTError } from './errors.js';\n\n/**\n * Construct a metric-tensor node.\n *\n * @param name Symbolic name of the metric (e.g. `'g'`).\n * @param indices Exactly two TensorIndex entries (rank-2 requirement).\n * @param dim Physical dimension of the metric components.\n * @param signature Comma-separated `'+'`/`'-'` signs (e.g. `'+,-,-,-'`).\n * @param derivativeStrategy Optional hint for the numerical engine:\n * how to compute ∂g for Christoffel / ∇_μ. `'zero'` = constant metric\n * (∂g=0, Γ=0, ∇_μ=∂_μ); `'supplied'` = caller provides ∂g components;\n * `'computed'` (the default) = the lowering treats a raw-tensor metric\n * input as constant (∂g=0) — nothing is auto-differentiated. Metric\n * closures in `inputs.fields` take the curvature paths, which\n * finite-difference the closures.\n * Omit to leave the field absent (engine defaults to `'computed'`).\n */\nexport function metric(\n name: string,\n indices: ReadonlyArray<TensorIndex>,\n dim: Dimension,\n signature: string,\n derivativeStrategy?: 'computed' | 'zero' | 'supplied',\n): MetricTensorNode {\n const node: {\n kind: 'metric-tensor';\n name: string;\n indices: ReadonlyArray<TensorIndex>;\n signature: string;\n dim: Dimension;\n derivativeStrategy?: 'computed' | 'zero' | 'supplied';\n } = { kind: 'metric-tensor', name, indices, signature, dim };\n if (derivativeStrategy !== undefined) node.derivativeStrategy = derivativeStrategy;\n return node;\n}\n\n/**\n * Construct a Kronecker delta δ^upperLabel_lowerLabel.\n * Parameter order: upper first, lower second (canonical δ^μ_ν).\n * dim defaults to DIMENSIONLESS (Design §13 Q3 locked).\n */\nexport function kronecker(\n upperLabel: string,\n lowerLabel: string,\n dim: Dimension = DIMENSIONLESS,\n): KroneckerDeltaNode {\n return {\n kind: 'kronecker-delta',\n indices: [\n { label: upperLabel, variance: 'upper' },\n { label: lowerLabel, variance: 'lower' },\n ],\n dim,\n };\n}\n\n/**\n * Construct a tensor-partial-derivative. wrtIndex.variance MUST be 'lower'\n * — TypeScript enforces this via the CovariantIndex type.\n */\nexport function pderiv(\n of: ExprNode,\n wrt: ExprNode,\n wrtIndex: CovariantIndex,\n): TensorPartialDerivativeNode {\n return { kind: 'tensor-partial-derivative', of, wrt, wrtIndex };\n}\n\n/** Thrown by raise() / lower() when the operand's label is absent or has\n * the wrong variance for the requested operation. Private to this module\n * (not part of the public error surface per Design §6). */\nclass RaiseLowerInvalidLabelError extends UPTError {\n constructor(message: string) {\n super(message);\n this.name = 'RaiseLowerInvalidLabelError';\n }\n}\n\n/**\n * Collect free-index labels from an ExprNode by calling validate(). Returns\n * a map from label → variance (whichever side has count > 0). Note: this\n * performs a full subtree validation on `operand`; cost is acceptable for\n * typical raise/lower call sites (operand is a small subtree).\n */\nfunction collectFreeIndexLabels(node: ExprNode): Map<string, 'upper' | 'lower'> {\n const result = validate(node);\n const labels = new Map<string, 'upper' | 'lower'>();\n for (const [label, counts] of result.freeIndices) {\n if (counts.upper > 0) labels.set(label, 'upper');\n else if (counts.lower > 0) labels.set(label, 'lower');\n }\n return labels;\n}\n\n/**\n * Raise an index of `operand` via the inverse metric `gInverse`.\n *\n * Internal alpha-conversion: one of `gInverse`'s labels is renamed to\n * match `label` (so the Einstein-summation contraction picks it up);\n * the other is renamed to a fresh label that doesn't collide with any\n * free index in `operand`. The fresh label becomes the resulting\n * tensor-product's only new free index.\n *\n * Per Part-VIII §VIII.5 (raise/lower contract).\n *\n * Throws:\n * - MetricSignatureError if gInverse isn't both-upper\n * - RaiseLowerInvalidLabelError if label is absent or already upper in operand\n */\nexport function raise(\n operand: ExprNode,\n gInverse: MetricTensorNode,\n label: string,\n): TensorProductNode {\n if (\n gInverse.indices[0].variance !== 'upper' ||\n gInverse.indices[1].variance !== 'upper'\n ) {\n throw new MetricSignatureError(\n gInverse.name,\n `raise() requires both indices of the inverse metric to have variance 'upper'`,\n );\n }\n const operandLabels = collectFreeIndexLabels(operand);\n const operandVariance = operandLabels.get(label);\n if (operandVariance === undefined) {\n throw new RaiseLowerInvalidLabelError(\n `raise(): label '${label}' is not a free index of the operand. ` +\n `Operand free indices: ${Array.from(operandLabels.keys()).join(', ') || '(none)'}.`,\n );\n }\n if (operandVariance === 'upper') {\n throw new RaiseLowerInvalidLabelError(\n `raise(): label '${label}' is already 'upper' in the operand. ` +\n `Use lower() to lower it, or pick a different label.`,\n );\n }\n\n // Alpha-conversion: rename gInverse[0] → label (the dummy that contracts);\n // gInverse[1] → freshLabel(gInverse[1].label, operand-free-labels).\n const taken = new Set(operandLabels.keys());\n taken.add(label);\n const renamed = freshLabel(gInverse.indices[1].label, taken);\n\n const renamedGInverse: MetricTensorNode = {\n kind: 'metric-tensor',\n name: gInverse.name,\n indices: [\n { label, variance: 'upper' },\n { label: renamed, variance: 'upper' },\n ],\n signature: gInverse.signature,\n dim: gInverse.dim,\n };\n if (gInverse.derivativeStrategy !== undefined) {\n (renamedGInverse as { derivativeStrategy: typeof gInverse.derivativeStrategy }).derivativeStrategy =\n gInverse.derivativeStrategy;\n }\n\n return { kind: 'tensor-product', args: [renamedGInverse, operand] };\n}\n\n/**\n * Lower an index of `operand` via the covariant metric `g`.\n * Symmetric to raise(). Per Part-VIII §VIII.5.\n *\n * Throws:\n * - MetricSignatureError if g isn't both-lower\n * - RaiseLowerInvalidLabelError if label is absent or already lower in operand\n */\nexport function lower(\n operand: ExprNode,\n g: MetricTensorNode,\n label: string,\n): TensorProductNode {\n if (\n g.indices[0].variance !== 'lower' ||\n g.indices[1].variance !== 'lower'\n ) {\n throw new MetricSignatureError(\n g.name,\n `lower() requires both indices of the metric to have variance 'lower'`,\n );\n }\n const operandLabels = collectFreeIndexLabels(operand);\n const operandVariance = operandLabels.get(label);\n if (operandVariance === undefined) {\n throw new RaiseLowerInvalidLabelError(\n `lower(): label '${label}' is not a free index of the operand. ` +\n `Operand free indices: ${Array.from(operandLabels.keys()).join(', ') || '(none)'}.`,\n );\n }\n if (operandVariance === 'lower') {\n throw new RaiseLowerInvalidLabelError(\n `lower(): label '${label}' is already 'lower' in the operand. ` +\n `Use raise() to raise it, or pick a different label.`,\n );\n }\n\n const taken = new Set(operandLabels.keys());\n taken.add(label);\n const renamed = freshLabel(g.indices[1].label, taken);\n\n const renamedG: MetricTensorNode = {\n kind: 'metric-tensor',\n name: g.name,\n indices: [\n { label, variance: 'lower' },\n { label: renamed, variance: 'lower' },\n ],\n signature: g.signature,\n dim: g.dim,\n };\n if (g.derivativeStrategy !== undefined) {\n (renamedG as { derivativeStrategy: typeof g.derivativeStrategy }).derivativeStrategy =\n g.derivativeStrategy;\n }\n\n return { kind: 'tensor-product', args: [renamedG, operand] };\n}\n"]}
|
|
@@ -75,6 +75,15 @@ export interface NamedConstantValue {
|
|
|
75
75
|
* (same IEEE-754 primitives).
|
|
76
76
|
*/
|
|
77
77
|
export declare const CONSTANTS: Readonly<Record<string, NamedConstantValue>>;
|
|
78
|
+
/**
|
|
79
|
+
* True when `name` is a key of {@link CONSTANTS} itself. `in` on that plain
|
|
80
|
+
* object is true for `constructor` and every other `Object.prototype` name,
|
|
81
|
+
* which once read a leaf spelled that way as a constant; this reads the own
|
|
82
|
+
* properties only, and is the one rule for "a registered constant".
|
|
83
|
+
*
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
86
|
+
export declare function isRegisteredConstant(name: string): boolean;
|
|
78
87
|
/** What a registered constant is, its SI unit, and where its value comes from (audit I10). @internal */
|
|
79
88
|
export interface ConstantProvenance {
|
|
80
89
|
readonly meaning: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbolic-constants.d.ts","sourceRoot":"","sources":["../../src/dimensional/symbolic-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;
|
|
1
|
+
{"version":3,"file":"symbolic-constants.d.ts","sourceRoot":"","sources":["../../src/dimensional/symbolic-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAA8B,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAElF,4FAA4F;AAC5F,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;CACzB;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,cAAc,EAGpD,CAAC;AAkBJ,wEAAwE;AACxE,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAG3E;AASD,8HAA8H;AAC9H,qBAAa,yBAA0B,SAAQ,KAAK;IAEhD,QAAQ,CAAC,GAAG,EAAE,MAAM;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM;IAJxB,YACW,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EAOvB;CACF;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO3E;AAED,mGAAmG;AACnG,wBAAgB,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAO/D;AAED,0FAA0F;AAC1F,wBAAgB,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAItD;AAED,qEAAqE;AACrE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;CACzB;AAED;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAKlE,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,wGAAwG;AACxG,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,iGAAiG;IACjG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,4DAA4D;AAC5D,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAK5E,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMhE"}
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
*
|
|
30
30
|
* @module dimensional/symbolic-constants
|
|
31
31
|
*/
|
|
32
|
+
import { withinRel } from '../core/compare.js';
|
|
32
33
|
import { parseUnit } from './units.js';
|
|
33
34
|
import { CONSTANT_ROWS, constantRow } from './constant-rows.js';
|
|
34
35
|
/**
|
|
@@ -86,7 +87,7 @@ export function constantAgreement(key, value) {
|
|
|
86
87
|
const record = BY_SPELLING.get(key);
|
|
87
88
|
if (record === undefined)
|
|
88
89
|
return null;
|
|
89
|
-
if (
|
|
90
|
+
if (!withinRel(value, record.value, CONSTANT_AGREEMENT, 0)) {
|
|
90
91
|
throw new ConstantDisagreementError(key, record.name, record.value, value);
|
|
91
92
|
}
|
|
92
93
|
return record.name;
|
|
@@ -118,6 +119,17 @@ export const CONSTANTS = Object.fromEntries(CONSTANT_REGISTRY.filter((record) =>
|
|
|
118
119
|
record.name,
|
|
119
120
|
{ value: record.value, dim: record.dim },
|
|
120
121
|
]));
|
|
122
|
+
/**
|
|
123
|
+
* True when `name` is a key of {@link CONSTANTS} itself. `in` on that plain
|
|
124
|
+
* object is true for `constructor` and every other `Object.prototype` name,
|
|
125
|
+
* which once read a leaf spelled that way as a constant; this reads the own
|
|
126
|
+
* properties only, and is the one rule for "a registered constant".
|
|
127
|
+
*
|
|
128
|
+
* @internal
|
|
129
|
+
*/
|
|
130
|
+
export function isRegisteredConstant(name) {
|
|
131
|
+
return Object.prototype.hasOwnProperty.call(CONSTANTS, name);
|
|
132
|
+
}
|
|
121
133
|
/** One row per {@link CONSTANT_REGISTRY} name. @internal */
|
|
122
134
|
export const CONSTANT_PROVENANCE = Object.fromEntries(CONSTANT_REGISTRY.map((record) => [
|
|
123
135
|
record.name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbolic-constants.js","sourceRoot":"","sources":["../../src/dimensional/symbolic-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAoB,MAAM,oBAAoB,CAAC;AAOlF;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA8B,aAA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AC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC;IACpD,OAAO,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AACrB,CAAC","sourcesContent":["/**\n * The constant registry: one row per physical constant a formula may name.\n *\n * A row (written in `constant-rows.ts`) holds the formula name, its other\n * exact-case spellings, the SI value (imported from `core/constants.js`, the\n * one owner of every value), the SI unit in `parseUnit` syntax, the meaning\n * and the source. The dimension is derived from the unit once, here; no second\n * table states it. The rows sit in their own module because the unit table\n * names constants by these spellings, and this module imports the unit parser. Every other\n * constant table in the library ({@link CONSTANTS}, `FORMULA_NAMED`,\n * `CONSTANT_SPELLINGS`, {@link CONSTANT_PROVENANCE}, `CANONICAL_CONSTANTS`,\n * the `upt eval` scope, the binding scope, the gradient constants) is a\n * projection of this array, so a spelling, a value and a dimension cannot\n * disagree between two files. A constant that is also a quantity names its\n * `data/quantities.json` row in `quantity`; the quantity registry derives that\n * row's aliases from here, so the file states no constant spelling.\n *\n * `canonical` marks a universal constant a canonical equation's `governing`\n * list may bake as a leaf. A row that is an overlay for `upt eval` and the\n * dimensional assignment only (`m_p`, `N_A`, the GRW parameters) is not\n * canonical, so the canonical graph does not bake it.\n *\n * Numeric-literal leaves (`'2'`, `'3'`) are NOT registered — `evalExpr`\n * resolves them via `Number(name)` and they are implicitly dimensionless.\n * Non-base-10 tokens (`'8pi'`, `'4pi'`, `'ln2'`) MUST be here (`Number('8pi')`\n * is `NaN`).\n *\n * INTERNAL — not on the public surface.\n *\n * @module dimensional/symbolic-constants\n */\n\nimport type { Dimension } from './types.js';\nimport { parseUnit } from './units.js';\nimport { CONSTANT_ROWS, constantRow, type ConstantRow } from './constant-rows.js';\n\n/** One registered constant: its row, with the dimension derived from its unit. @internal */\nexport interface ConstantRecord extends ConstantRow {\n readonly dim: Dimension;\n}\n\n/**\n * Every registered constant, the rows of `constant-rows.ts` with each\n * dimension derived once from its unit. Order is the order the tables print.\n * @internal\n */\nexport const CONSTANT_REGISTRY: readonly ConstantRecord[] = CONSTANT_ROWS.map((constant) => ({\n ...constant,\n dim: parseUnit(constant.unit).dim,\n}));\n\nconst RECORD_OF_ROW = new Map<ConstantRow, ConstantRecord>(CONSTANT_ROWS.map((constant, i) => [constant, CONSTANT_REGISTRY[i]!]));\n\n/**\n * Every spelling → its record; `constant-rows.ts` refuses a spelling written twice. A constant\n * that is also a quantity (`quantity`, e.g. `k_B` → `boltzmann-constant`) is reachable by that\n * quantity id too, so a user who writes the quantity's name states the constant, and the value\n * is checked against the registry rather than bound.\n */\nconst BY_SPELLING = new Map<string, ConstantRecord>(\n CONSTANT_REGISTRY.flatMap((record) =>\n [record.name, ...record.spellings, ...(record.quantity === undefined ? [] : [record.quantity])].map(\n (spelling) => [spelling, record] as const,\n ),\n ),\n);\n\n/** The registered constant `spelling` names, or undefined. @internal */\nexport function constantRecord(spelling: string): ConstantRecord | undefined {\n const constant = constantRow(spelling);\n return constant === undefined ? undefined : RECORD_OF_ROW.get(constant);\n}\n\n/**\n * Relative tolerance within which a stated constant agrees with the registered\n * value. Textbook roundings such as `b = 2.9e-3` pass.\n * @internal\n */\nconst CONSTANT_AGREEMENT = 5e-3;\n\n/** A stated value for a registered constant disagrees with the registry. The equations use the registered value. @internal */\nexport class ConstantDisagreementError extends Error {\n constructor(\n readonly key: string,\n readonly constant: string,\n readonly registered: number,\n readonly given: number,\n ) {\n super(\n `'${key}' is the registered constant ${constant} = ${registered}; ` +\n `${given} disagrees, and the equations use the registered value, so it cannot be rebound.`,\n );\n this.name = 'ConstantDisagreementError';\n }\n}\n\n/**\n * The registered constant `key` names when `value` agrees with it within\n * {@link CONSTANT_AGREEMENT}, or null when `key` names no constant. A value\n * that disagrees throws {@link ConstantDisagreementError}: a constant is not\n * a graph quantity, so a stated value is checked, never bound.\n * @internal\n */\nexport function constantAgreement(key: string, value: number): string | null {\n const record = BY_SPELLING.get(key);\n if (record === undefined) return null;\n if (Math.abs(value - record.value) > CONSTANT_AGREEMENT * Math.abs(record.value)) {\n throw new ConstantDisagreementError(key, record.name, record.value, value);\n }\n return record.name;\n}\n\n/** The notes of the registered constants among `names`, each once, in registry order. @internal */\nexport function constantNotes(names: Iterable<string>): string[] {\n const seen = new Set<ConstantRecord>();\n for (const name of names) {\n const record = BY_SPELLING.get(name);\n if (record?.note !== undefined) seen.add(record);\n }\n return CONSTANT_REGISTRY.filter((record) => seen.has(record)).map((record) => record.note!);\n}\n\n/** Every spelling → SI value, for a numeric scope. `pi` and `tau` are added. @internal */\nexport function constantScope(): Record<string, number> {\n const scope: Record<string, number> = { pi: Math.PI, tau: 2 * Math.PI };\n for (const [spelling, record] of BY_SPELLING) scope[spelling] = record.value;\n return scope;\n}\n\n/** A registered constant leaf: SI value + SI dimension. @internal */\nexport interface NamedConstantValue {\n readonly value: number;\n readonly dim: Dimension;\n}\n\n/**\n * Constant leaves a `symbolic` ExprNode may reference, keyed by formula name:\n * the canonical rows of {@link CONSTANT_REGISTRY}. `ln2`/`8pi`/`4pi`\n * reproduce the evaluators' `Math.LN2` / `8*Math.PI` / `4*Math.PI` exactly\n * (same IEEE-754 primitives).\n */\nexport const CONSTANTS: Readonly<Record<string, NamedConstantValue>> = Object.fromEntries(\n CONSTANT_REGISTRY.filter((record) => record.canonical).map((record) => [\n record.name,\n { value: record.value, dim: record.dim },\n ]),\n);\n\n/** What a registered constant is, its SI unit, and where its value comes from (audit I10). @internal */\nexport interface ConstantProvenance {\n readonly meaning: string;\n /** The SI unit, in the syntax `parseUnit` reads; the registered dimension is derived from it. */\n readonly unit: string;\n readonly source: string;\n}\n\n/** One row per {@link CONSTANT_REGISTRY} name. @internal */\nexport const CONSTANT_PROVENANCE: Readonly<Record<string, ConstantProvenance>> = Object.fromEntries(\n CONSTANT_REGISTRY.map((record) => [\n record.name,\n { meaning: record.meaning, unit: record.unit, source: record.source },\n ]),\n);\n\n/**\n * A spelled-out multiple of π written as one symbol (`pi`, `6pi`). `2pi`,\n * `4pi` and `8pi` are also registered in {@link CONSTANTS}; this covers the\n * multiples an encoder spelled out and did not register (`6pi` in\n * CE-perihelion-precession). The structural normal form already drops these.\n * The numeric evaluator has to resolve them too, or a comparison treats `6pi`\n * as a free symbol and never aligns the formula.\n * @internal\n */\nexport function piMultipleValue(name: string): number | undefined {\n const m = /^(\\d*)pi$/.exec(name);\n if (m === null) return undefined;\n const n = m[1] === '' ? 1 : Number(m[1]);\n if (!Number.isInteger(n) || n < 0) return undefined;\n return n * Math.PI;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"symbolic-constants.js","sourceRoot":"","sources":["../../src/dimensional/symbolic-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAoB,MAAM,oBAAoB,CAAC;AAOlF;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA8B,aAAa,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC3F,GAAG,QAAQ;IACX,GAAG,EAAE,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG;CAClC,CAAC,CAAC,CAAC;AAEJ,MAAM,aAAa,GAAG,IAAI,GAAG,CAA8B,aAAa,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,CAAC;AAElI;;;;;GAKG;AACH,MAAM,WAAW,GAAG,IAAI,GAAG,CACzB,iBAAiB,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CACnC,CAAC,MAAM,CAAC,IAAI,EAAE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,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE;CACzC,CAAC,CACH,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAC/D,CAAC;AAUD,4DAA4D;AAC5D,MAAM,CAAC,MAAM,mBAAmB,GAAiD,MAAM,CAAC,WAAW,CACjG,iBAAiB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;IAChC,MAAM,CAAC,IAAI;IACX,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;CACtE,CAAC,CACH,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,MAAM,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACjC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC;IACpD,OAAO,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AACrB,CAAC","sourcesContent":["/**\n * The constant registry: one row per physical constant a formula may name.\n *\n * A row (written in `constant-rows.ts`) holds the formula name, its other\n * exact-case spellings, the SI value (imported from `core/constants.js`, the\n * one owner of every value), the SI unit in `parseUnit` syntax, the meaning\n * and the source. The dimension is derived from the unit once, here; no second\n * table states it. The rows sit in their own module because the unit table\n * names constants by these spellings, and this module imports the unit parser. Every other\n * constant table in the library ({@link CONSTANTS}, `FORMULA_NAMED`,\n * `CONSTANT_SPELLINGS`, {@link CONSTANT_PROVENANCE}, `CANONICAL_CONSTANTS`,\n * the `upt eval` scope, the binding scope, the gradient constants) is a\n * projection of this array, so a spelling, a value and a dimension cannot\n * disagree between two files. A constant that is also a quantity names its\n * `data/quantities.json` row in `quantity`; the quantity registry derives that\n * row's aliases from here, so the file states no constant spelling.\n *\n * `canonical` marks a universal constant a canonical equation's `governing`\n * list may bake as a leaf. A row that is an overlay for `upt eval` and the\n * dimensional assignment only (`m_p`, `N_A`, the GRW parameters) is not\n * canonical, so the canonical graph does not bake it.\n *\n * Numeric-literal leaves (`'2'`, `'3'`) are NOT registered — `evalExpr`\n * resolves them via `Number(name)` and they are implicitly dimensionless.\n * Non-base-10 tokens (`'8pi'`, `'4pi'`, `'ln2'`) MUST be here (`Number('8pi')`\n * is `NaN`).\n *\n * INTERNAL — not on the public surface.\n *\n * @module dimensional/symbolic-constants\n */\n\nimport { withinRel } from '../core/compare.js';\nimport type { Dimension } from './types.js';\nimport { parseUnit } from './units.js';\nimport { CONSTANT_ROWS, constantRow, type ConstantRow } from './constant-rows.js';\n\n/** One registered constant: its row, with the dimension derived from its unit. @internal */\nexport interface ConstantRecord extends ConstantRow {\n readonly dim: Dimension;\n}\n\n/**\n * Every registered constant, the rows of `constant-rows.ts` with each\n * dimension derived once from its unit. Order is the order the tables print.\n * @internal\n */\nexport const CONSTANT_REGISTRY: readonly ConstantRecord[] = CONSTANT_ROWS.map((constant) => ({\n ...constant,\n dim: parseUnit(constant.unit).dim,\n}));\n\nconst RECORD_OF_ROW = new Map<ConstantRow, ConstantRecord>(CONSTANT_ROWS.map((constant, i) => [constant, CONSTANT_REGISTRY[i]!]));\n\n/**\n * Every spelling → its record; `constant-rows.ts` refuses a spelling written twice. A constant\n * that is also a quantity (`quantity`, e.g. `k_B` → `boltzmann-constant`) is reachable by that\n * quantity id too, so a user who writes the quantity's name states the constant, and the value\n * is checked against the registry rather than bound.\n */\nconst BY_SPELLING = new Map<string, ConstantRecord>(\n CONSTANT_REGISTRY.flatMap((record) =>\n [record.name, ...record.spellings, ...(record.quantity === undefined ? [] : [record.quantity])].map(\n (spelling) => [spelling, record] as const,\n ),\n ),\n);\n\n/** The registered constant `spelling` names, or undefined. @internal */\nexport function constantRecord(spelling: string): ConstantRecord | undefined {\n const constant = constantRow(spelling);\n return constant === undefined ? undefined : RECORD_OF_ROW.get(constant);\n}\n\n/**\n * Relative tolerance within which a stated constant agrees with the registered\n * value. Textbook roundings such as `b = 2.9e-3` pass.\n * @internal\n */\nconst CONSTANT_AGREEMENT = 5e-3;\n\n/** A stated value for a registered constant disagrees with the registry. The equations use the registered value. @internal */\nexport class ConstantDisagreementError extends Error {\n constructor(\n readonly key: string,\n readonly constant: string,\n readonly registered: number,\n readonly given: number,\n ) {\n super(\n `'${key}' is the registered constant ${constant} = ${registered}; ` +\n `${given} disagrees, and the equations use the registered value, so it cannot be rebound.`,\n );\n this.name = 'ConstantDisagreementError';\n }\n}\n\n/**\n * The registered constant `key` names when `value` agrees with it within\n * {@link CONSTANT_AGREEMENT}, or null when `key` names no constant. A value\n * that disagrees throws {@link ConstantDisagreementError}: a constant is not\n * a graph quantity, so a stated value is checked, never bound.\n * @internal\n */\nexport function constantAgreement(key: string, value: number): string | null {\n const record = BY_SPELLING.get(key);\n if (record === undefined) return null;\n if (!withinRel(value, record.value, CONSTANT_AGREEMENT, 0)) {\n throw new ConstantDisagreementError(key, record.name, record.value, value);\n }\n return record.name;\n}\n\n/** The notes of the registered constants among `names`, each once, in registry order. @internal */\nexport function constantNotes(names: Iterable<string>): string[] {\n const seen = new Set<ConstantRecord>();\n for (const name of names) {\n const record = BY_SPELLING.get(name);\n if (record?.note !== undefined) seen.add(record);\n }\n return CONSTANT_REGISTRY.filter((record) => seen.has(record)).map((record) => record.note!);\n}\n\n/** Every spelling → SI value, for a numeric scope. `pi` and `tau` are added. @internal */\nexport function constantScope(): Record<string, number> {\n const scope: Record<string, number> = { pi: Math.PI, tau: 2 * Math.PI };\n for (const [spelling, record] of BY_SPELLING) scope[spelling] = record.value;\n return scope;\n}\n\n/** A registered constant leaf: SI value + SI dimension. @internal */\nexport interface NamedConstantValue {\n readonly value: number;\n readonly dim: Dimension;\n}\n\n/**\n * Constant leaves a `symbolic` ExprNode may reference, keyed by formula name:\n * the canonical rows of {@link CONSTANT_REGISTRY}. `ln2`/`8pi`/`4pi`\n * reproduce the evaluators' `Math.LN2` / `8*Math.PI` / `4*Math.PI` exactly\n * (same IEEE-754 primitives).\n */\nexport const CONSTANTS: Readonly<Record<string, NamedConstantValue>> = Object.fromEntries(\n CONSTANT_REGISTRY.filter((record) => record.canonical).map((record) => [\n record.name,\n { value: record.value, dim: record.dim },\n ]),\n);\n\n/**\n * True when `name` is a key of {@link CONSTANTS} itself. `in` on that plain\n * object is true for `constructor` and every other `Object.prototype` name,\n * which once read a leaf spelled that way as a constant; this reads the own\n * properties only, and is the one rule for \"a registered constant\".\n *\n * @internal\n */\nexport function isRegisteredConstant(name: string): boolean {\n return Object.prototype.hasOwnProperty.call(CONSTANTS, name);\n}\n\n/** What a registered constant is, its SI unit, and where its value comes from (audit I10). @internal */\nexport interface ConstantProvenance {\n readonly meaning: string;\n /** The SI unit, in the syntax `parseUnit` reads; the registered dimension is derived from it. */\n readonly unit: string;\n readonly source: string;\n}\n\n/** One row per {@link CONSTANT_REGISTRY} name. @internal */\nexport const CONSTANT_PROVENANCE: Readonly<Record<string, ConstantProvenance>> = Object.fromEntries(\n CONSTANT_REGISTRY.map((record) => [\n record.name,\n { meaning: record.meaning, unit: record.unit, source: record.source },\n ]),\n);\n\n/**\n * A spelled-out multiple of π written as one symbol (`pi`, `6pi`). `2pi`,\n * `4pi` and `8pi` are also registered in {@link CONSTANTS}; this covers the\n * multiples an encoder spelled out and did not register (`6pi` in\n * CE-perihelion-precession). The structural normal form already drops these.\n * The numeric evaluator has to resolve them too, or a comparison treats `6pi`\n * as a free symbol and never aligns the formula.\n * @internal\n */\nexport function piMultipleValue(name: string): number | undefined {\n const m = /^(\\d*)pi$/.exec(name);\n if (m === null) return undefined;\n const n = m[1] === '' ? 1 : Number(m[1]);\n if (!Number.isInteger(n) || n < 0) return undefined;\n return n * Math.PI;\n}\n"]}
|
|
@@ -45,8 +45,44 @@ export declare const FORCE: Dimension;
|
|
|
45
45
|
export declare const ENERGY: Dimension;
|
|
46
46
|
export declare const POWER: Dimension;
|
|
47
47
|
export declare const ACTION: Dimension;
|
|
48
|
+
/** Volume, cubic metre. */
|
|
49
|
+
export declare const VOLUME: Dimension;
|
|
50
|
+
/** Momentum, kilogram metre per second. */
|
|
51
|
+
export declare const MOMENTUM: Dimension;
|
|
52
|
+
/** Pressure, pascal. */
|
|
53
|
+
export declare const PRESSURE: Dimension;
|
|
54
|
+
/** Spring constant, newton per metre. */
|
|
55
|
+
export declare const SPRING_CONSTANT: Dimension;
|
|
56
|
+
/** Dynamic viscosity, pascal second. */
|
|
57
|
+
export declare const VISCOSITY: Dimension;
|
|
58
|
+
/** Linear mass density, kilogram per metre. */
|
|
59
|
+
export declare const LINEAR_DENSITY: Dimension;
|
|
60
|
+
/** Wavenumber (any inverse length: a spatial frequency, a turn density), per metre. */
|
|
61
|
+
export declare const WAVENUMBER: Dimension;
|
|
62
|
+
/** Diffusivity (mass, thermal or momentum), square metre per second. */
|
|
63
|
+
export declare const DIFFUSIVITY: Dimension;
|
|
64
|
+
/** Energy flux density (power per area: intensity, a Poynting or radiative flux), watt per square metre. */
|
|
65
|
+
export declare const ENERGY_FLUX: Dimension;
|
|
66
|
+
/** The dimension of Newton's constant G, cubic metre per kilogram second squared. */
|
|
67
|
+
export declare const GRAVITATIONAL_CONSTANT: Dimension;
|
|
48
68
|
export declare const TEMPERATURE: Dimension;
|
|
49
69
|
export declare const ENTROPY: Dimension;
|
|
70
|
+
/** Thermal conductivity, watt per metre kelvin. */
|
|
71
|
+
export declare const THERMAL_CONDUCTIVITY: Dimension;
|
|
72
|
+
/** Specific heat capacity, joule per kilogram kelvin. */
|
|
73
|
+
export declare const SPECIFIC_HEAT: Dimension;
|
|
50
74
|
export declare const CHARGE: Dimension;
|
|
75
|
+
/** Capacitance, farad. */
|
|
76
|
+
export declare const CAPACITANCE: Dimension;
|
|
77
|
+
/** Inductance, henry. */
|
|
78
|
+
export declare const INDUCTANCE: Dimension;
|
|
79
|
+
/** Resistance, ohm. */
|
|
80
|
+
export declare const RESISTANCE: Dimension;
|
|
81
|
+
/** Permittivity, farad per metre. */
|
|
82
|
+
export declare const PERMITTIVITY: Dimension;
|
|
83
|
+
/** Electric field, volt per metre. */
|
|
84
|
+
export declare const ELECTRIC_FIELD: Dimension;
|
|
85
|
+
/** Electrical resistivity, ohm metre. */
|
|
86
|
+
export declare const RESISTIVITY: Dimension;
|
|
51
87
|
export declare const NAMED_DIMENSIONS: ReadonlyArray<readonly [string, Dimension]>;
|
|
52
88
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/dimensional/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,SAAS;IACxB,yBAAyB;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,2BAA2B;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,wBAAwB;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,oCAAoC;IACpC,CAAC,EAAE,MAAM,CAAC;IACV,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,CAAC,EAAE,MAAM,CAAC;IACV,wCAAwC;IACxC,CAAC,EAAE,MAAM,CAAC;CACX;AAED,eAAO,MAAM,aAAa,EAAE,SAA4D,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/dimensional/types.ts"],"names":[],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24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
21
|
+
// Named-dimension constants: one owner for each shape. The atlas families and
|
|
22
|
+
// the canonical entries each spelled PRESSURE, SPRING_CONSTANT, CAPACITANCE,
|
|
23
|
+
// INDUCTANCE, RESISTANCE, THERMAL_CONDUCTIVITY, SPECIFIC_HEAT, VISCOSITY,
|
|
24
|
+
// VOLUME, PERMITTIVITY, MOMENTUM and ELECTRIC_FIELD by exponents; those shapes
|
|
25
|
+
// are named here, as are LINEAR_DENSITY, WAVENUMBER, DIFFUSIVITY, ENERGY_FLUX,
|
|
26
|
+
// GRAVITATIONAL_CONSTANT and RESISTIVITY, each stated by exponents in two or
|
|
27
|
+
// more of those modules. A shape named here is NOT a row of NAMED_DIMENSIONS unless
|
|
28
|
+
// `format()` is meant to print its name: adding a row changes every printed
|
|
29
|
+
// dimension of that shape.
|
|
28
30
|
export const LENGTH = { L: 1, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 };
|
|
29
31
|
export const AREA = { L: 2, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 };
|
|
30
32
|
export const TIME = { L: 0, M: 0, T: 1, I: 0, Theta: 0, N: 0, J: 0 };
|
|
@@ -38,11 +40,47 @@ export const FORCE = { L: 1, M: 1, T: -2, I: 0, Theta: 0, N: 0, J: 0 }; // newto
|
|
|
38
40
|
export const ENERGY = { L: 2, M: 1, T: -2, I: 0, Theta: 0, N: 0, J: 0 }; // joule
|
|
39
41
|
export const POWER = { L: 2, M: 1, T: -3, I: 0, Theta: 0, N: 0, J: 0 }; // watt
|
|
40
42
|
export const ACTION = { L: 2, M: 1, T: -1, I: 0, Theta: 0, N: 0, J: 0 }; // J·s
|
|
43
|
+
/** Volume, cubic metre. */
|
|
44
|
+
export const VOLUME = { L: 3, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 };
|
|
45
|
+
/** Momentum, kilogram metre per second. */
|
|
46
|
+
export const MOMENTUM = { L: 1, M: 1, T: -1, I: 0, Theta: 0, N: 0, J: 0 };
|
|
47
|
+
/** Pressure, pascal. */
|
|
48
|
+
export const PRESSURE = { L: -1, M: 1, T: -2, I: 0, Theta: 0, N: 0, J: 0 };
|
|
49
|
+
/** Spring constant, newton per metre. */
|
|
50
|
+
export const SPRING_CONSTANT = { L: 0, M: 1, T: -2, I: 0, Theta: 0, N: 0, J: 0 };
|
|
51
|
+
/** Dynamic viscosity, pascal second. */
|
|
52
|
+
export const VISCOSITY = { L: -1, M: 1, T: -1, I: 0, Theta: 0, N: 0, J: 0 };
|
|
53
|
+
/** Linear mass density, kilogram per metre. */
|
|
54
|
+
export const LINEAR_DENSITY = { L: -1, M: 1, T: 0, I: 0, Theta: 0, N: 0, J: 0 };
|
|
55
|
+
/** Wavenumber (any inverse length: a spatial frequency, a turn density), per metre. */
|
|
56
|
+
export const WAVENUMBER = { L: -1, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 };
|
|
57
|
+
/** Diffusivity (mass, thermal or momentum), square metre per second. */
|
|
58
|
+
export const DIFFUSIVITY = { L: 2, M: 0, T: -1, I: 0, Theta: 0, N: 0, J: 0 };
|
|
59
|
+
/** Energy flux density (power per area: intensity, a Poynting or radiative flux), watt per square metre. */
|
|
60
|
+
export const ENERGY_FLUX = { L: 0, M: 1, T: -3, I: 0, Theta: 0, N: 0, J: 0 };
|
|
61
|
+
/** The dimension of Newton's constant G, cubic metre per kilogram second squared. */
|
|
62
|
+
export const GRAVITATIONAL_CONSTANT = { L: 3, M: -1, T: -2, I: 0, Theta: 0, N: 0, J: 0 };
|
|
41
63
|
// --- Thermodynamics ---
|
|
42
64
|
export const TEMPERATURE = { L: 0, M: 0, T: 0, I: 0, Theta: 1, N: 0, J: 0 };
|
|
43
65
|
export const ENTROPY = { L: 2, M: 1, T: -2, I: 0, Theta: -1, N: 0, J: 0 }; // J/K
|
|
66
|
+
/** Thermal conductivity, watt per metre kelvin. */
|
|
67
|
+
export const THERMAL_CONDUCTIVITY = { L: 1, M: 1, T: -3, I: 0, Theta: -1, N: 0, J: 0 };
|
|
68
|
+
/** Specific heat capacity, joule per kilogram kelvin. */
|
|
69
|
+
export const SPECIFIC_HEAT = { L: 2, M: 0, T: -2, I: 0, Theta: -1, N: 0, J: 0 };
|
|
44
70
|
// --- Electromagnetism (SI) ---
|
|
45
71
|
export const CHARGE = { L: 0, M: 0, T: 1, I: 1, Theta: 0, N: 0, J: 0 }; // coulomb = A·s
|
|
72
|
+
/** Capacitance, farad. */
|
|
73
|
+
export const CAPACITANCE = { L: -2, M: -1, T: 4, I: 2, Theta: 0, N: 0, J: 0 };
|
|
74
|
+
/** Inductance, henry. */
|
|
75
|
+
export const INDUCTANCE = { L: 2, M: 1, T: -2, I: -2, Theta: 0, N: 0, J: 0 };
|
|
76
|
+
/** Resistance, ohm. */
|
|
77
|
+
export const RESISTANCE = { L: 2, M: 1, T: -3, I: -2, Theta: 0, N: 0, J: 0 };
|
|
78
|
+
/** Permittivity, farad per metre. */
|
|
79
|
+
export const PERMITTIVITY = { L: -3, M: -1, T: 4, I: 2, Theta: 0, N: 0, J: 0 };
|
|
80
|
+
/** Electric field, volt per metre. */
|
|
81
|
+
export const ELECTRIC_FIELD = { L: 1, M: 1, T: -3, I: -1, Theta: 0, N: 0, J: 0 };
|
|
82
|
+
/** Electrical resistivity, ohm metre. */
|
|
83
|
+
export const RESISTIVITY = { L: 3, M: 1, T: -3, I: -2, Theta: 0, N: 0, J: 0 };
|
|
46
84
|
// --- Curated lookup table for `format()` to recognize named SI dimensions. ---
|
|
47
85
|
// Order matters only for tie-breaks; the first matching name wins.
|
|
48
86
|
export const NAMED_DIMENSIONS = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/dimensional/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAmBH,MAAM,CAAC,MAAM,aAAa,GAAc,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,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,EAAE,CAAC,CAAC,gBAAgB;AAE1G,gFAAgF;AAChF,mEAAmE;AACnE,MAAM,CAAC,MAAM,gBAAgB,GAAgD;IAC3E,CAAC,eAAe,EAAE,aAAa,CAAC;IAChC,CAAC,QAAQ,EAAE,MAAM,CAAC;IAClB,CAAC,MAAM,EAAE,IAAI,CAAC;IACd,CAAC,MAAM,EAAE,IAAI,CAAC;IACd,CAAC,WAAW,EAAE,SAAS,CAAC;IACxB,CAAC,MAAM,EAAE,IAAI,CAAC;IACd,CAAC,UAAU,EAAE,QAAQ,CAAC;IACtB,CAAC,cAAc,EAAE,YAAY,CAAC;IAC9B,sEAAsE;IACtE,sEAAsE;IACtE,mBAAmB;IACnB,CAAC,QAAQ,EAAE,MAAM,CAAC;IAClB,CAAC,OAAO,EAAE,KAAK,CAAC;IAChB,CAAC,QAAQ,EAAE,MAAM,CAAC;IAClB,CAAC,OAAO,EAAE,KAAK,CAAC;IAChB,CAAC,aAAa,EAAE,WAAW,CAAC;IAC5B,CAAC,SAAS,EAAE,OAAO,CAAC;IACpB,CAAC,QAAQ,EAAE,MAAM,CAAC;CACnB,CAAC","sourcesContent":["/**\n * SI dimensional types.\n *\n * Base dimensions per BIPM SI Brochure, 9th edition (2019), Table 3:\n * length L, mass M, time T, electric current I, thermodynamic temperature Theta,\n * amount of substance N, luminous intensity J.\n *\n * Named-dimension constants below are derived per NIST SP 811 (2008) §4\n * (derived SI units) and standard physics references:\n * - Goldstein, \"Classical Mechanics\" 3rd ed.\n * - Sakurai, \"Modern Quantum Mechanics\" 2nd ed.\n * - Wald, \"General Relativity\" (1984)\n *\n * All exponents are stored as `number` (allowing rational e.g. 1/2 if needed).\n *\n * @module dimensional/types\n */\n\nexport interface Dimension {\n /** Length (metre, m). */\n L: number;\n /** Mass (kilogram, kg). */\n M: number;\n /** Time (second, s). */\n T: number;\n /** Electric current (ampere, A). */\n I: number;\n /** Thermodynamic temperature (kelvin, K). */\n Theta: number;\n /** Amount of substance (mole, mol). */\n N: number;\n /** Luminous intensity (candela, cd). */\n J: number;\n}\n\nexport const DIMENSIONLESS: Dimension = { L: 0, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 };\n\n// --- Mechanics ---\n//\n// Named-dimension constants are exported only when there is at least one\n// real consumer (a bridge encoding, a constant, or an active test). The\n// previously-exported VOLUME, MOMENTUM, ANGULAR_MOMENTUM, PRESSURE,\n// DENSITY, VOLTAGE, ELECTRIC_FIELD, MAGNETIC_FIELD were unreferenced and\n// were removed 2026-05-04 per simplifier F-01 (no flexibility/configura-\n// bility that wasn't requested). Re-add them precisely when a bridge\n// encoding or test references them.\nexport const LENGTH: Dimension = { L: 1, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 };\nexport const AREA: Dimension = { L: 2, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 };\nexport const TIME: Dimension = { L: 0, M: 0, T: 1, I: 0, Theta: 0, N: 0, J: 0 };\nexport const FREQUENCY: Dimension = { L: 0, M: 0, T: -1, I: 0, Theta: 0, N: 0, J: 0 };\nexport const MASS: Dimension = { L: 0, M: 1, T: 0, I: 0, Theta: 0, N: 0, J: 0 };\n/** Mass density, kilogram per cubic metre. */\nexport const MASS_DENSITY: Dimension = { L: -3, M: 1, T: 0, I: 0, Theta: 0, N: 0, J: 0 };\nexport const VELOCITY: Dimension = { L: 1, M: 0, T: -1, I: 0, Theta: 0, N: 0, J: 0 };\nexport const ACCELERATION: Dimension = { L: 1, M: 0, T: -2, I: 0, Theta: 0, N: 0, J: 0 };\nexport const FORCE: Dimension = { L: 1, M: 1, T: -2, I: 0, Theta: 0, N: 0, J: 0 }; // newton\nexport const ENERGY: Dimension = { L: 2, M: 1, T: -2, I: 0, Theta: 0, N: 0, J: 0 }; // joule\nexport const POWER: Dimension = { L: 2, M: 1, T: -3, I: 0, Theta: 0, N: 0, J: 0 }; // watt\nexport const ACTION: Dimension = { L: 2, M: 1, T: -1, I: 0, Theta: 0, N: 0, J: 0 }; // J·s\n\n// --- Thermodynamics ---\nexport const TEMPERATURE: Dimension = { L: 0, M: 0, T: 0, I: 0, Theta: 1, N: 0, J: 0 };\nexport const ENTROPY: Dimension = { L: 2, M: 1, T: -2, I: 0, Theta: -1, N: 0, J: 0 }; // J/K\n\n// --- Electromagnetism (SI) ---\nexport const CHARGE: Dimension = { L: 0, M: 0, T: 1, I: 1, Theta: 0, N: 0, J: 0 }; // coulomb = A·s\n\n// --- Curated lookup table for `format()` to recognize named SI dimensions. ---\n// Order matters only for tie-breaks; the first matching name wins.\nexport const NAMED_DIMENSIONS: ReadonlyArray<readonly [string, Dimension]> = [\n ['dimensionless', DIMENSIONLESS],\n ['length', LENGTH],\n ['area', AREA],\n ['time', TIME],\n ['frequency', FREQUENCY],\n ['mass', MASS],\n ['velocity', VELOCITY],\n ['acceleration', ACCELERATION],\n // action carries the same SI shape (J·s) as angular momentum; we keep\n // 'action' as the canonical name since hbar (the only consumer today)\n // is action-typed.\n ['action', ACTION],\n ['force', FORCE],\n ['energy', ENERGY],\n ['power', POWER],\n ['temperature', TEMPERATURE],\n ['entropy', ENTROPY],\n ['charge', CHARGE],\n];\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/dimensional/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAmBH,MAAM,CAAC,MAAM,aAAa,GAAc,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAEzF,oBAAoB;AACpB,EAAE;AACF,8EAA8E;AAC9E,6EAA6E;AAC7E,0EAA0E;AAC1E,+EAA+E;AAC/E,+EAA+E;AAC/E,6EAA6E;AAC7E,oFAAoF;AACpF,4EAA4E;AAC5E,2BAA2B;AAC3B,MAAM,CAAC,MAAM,MAAM,GAAqB,EA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,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAC5F,yCAAyC;AACzC,MAAM,CAAC,MAAM,WAAW,GAAgB,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAE3F,gFAAgF;AAChF,mEAAmE;AACnE,MAAM,CAAC,MAAM,gBAAgB,GAAgD;IAC3E,CAAC,eAAe,EAAE,aAAa,CAAC;IAChC,CAAC,QAAQ,EAAE,MAAM,CAAC;IAClB,CAAC,MAAM,EAAE,IAAI,CAAC;IACd,CAAC,MAAM,EAAE,IAAI,CAAC;IACd,CAAC,WAAW,EAAE,SAAS,CAAC;IACxB,CAAC,MAAM,EAAE,IAAI,CAAC;IACd,CAAC,UAAU,EAAE,QAAQ,CAAC;IACtB,CAAC,cAAc,EAAE,YAAY,CAAC;IAC9B,sEAAsE;IACtE,sEAAsE;IACtE,mBAAmB;IACnB,CAAC,QAAQ,EAAE,MAAM,CAAC;IAClB,CAAC,OAAO,EAAE,KAAK,CAAC;IAChB,CAAC,QAAQ,EAAE,MAAM,CAAC;IAClB,CAAC,OAAO,EAAE,KAAK,CAAC;IAChB,CAAC,aAAa,EAAE,WAAW,CAAC;IAC5B,CAAC,SAAS,EAAE,OAAO,CAAC;IACpB,CAAC,QAAQ,EAAE,MAAM,CAAC;CACnB,CAAC","sourcesContent":["/**\n * SI dimensional types.\n *\n * Base dimensions per BIPM SI Brochure, 9th edition (2019), Table 3:\n * length L, mass M, time T, electric current I, thermodynamic temperature Theta,\n * amount of substance N, luminous intensity J.\n *\n * Named-dimension constants below are derived per NIST SP 811 (2008) §4\n * (derived SI units) and standard physics references:\n * - Goldstein, \"Classical Mechanics\" 3rd ed.\n * - Sakurai, \"Modern Quantum Mechanics\" 2nd ed.\n * - Wald, \"General Relativity\" (1984)\n *\n * All exponents are stored as `number` (allowing rational e.g. 1/2 if needed).\n *\n * @module dimensional/types\n */\n\nexport interface Dimension {\n /** Length (metre, m). */\n L: number;\n /** Mass (kilogram, kg). */\n M: number;\n /** Time (second, s). */\n T: number;\n /** Electric current (ampere, A). */\n I: number;\n /** Thermodynamic temperature (kelvin, K). */\n Theta: number;\n /** Amount of substance (mole, mol). */\n N: number;\n /** Luminous intensity (candela, cd). */\n J: number;\n}\n\nexport const DIMENSIONLESS: Dimension = { L: 0, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 };\n\n// --- Mechanics ---\n//\n// Named-dimension constants: one owner for each shape. The atlas families and\n// the canonical entries each spelled PRESSURE, SPRING_CONSTANT, CAPACITANCE,\n// INDUCTANCE, RESISTANCE, THERMAL_CONDUCTIVITY, SPECIFIC_HEAT, VISCOSITY,\n// VOLUME, PERMITTIVITY, MOMENTUM and ELECTRIC_FIELD by exponents; those shapes\n// are named here, as are LINEAR_DENSITY, WAVENUMBER, DIFFUSIVITY, ENERGY_FLUX,\n// GRAVITATIONAL_CONSTANT and RESISTIVITY, each stated by exponents in two or\n// more of those modules. A shape named here is NOT a row of NAMED_DIMENSIONS unless\n// `format()` is meant to print its name: adding a row changes every printed\n// dimension of that shape.\nexport const LENGTH: Dimension = { L: 1, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 };\nexport const AREA: Dimension = { L: 2, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 };\nexport const TIME: Dimension = { L: 0, M: 0, T: 1, I: 0, Theta: 0, N: 0, J: 0 };\nexport const FREQUENCY: Dimension = { L: 0, M: 0, T: -1, I: 0, Theta: 0, N: 0, J: 0 };\nexport const MASS: Dimension = { L: 0, M: 1, T: 0, I: 0, Theta: 0, N: 0, J: 0 };\n/** Mass density, kilogram per cubic metre. */\nexport const MASS_DENSITY: Dimension = { L: -3, M: 1, T: 0, I: 0, Theta: 0, N: 0, J: 0 };\nexport const VELOCITY: Dimension = { L: 1, M: 0, T: -1, I: 0, Theta: 0, N: 0, J: 0 };\nexport const ACCELERATION: Dimension = { L: 1, M: 0, T: -2, I: 0, Theta: 0, N: 0, J: 0 };\nexport const FORCE: Dimension = { L: 1, M: 1, T: -2, I: 0, Theta: 0, N: 0, J: 0 }; // newton\nexport const ENERGY: Dimension = { L: 2, M: 1, T: -2, I: 0, Theta: 0, N: 0, J: 0 }; // joule\nexport const POWER: Dimension = { L: 2, M: 1, T: -3, I: 0, Theta: 0, N: 0, J: 0 }; // watt\nexport const ACTION: Dimension = { L: 2, M: 1, T: -1, I: 0, Theta: 0, N: 0, J: 0 }; // J·s\n/** Volume, cubic metre. */\nexport const VOLUME: Dimension = { L: 3, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 };\n/** Momentum, kilogram metre per second. */\nexport const MOMENTUM: Dimension = { L: 1, M: 1, T: -1, I: 0, Theta: 0, N: 0, J: 0 };\n/** Pressure, pascal. */\nexport const PRESSURE: Dimension = { L: -1, M: 1, T: -2, I: 0, Theta: 0, N: 0, J: 0 };\n/** Spring constant, newton per metre. */\nexport const SPRING_CONSTANT: Dimension = { L: 0, M: 1, T: -2, I: 0, Theta: 0, N: 0, J: 0 };\n/** Dynamic viscosity, pascal second. */\nexport const VISCOSITY: Dimension = { L: -1, M: 1, T: -1, I: 0, Theta: 0, N: 0, J: 0 };\n/** Linear mass density, kilogram per metre. */\nexport const LINEAR_DENSITY: Dimension = { L: -1, M: 1, T: 0, I: 0, Theta: 0, N: 0, J: 0 };\n/** Wavenumber (any inverse length: a spatial frequency, a turn density), per metre. */\nexport const WAVENUMBER: Dimension = { L: -1, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 };\n/** Diffusivity (mass, thermal or momentum), square metre per second. */\nexport const DIFFUSIVITY: Dimension = { L: 2, M: 0, T: -1, I: 0, Theta: 0, N: 0, J: 0 };\n/** Energy flux density (power per area: intensity, a Poynting or radiative flux), watt per square metre. */\nexport const ENERGY_FLUX: Dimension = { L: 0, M: 1, T: -3, I: 0, Theta: 0, N: 0, J: 0 };\n/** The dimension of Newton's constant G, cubic metre per kilogram second squared. */\nexport const GRAVITATIONAL_CONSTANT: Dimension = { L: 3, M: -1, T: -2, I: 0, Theta: 0, N: 0, J: 0 };\n\n// --- Thermodynamics ---\nexport const TEMPERATURE: Dimension = { L: 0, M: 0, T: 0, I: 0, Theta: 1, N: 0, J: 0 };\nexport const ENTROPY: Dimension = { L: 2, M: 1, T: -2, I: 0, Theta: -1, N: 0, J: 0 }; // J/K\n/** Thermal conductivity, watt per metre kelvin. */\nexport const THERMAL_CONDUCTIVITY: Dimension = { L: 1, M: 1, T: -3, I: 0, Theta: -1, N: 0, J: 0 };\n/** Specific heat capacity, joule per kilogram kelvin. */\nexport const SPECIFIC_HEAT: Dimension = { L: 2, M: 0, T: -2, I: 0, Theta: -1, N: 0, J: 0 };\n\n// --- Electromagnetism (SI) ---\nexport const CHARGE: Dimension = { L: 0, M: 0, T: 1, I: 1, Theta: 0, N: 0, J: 0 }; // coulomb = A·s\n/** Capacitance, farad. */\nexport const CAPACITANCE: Dimension = { L: -2, M: -1, T: 4, I: 2, Theta: 0, N: 0, J: 0 };\n/** Inductance, henry. */\nexport const INDUCTANCE: Dimension = { L: 2, M: 1, T: -2, I: -2, Theta: 0, N: 0, J: 0 };\n/** Resistance, ohm. */\nexport const RESISTANCE: Dimension = { L: 2, M: 1, T: -3, I: -2, Theta: 0, N: 0, J: 0 };\n/** Permittivity, farad per metre. */\nexport const PERMITTIVITY: Dimension = { L: -3, M: -1, T: 4, I: 2, Theta: 0, N: 0, J: 0 };\n/** Electric field, volt per metre. */\nexport const ELECTRIC_FIELD: Dimension = { L: 1, M: 1, T: -3, I: -1, Theta: 0, N: 0, J: 0 };\n/** Electrical resistivity, ohm metre. */\nexport const RESISTIVITY: Dimension = { L: 3, M: 1, T: -3, I: -2, Theta: 0, N: 0, J: 0 };\n\n// --- Curated lookup table for `format()` to recognize named SI dimensions. ---\n// Order matters only for tie-breaks; the first matching name wins.\nexport const NAMED_DIMENSIONS: ReadonlyArray<readonly [string, Dimension]> = [\n ['dimensionless', DIMENSIONLESS],\n ['length', LENGTH],\n ['area', AREA],\n ['time', TIME],\n ['frequency', FREQUENCY],\n ['mass', MASS],\n ['velocity', VELOCITY],\n ['acceleration', ACCELERATION],\n // action carries the same SI shape (J·s) as angular momentum; we keep\n // 'action' as the canonical name since hbar (the only consumer today)\n // is action-typed.\n ['action', ACTION],\n ['force', FORCE],\n ['energy', ENERGY],\n ['power', POWER],\n ['temperature', TEMPERATURE],\n ['entropy', ENTROPY],\n ['charge', CHARGE],\n];\n"]}
|