universal-physics-tensor 10.0.0 → 12.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.
Files changed (835) hide show
  1. package/README.md +39 -36
  2. package/bin/upt.mjs +13 -1
  3. package/data/applied-cases.json +1892 -0
  4. package/data/applied-cases.schema.json +194 -0
  5. package/data/atlas/atlas.json +25 -25
  6. package/data/atlas/atlas.jsonld +1 -1
  7. package/data/atlas/diffusion.json +6 -6
  8. package/data/atlas/oscillators.json +7 -7
  9. package/data/atlas/waves.json +14 -14
  10. package/data/atlas/witness-results.json +11 -11
  11. package/data/bridge-catalog.json +389 -230
  12. package/data/bridge-catalog.schema.json +45 -7
  13. package/data/units.json +6 -25
  14. package/dist/atlas/applicability.d.ts.map +1 -1
  15. package/dist/atlas/applicability.js +21 -15
  16. package/dist/atlas/applicability.js.map +1 -1
  17. package/dist/atlas/benchmark/hybrid-retrieval.d.ts +9 -1
  18. package/dist/atlas/benchmark/hybrid-retrieval.d.ts.map +1 -1
  19. package/dist/atlas/benchmark/hybrid-retrieval.js +15 -13
  20. package/dist/atlas/benchmark/hybrid-retrieval.js.map +1 -1
  21. package/dist/atlas/benchmark/loader.js +2 -2
  22. package/dist/atlas/benchmark/loader.js.map +1 -1
  23. package/dist/atlas/benchmark/stats.d.ts +2 -2
  24. package/dist/atlas/benchmark/stats.d.ts.map +1 -1
  25. package/dist/atlas/benchmark/stats.js +9 -15
  26. package/dist/atlas/benchmark/stats.js.map +1 -1
  27. package/dist/atlas/catalog-formal-ref.d.ts +26 -3
  28. package/dist/atlas/catalog-formal-ref.d.ts.map +1 -1
  29. package/dist/atlas/catalog-formal-ref.js +52 -5
  30. package/dist/atlas/catalog-formal-ref.js.map +1 -1
  31. package/dist/atlas/chain-pipeline.d.ts.map +1 -1
  32. package/dist/atlas/chain-pipeline.js +7 -8
  33. package/dist/atlas/chain-pipeline.js.map +1 -1
  34. package/dist/atlas/diffusion/bridges-closure.d.ts +0 -4
  35. package/dist/atlas/diffusion/bridges-closure.d.ts.map +1 -1
  36. package/dist/atlas/diffusion/bridges-closure.js +8 -12
  37. package/dist/atlas/diffusion/bridges-closure.js.map +1 -1
  38. package/dist/atlas/diffusion/bridges.d.ts.map +1 -1
  39. package/dist/atlas/diffusion/bridges.js +27 -39
  40. package/dist/atlas/diffusion/bridges.js.map +1 -1
  41. package/dist/atlas/diffusion/dimensions.d.ts +6 -14
  42. package/dist/atlas/diffusion/dimensions.d.ts.map +1 -1
  43. package/dist/atlas/diffusion/dimensions.js +8 -16
  44. package/dist/atlas/diffusion/dimensions.js.map +1 -1
  45. package/dist/atlas/diffusion/models.d.ts +3 -3
  46. package/dist/atlas/diffusion/models.d.ts.map +1 -1
  47. package/dist/atlas/diffusion/models.js +5 -10
  48. package/dist/atlas/diffusion/models.js.map +1 -1
  49. package/dist/atlas/diffusion/numerics.d.ts +16 -4
  50. package/dist/atlas/diffusion/numerics.d.ts.map +1 -1
  51. package/dist/atlas/diffusion/numerics.js +38 -24
  52. package/dist/atlas/diffusion/numerics.js.map +1 -1
  53. package/dist/atlas/link-prediction.d.ts +106 -3
  54. package/dist/atlas/link-prediction.d.ts.map +1 -1
  55. package/dist/atlas/link-prediction.js +212 -66
  56. package/dist/atlas/link-prediction.js.map +1 -1
  57. package/dist/atlas/oscillators/bridges-coarse.d.ts.map +1 -1
  58. package/dist/atlas/oscillators/bridges-coarse.js +7 -11
  59. package/dist/atlas/oscillators/bridges-coarse.js.map +1 -1
  60. package/dist/atlas/oscillators/bridges-exact.d.ts.map +1 -1
  61. package/dist/atlas/oscillators/bridges-exact.js +6 -7
  62. package/dist/atlas/oscillators/bridges-exact.js.map +1 -1
  63. package/dist/atlas/oscillators/bridges-limits.d.ts +3 -16
  64. package/dist/atlas/oscillators/bridges-limits.d.ts.map +1 -1
  65. package/dist/atlas/oscillators/bridges-limits.js +23 -34
  66. package/dist/atlas/oscillators/bridges-limits.js.map +1 -1
  67. package/dist/atlas/oscillators/dimensions.d.ts +9 -21
  68. package/dist/atlas/oscillators/dimensions.d.ts.map +1 -1
  69. package/dist/atlas/oscillators/dimensions.js +9 -21
  70. package/dist/atlas/oscillators/dimensions.js.map +1 -1
  71. package/dist/atlas/oscillators/limit-witnesses.d.ts +2 -2
  72. package/dist/atlas/oscillators/limit-witnesses.d.ts.map +1 -1
  73. package/dist/atlas/oscillators/limit-witnesses.js +17 -15
  74. package/dist/atlas/oscillators/limit-witnesses.js.map +1 -1
  75. package/dist/atlas/oscillators/models.d.ts.map +1 -1
  76. package/dist/atlas/oscillators/models.js +2 -6
  77. package/dist/atlas/oscillators/models.js.map +1 -1
  78. package/dist/atlas/oscillators/pendulum-motion.d.ts +29 -6
  79. package/dist/atlas/oscillators/pendulum-motion.d.ts.map +1 -1
  80. package/dist/atlas/oscillators/pendulum-motion.js +60 -40
  81. package/dist/atlas/oscillators/pendulum-motion.js.map +1 -1
  82. package/dist/atlas/oscillators/phase-translation.d.ts +0 -11
  83. package/dist/atlas/oscillators/phase-translation.d.ts.map +1 -1
  84. package/dist/atlas/oscillators/phase-translation.js +3 -4
  85. package/dist/atlas/oscillators/phase-translation.js.map +1 -1
  86. package/dist/atlas/oscillators/position-translation.d.ts +68 -7
  87. package/dist/atlas/oscillators/position-translation.d.ts.map +1 -1
  88. package/dist/atlas/oscillators/position-translation.js +123 -12
  89. package/dist/atlas/oscillators/position-translation.js.map +1 -1
  90. package/dist/atlas/oscillators/rejections.d.ts +0 -2
  91. package/dist/atlas/oscillators/rejections.d.ts.map +1 -1
  92. package/dist/atlas/oscillators/rejections.js +0 -7
  93. package/dist/atlas/oscillators/rejections.js.map +1 -1
  94. package/dist/atlas/physjs-entries.generated.d.ts +35 -25
  95. package/dist/atlas/physjs-entries.generated.d.ts.map +1 -1
  96. package/dist/atlas/physjs-entries.generated.js +37 -25
  97. package/dist/atlas/physjs-entries.generated.js.map +1 -1
  98. package/dist/atlas/physjs-ref.d.ts +34 -31
  99. package/dist/atlas/physjs-ref.d.ts.map +1 -1
  100. package/dist/atlas/physjs-ref.js +55 -53
  101. package/dist/atlas/physjs-ref.js.map +1 -1
  102. package/dist/atlas/physjs-reviewed.d.ts +1 -1
  103. package/dist/atlas/physjs-reviewed.js +15 -15
  104. package/dist/atlas/physjs-reviewed.js.map +1 -1
  105. package/dist/atlas/poster/statements.d.ts +0 -19
  106. package/dist/atlas/poster/statements.d.ts.map +1 -1
  107. package/dist/atlas/poster/statements.js +1 -1
  108. package/dist/atlas/poster/statements.js.map +1 -1
  109. package/dist/atlas/proof-target.d.ts +1 -1
  110. package/dist/atlas/proof-target.js +1 -1
  111. package/dist/atlas/proof-target.js.map +1 -1
  112. package/dist/atlas/regime.d.ts +1 -1
  113. package/dist/atlas/regime.d.ts.map +1 -1
  114. package/dist/atlas/regime.js +1 -1
  115. package/dist/atlas/regime.js.map +1 -1
  116. package/dist/atlas/text-overlap.d.ts +23 -0
  117. package/dist/atlas/text-overlap.d.ts.map +1 -0
  118. package/dist/atlas/text-overlap.js +41 -0
  119. package/dist/atlas/text-overlap.js.map +1 -0
  120. package/dist/atlas/waves/bridges-closure.d.ts.map +1 -1
  121. package/dist/atlas/waves/bridges-closure.js +2 -6
  122. package/dist/atlas/waves/bridges-closure.js.map +1 -1
  123. package/dist/atlas/waves/bridges.d.ts.map +1 -1
  124. package/dist/atlas/waves/bridges.js +32 -48
  125. package/dist/atlas/waves/bridges.js.map +1 -1
  126. package/dist/atlas/waves/models.d.ts +5 -6
  127. package/dist/atlas/waves/models.d.ts.map +1 -1
  128. package/dist/atlas/waves/models.js +7 -13
  129. package/dist/atlas/waves/models.js.map +1 -1
  130. package/dist/atlas/waves/numerics.d.ts.map +1 -1
  131. package/dist/atlas/waves/numerics.js +10 -3
  132. package/dist/atlas/waves/numerics.js.map +1 -1
  133. package/dist/atlas/witness-numeric.d.ts +30 -0
  134. package/dist/atlas/witness-numeric.d.ts.map +1 -1
  135. package/dist/atlas/witness-numeric.js +53 -0
  136. package/dist/atlas/witness-numeric.js.map +1 -1
  137. package/dist/atlas/witness-specs.d.ts.map +1 -1
  138. package/dist/atlas/witness-specs.js +19 -0
  139. package/dist/atlas/witness-specs.js.map +1 -1
  140. package/dist/atlas/witness-symbolic.d.ts +75 -3
  141. package/dist/atlas/witness-symbolic.d.ts.map +1 -1
  142. package/dist/atlas/witness-symbolic.js +116 -10
  143. package/dist/atlas/witness-symbolic.js.map +1 -1
  144. package/dist/bridges/catalog-load.d.ts.map +1 -1
  145. package/dist/bridges/catalog-load.js +13 -8
  146. package/dist/bridges/catalog-load.js.map +1 -1
  147. package/dist/bridges/catalog-types.d.ts +26 -2
  148. package/dist/bridges/catalog-types.d.ts.map +1 -1
  149. package/dist/bridges/catalog-types.js +11 -1
  150. package/dist/bridges/catalog-types.js.map +1 -1
  151. package/dist/bridges/evaluation-errors.d.ts +31 -1
  152. package/dist/bridges/evaluation-errors.d.ts.map +1 -1
  153. package/dist/bridges/evaluation-errors.js +20 -2
  154. package/dist/bridges/evaluation-errors.js.map +1 -1
  155. package/dist/bridges/evaluator-inputs.d.ts.map +1 -1
  156. package/dist/bridges/evaluator-inputs.js +7 -5
  157. package/dist/bridges/evaluator-inputs.js.map +1 -1
  158. package/dist/bridges/evaluators.d.ts.map +1 -1
  159. package/dist/bridges/evaluators.js +27 -12
  160. package/dist/bridges/evaluators.js.map +1 -1
  161. package/dist/bridges/expr-parse.d.ts +11 -0
  162. package/dist/bridges/expr-parse.d.ts.map +1 -1
  163. package/dist/bridges/expr-parse.js +14 -5
  164. package/dist/bridges/expr-parse.js.map +1 -1
  165. package/dist/bridges/holds.d.ts +35 -3
  166. package/dist/bridges/holds.d.ts.map +1 -1
  167. package/dist/bridges/holds.js +117 -23
  168. package/dist/bridges/holds.js.map +1 -1
  169. package/dist/bridges/notices.d.ts.map +1 -1
  170. package/dist/bridges/notices.js +5 -5
  171. package/dist/bridges/notices.js.map +1 -1
  172. package/dist/bridges/relation-eval.d.ts +4 -4
  173. package/dist/bridges/relation-eval.d.ts.map +1 -1
  174. package/dist/bridges/relation-eval.js +15 -16
  175. package/dist/bridges/relation-eval.js.map +1 -1
  176. package/dist/bridges/sensitivity.d.ts.map +1 -1
  177. package/dist/bridges/sensitivity.js +3 -3
  178. package/dist/bridges/sensitivity.js.map +1 -1
  179. package/dist/bridges/validity.d.ts +33 -0
  180. package/dist/bridges/validity.d.ts.map +1 -0
  181. package/dist/bridges/validity.js +67 -0
  182. package/dist/bridges/validity.js.map +1 -0
  183. package/dist/canonical/entries/atomic.js +1 -3
  184. package/dist/canonical/entries/atomic.js.map +1 -1
  185. package/dist/canonical/entries/condensed-matter.d.ts.map +1 -1
  186. package/dist/canonical/entries/condensed-matter.js +4 -5
  187. package/dist/canonical/entries/condensed-matter.js.map +1 -1
  188. package/dist/canonical/entries/dimensional-classics.d.ts.map +1 -1
  189. package/dist/canonical/entries/dimensional-classics.js +3 -4
  190. package/dist/canonical/entries/dimensional-classics.js.map +1 -1
  191. package/dist/canonical/entries/electromagnetism.d.ts.map +1 -1
  192. package/dist/canonical/entries/electromagnetism.js +4 -10
  193. package/dist/canonical/entries/electromagnetism.js.map +1 -1
  194. package/dist/canonical/entries/fluids-waves.d.ts.map +1 -1
  195. package/dist/canonical/entries/fluids-waves.js +3 -7
  196. package/dist/canonical/entries/fluids-waves.js.map +1 -1
  197. package/dist/canonical/entries/mechanics.d.ts.map +1 -1
  198. package/dist/canonical/entries/mechanics.js +4 -6
  199. package/dist/canonical/entries/mechanics.js.map +1 -1
  200. package/dist/canonical/entries/nonmonomial.d.ts.map +1 -1
  201. package/dist/canonical/entries/nonmonomial.js +9 -17
  202. package/dist/canonical/entries/nonmonomial.js.map +1 -1
  203. package/dist/canonical/entries/relativity.d.ts.map +1 -1
  204. package/dist/canonical/entries/relativity.js +6 -6
  205. package/dist/canonical/entries/relativity.js.map +1 -1
  206. package/dist/canonical/entries/thermo-nuclear-cosmo.d.ts.map +1 -1
  207. package/dist/canonical/entries/thermo-nuclear-cosmo.js +6 -10
  208. package/dist/canonical/entries/thermo-nuclear-cosmo.js.map +1 -1
  209. package/dist/canonical/fixed-points.d.ts +94 -0
  210. package/dist/canonical/fixed-points.d.ts.map +1 -0
  211. package/dist/canonical/fixed-points.js +81 -0
  212. package/dist/canonical/fixed-points.js.map +1 -0
  213. package/dist/canonical/linkage.d.ts.map +1 -1
  214. package/dist/canonical/linkage.js +25 -44
  215. package/dist/canonical/linkage.js.map +1 -1
  216. package/dist/canonical/normal-form.d.ts.map +1 -1
  217. package/dist/canonical/normal-form.js +5 -11
  218. package/dist/canonical/normal-form.js.map +1 -1
  219. package/dist/canonical/structural.d.ts +21 -21
  220. package/dist/canonical/structural.d.ts.map +1 -1
  221. package/dist/canonical/structural.js +40 -19
  222. package/dist/canonical/structural.js.map +1 -1
  223. package/dist/cases/catalog-checks.d.ts +10 -0
  224. package/dist/cases/catalog-checks.d.ts.map +1 -0
  225. package/dist/cases/catalog-checks.js +241 -0
  226. package/dist/cases/catalog-checks.js.map +1 -0
  227. package/dist/cases/catalog.d.ts +83 -0
  228. package/dist/cases/catalog.d.ts.map +1 -0
  229. package/dist/cases/catalog.js +118 -0
  230. package/dist/cases/catalog.js.map +1 -0
  231. package/dist/cases/engine.d.ts +13 -0
  232. package/dist/cases/engine.d.ts.map +1 -0
  233. package/dist/cases/engine.js +179 -0
  234. package/dist/cases/engine.js.map +1 -0
  235. package/dist/cases/index.d.ts.map +1 -1
  236. package/dist/cases/index.js +5 -7
  237. package/dist/cases/index.js.map +1 -1
  238. package/dist/cases/methods.d.ts +215 -0
  239. package/dist/cases/methods.d.ts.map +1 -0
  240. package/dist/cases/methods.js +743 -0
  241. package/dist/cases/methods.js.map +1 -0
  242. package/dist/cases/quadrature.d.ts +7 -9
  243. package/dist/cases/quadrature.d.ts.map +1 -1
  244. package/dist/cases/quadrature.js +28 -32
  245. package/dist/cases/quadrature.js.map +1 -1
  246. package/dist/cases/types.d.ts +12 -0
  247. package/dist/cases/types.d.ts.map +1 -1
  248. package/dist/cases/types.js.map +1 -1
  249. package/dist/cli/args.d.ts +25 -1
  250. package/dist/cli/args.d.ts.map +1 -1
  251. package/dist/cli/args.js +30 -8
  252. package/dist/cli/args.js.map +1 -1
  253. package/dist/cli/bindings.d.ts.map +1 -1
  254. package/dist/cli/bindings.js +5 -4
  255. package/dist/cli/bindings.js.map +1 -1
  256. package/dist/cli/command.d.ts +11 -1
  257. package/dist/cli/command.d.ts.map +1 -1
  258. package/dist/cli/command.js.map +1 -1
  259. package/dist/cli/commands/_atlas-map.d.ts +0 -9
  260. package/dist/cli/commands/_atlas-map.d.ts.map +1 -1
  261. package/dist/cli/commands/_atlas-map.js +8 -18
  262. package/dist/cli/commands/_atlas-map.js.map +1 -1
  263. package/dist/cli/commands/_atlas-route.d.ts.map +1 -1
  264. package/dist/cli/commands/_atlas-route.js +6 -2
  265. package/dist/cli/commands/_atlas-route.js.map +1 -1
  266. package/dist/cli/commands/_discovery-opts.d.ts +1 -0
  267. package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
  268. package/dist/cli/commands/_discovery-opts.js +9 -9
  269. package/dist/cli/commands/_discovery-opts.js.map +1 -1
  270. package/dist/cli/commands/atlas.d.ts.map +1 -1
  271. package/dist/cli/commands/atlas.js +8 -5
  272. package/dist/cli/commands/atlas.js.map +1 -1
  273. package/dist/cli/commands/audit.d.ts.map +1 -1
  274. package/dist/cli/commands/audit.js +8 -1
  275. package/dist/cli/commands/audit.js.map +1 -1
  276. package/dist/cli/commands/axes.d.ts.map +1 -1
  277. package/dist/cli/commands/axes.js +20 -1
  278. package/dist/cli/commands/axes.js.map +1 -1
  279. package/dist/cli/commands/confront.d.ts.map +1 -1
  280. package/dist/cli/commands/confront.js +8 -14
  281. package/dist/cli/commands/confront.js.map +1 -1
  282. package/dist/cli/commands/derive.d.ts.map +1 -1
  283. package/dist/cli/commands/derive.js +22 -22
  284. package/dist/cli/commands/derive.js.map +1 -1
  285. package/dist/cli/commands/discover.d.ts.map +1 -1
  286. package/dist/cli/commands/discover.js +122 -73
  287. package/dist/cli/commands/discover.js.map +1 -1
  288. package/dist/cli/commands/eval.d.ts.map +1 -1
  289. package/dist/cli/commands/eval.js +1 -0
  290. package/dist/cli/commands/eval.js.map +1 -1
  291. package/dist/cli/commands/evaluate.d.ts.map +1 -1
  292. package/dist/cli/commands/evaluate.js +67 -39
  293. package/dist/cli/commands/evaluate.js.map +1 -1
  294. package/dist/cli/commands/explain.d.ts.map +1 -1
  295. package/dist/cli/commands/explain.js +24 -3
  296. package/dist/cli/commands/explain.js.map +1 -1
  297. package/dist/cli/commands/ground.d.ts.map +1 -1
  298. package/dist/cli/commands/ground.js +7 -1
  299. package/dist/cli/commands/ground.js.map +1 -1
  300. package/dist/cli/commands/map.d.ts.map +1 -1
  301. package/dist/cli/commands/map.js +84 -11
  302. package/dist/cli/commands/map.js.map +1 -1
  303. package/dist/cli/commands/metric.d.ts.map +1 -1
  304. package/dist/cli/commands/metric.js +12 -9
  305. package/dist/cli/commands/metric.js.map +1 -1
  306. package/dist/cli/commands/path.d.ts +10 -0
  307. package/dist/cli/commands/path.d.ts.map +1 -1
  308. package/dist/cli/commands/path.js +25 -3
  309. package/dist/cli/commands/path.js.map +1 -1
  310. package/dist/cli/commands/probe.d.ts.map +1 -1
  311. package/dist/cli/commands/probe.js +59 -16
  312. package/dist/cli/commands/probe.js.map +1 -1
  313. package/dist/cli/commands/regime.d.ts.map +1 -1
  314. package/dist/cli/commands/regime.js +1 -0
  315. package/dist/cli/commands/regime.js.map +1 -1
  316. package/dist/cli/commands/retrieve.d.ts.map +1 -1
  317. package/dist/cli/commands/retrieve.js +1 -0
  318. package/dist/cli/commands/retrieve.js.map +1 -1
  319. package/dist/cli/commands/search.d.ts.map +1 -1
  320. package/dist/cli/commands/search.js +1 -0
  321. package/dist/cli/commands/search.js.map +1 -1
  322. package/dist/cli/commands/symbolic.d.ts.map +1 -1
  323. package/dist/cli/commands/symbolic.js +19 -28
  324. package/dist/cli/commands/symbolic.js.map +1 -1
  325. package/dist/cli/commands/testplan.d.ts.map +1 -1
  326. package/dist/cli/commands/testplan.js +4 -2
  327. package/dist/cli/commands/testplan.js.map +1 -1
  328. package/dist/cli/determination.d.ts +1 -0
  329. package/dist/cli/determination.d.ts.map +1 -1
  330. package/dist/cli/determination.js.map +1 -1
  331. package/dist/cli/expr-print.d.ts +0 -2
  332. package/dist/cli/expr-print.d.ts.map +1 -1
  333. package/dist/cli/expr-print.js +7 -31
  334. package/dist/cli/expr-print.js.map +1 -1
  335. package/dist/cli/flag-help.d.ts +1 -0
  336. package/dist/cli/flag-help.d.ts.map +1 -1
  337. package/dist/cli/flag-help.js +1 -0
  338. package/dist/cli/flag-help.js.map +1 -1
  339. package/dist/cli/graphs.d.ts +2 -0
  340. package/dist/cli/graphs.d.ts.map +1 -1
  341. package/dist/cli/graphs.js +1 -0
  342. package/dist/cli/graphs.js.map +1 -1
  343. package/dist/cli/main.d.ts +8 -0
  344. package/dist/cli/main.d.ts.map +1 -1
  345. package/dist/cli/main.js +19 -3
  346. package/dist/cli/main.js.map +1 -1
  347. package/dist/cli/numeric-flag.d.ts +12 -0
  348. package/dist/cli/numeric-flag.d.ts.map +1 -0
  349. package/dist/cli/numeric-flag.js +44 -0
  350. package/dist/cli/numeric-flag.js.map +1 -0
  351. package/dist/cli/output.d.ts +28 -0
  352. package/dist/cli/output.d.ts.map +1 -1
  353. package/dist/cli/output.js +23 -0
  354. package/dist/cli/output.js.map +1 -1
  355. package/dist/cli/record-reach.js +2 -2
  356. package/dist/cli/record-reach.js.map +1 -1
  357. package/dist/cli/record-tables.d.ts.map +1 -1
  358. package/dist/cli/record-tables.js +6 -5
  359. package/dist/cli/record-tables.js.map +1 -1
  360. package/dist/cli/record.d.ts +1 -5
  361. package/dist/cli/record.d.ts.map +1 -1
  362. package/dist/cli/record.js +9 -8
  363. package/dist/cli/record.js.map +1 -1
  364. package/dist/cli/search-index.d.ts.map +1 -1
  365. package/dist/cli/search-index.js +7 -6
  366. package/dist/cli/search-index.js.map +1 -1
  367. package/dist/cli/statuses.d.ts +0 -2
  368. package/dist/cli/statuses.d.ts.map +1 -1
  369. package/dist/cli/statuses.js +12 -9
  370. package/dist/cli/statuses.js.map +1 -1
  371. package/dist/cli/stored-results.d.ts +7 -0
  372. package/dist/cli/stored-results.d.ts.map +1 -0
  373. package/dist/cli/stored-results.js +23 -0
  374. package/dist/cli/stored-results.js.map +1 -0
  375. package/dist/cli/version.d.ts +1 -0
  376. package/dist/cli/version.d.ts.map +1 -1
  377. package/dist/cli/version.js +8 -5
  378. package/dist/cli/version.js.map +1 -1
  379. package/dist/cli-api.d.ts +36 -5
  380. package/dist/cli-api.d.ts.map +1 -1
  381. package/dist/cli-api.js +30 -4
  382. package/dist/cli-api.js.map +1 -1
  383. package/dist/composition/algebraic-equivalence.d.ts +43 -0
  384. package/dist/composition/algebraic-equivalence.d.ts.map +1 -0
  385. package/dist/composition/algebraic-equivalence.js +115 -0
  386. package/dist/composition/algebraic-equivalence.js.map +1 -0
  387. package/dist/composition/axes.d.ts +0 -6
  388. package/dist/composition/axes.d.ts.map +1 -1
  389. package/dist/composition/axes.js +6 -6
  390. package/dist/composition/axes.js.map +1 -1
  391. package/dist/composition/axis-audit.d.ts +47 -20
  392. package/dist/composition/axis-audit.d.ts.map +1 -1
  393. package/dist/composition/axis-audit.js +82 -9
  394. package/dist/composition/axis-audit.js.map +1 -1
  395. package/dist/composition/bridge-analysis.d.ts +17 -0
  396. package/dist/composition/bridge-analysis.d.ts.map +1 -1
  397. package/dist/composition/bridge-analysis.js +102 -55
  398. package/dist/composition/bridge-analysis.js.map +1 -1
  399. package/dist/composition/canonical-compare.d.ts +40 -0
  400. package/dist/composition/canonical-compare.d.ts.map +1 -1
  401. package/dist/composition/canonical-compare.js +122 -24
  402. package/dist/composition/canonical-compare.js.map +1 -1
  403. package/dist/composition/canonical-graph.d.ts +3 -3
  404. package/dist/composition/canonical-graph.d.ts.map +1 -1
  405. package/dist/composition/canonical-graph.js +11 -38
  406. package/dist/composition/canonical-graph.js.map +1 -1
  407. package/dist/composition/canonical-json.js +2 -2
  408. package/dist/composition/canonical-json.js.map +1 -1
  409. package/dist/composition/catalog-graph.d.ts.map +1 -1
  410. package/dist/composition/catalog-graph.js +2 -5
  411. package/dist/composition/catalog-graph.js.map +1 -1
  412. package/dist/composition/chain-candidate.d.ts +8 -0
  413. package/dist/composition/chain-candidate.d.ts.map +1 -1
  414. package/dist/composition/chain-candidate.js +9 -2
  415. package/dist/composition/chain-candidate.js.map +1 -1
  416. package/dist/composition/chain-match.d.ts +6 -3
  417. package/dist/composition/chain-match.d.ts.map +1 -1
  418. package/dist/composition/chain-match.js +4 -1
  419. package/dist/composition/chain-match.js.map +1 -1
  420. package/dist/composition/chain-result.d.ts.map +1 -1
  421. package/dist/composition/chain-result.js +2 -14
  422. package/dist/composition/chain-result.js.map +1 -1
  423. package/dist/composition/compose-symbolic.d.ts.map +1 -1
  424. package/dist/composition/compose-symbolic.js +3 -2
  425. package/dist/composition/compose-symbolic.js.map +1 -1
  426. package/dist/composition/compose.d.ts.map +1 -1
  427. package/dist/composition/compose.js +13 -5
  428. package/dist/composition/compose.js.map +1 -1
  429. package/dist/composition/composition-recovery.d.ts.map +1 -1
  430. package/dist/composition/composition-recovery.js +4 -7
  431. package/dist/composition/composition-recovery.js.map +1 -1
  432. package/dist/composition/consequence.d.ts +15 -5
  433. package/dist/composition/consequence.d.ts.map +1 -1
  434. package/dist/composition/consequence.js +6 -4
  435. package/dist/composition/consequence.js.map +1 -1
  436. package/dist/composition/discovery.d.ts +129 -9
  437. package/dist/composition/discovery.d.ts.map +1 -1
  438. package/dist/composition/discovery.js +171 -67
  439. package/dist/composition/discovery.js.map +1 -1
  440. package/dist/composition/edge.d.ts +21 -2
  441. package/dist/composition/edge.d.ts.map +1 -1
  442. package/dist/composition/edge.js +23 -1
  443. package/dist/composition/edge.js.map +1 -1
  444. package/dist/composition/enumerate.d.ts.map +1 -1
  445. package/dist/composition/enumerate.js +18 -3
  446. package/dist/composition/enumerate.js.map +1 -1
  447. package/dist/composition/evaluate-relation.d.ts +35 -11
  448. package/dist/composition/evaluate-relation.d.ts.map +1 -1
  449. package/dist/composition/evaluate-relation.js +60 -39
  450. package/dist/composition/evaluate-relation.js.map +1 -1
  451. package/dist/composition/explain.d.ts +3 -12
  452. package/dist/composition/explain.d.ts.map +1 -1
  453. package/dist/composition/explain.js +7 -20
  454. package/dist/composition/explain.js.map +1 -1
  455. package/dist/composition/expr-eval.d.ts +1 -1
  456. package/dist/composition/expr-eval.d.ts.map +1 -1
  457. package/dist/composition/expr-eval.js +6 -15
  458. package/dist/composition/expr-eval.js.map +1 -1
  459. package/dist/composition/expr-simplify.d.ts +26 -14
  460. package/dist/composition/expr-simplify.d.ts.map +1 -1
  461. package/dist/composition/expr-simplify.js +64 -72
  462. package/dist/composition/expr-simplify.js.map +1 -1
  463. package/dist/composition/formula-shape.d.ts +23 -4
  464. package/dist/composition/formula-shape.d.ts.map +1 -1
  465. package/dist/composition/formula-shape.js +57 -17
  466. package/dist/composition/formula-shape.js.map +1 -1
  467. package/dist/composition/graph-structure.d.ts +98 -0
  468. package/dist/composition/graph-structure.d.ts.map +1 -0
  469. package/dist/composition/graph-structure.js +167 -0
  470. package/dist/composition/graph-structure.js.map +1 -0
  471. package/dist/composition/graph-viz-svg.d.ts.map +1 -1
  472. package/dist/composition/graph-viz-svg.js +1 -1
  473. package/dist/composition/graph-viz-svg.js.map +1 -1
  474. package/dist/composition/graph-viz.d.ts.map +1 -1
  475. package/dist/composition/graph-viz.js +8 -37
  476. package/dist/composition/graph-viz.js.map +1 -1
  477. package/dist/composition/grounding.d.ts.map +1 -1
  478. package/dist/composition/grounding.js +19 -7
  479. package/dist/composition/grounding.js.map +1 -1
  480. package/dist/composition/identifiability.d.ts +91 -4
  481. package/dist/composition/identifiability.d.ts.map +1 -1
  482. package/dist/composition/identifiability.js +363 -6
  483. package/dist/composition/identifiability.js.map +1 -1
  484. package/dist/composition/index.d.ts +8 -4
  485. package/dist/composition/index.d.ts.map +1 -1
  486. package/dist/composition/index.js +3 -2
  487. package/dist/composition/index.js.map +1 -1
  488. package/dist/composition/mathts-quiet.d.ts +7 -8
  489. package/dist/composition/mathts-quiet.d.ts.map +1 -1
  490. package/dist/composition/mathts-quiet.js +7 -16
  491. package/dist/composition/mathts-quiet.js.map +1 -1
  492. package/dist/composition/mathts-scalar-symbols.d.ts.map +1 -1
  493. package/dist/composition/mathts-scalar-symbols.js +2 -1
  494. package/dist/composition/mathts-scalar-symbols.js.map +1 -1
  495. package/dist/composition/own-equation-magnitude.d.ts +95 -0
  496. package/dist/composition/own-equation-magnitude.d.ts.map +1 -0
  497. package/dist/composition/own-equation-magnitude.js +270 -0
  498. package/dist/composition/own-equation-magnitude.js.map +1 -0
  499. package/dist/composition/probe/backend-protocol.d.ts +3 -0
  500. package/dist/composition/probe/backend-protocol.d.ts.map +1 -1
  501. package/dist/composition/probe/backend-protocol.js.map +1 -1
  502. package/dist/composition/probe/candidate-store.d.ts +1 -0
  503. package/dist/composition/probe/candidate-store.d.ts.map +1 -1
  504. package/dist/composition/probe/candidate-store.js +1 -0
  505. package/dist/composition/probe/candidate-store.js.map +1 -1
  506. package/dist/composition/probe/corpus.d.ts +8 -4
  507. package/dist/composition/probe/corpus.d.ts.map +1 -1
  508. package/dist/composition/probe/corpus.js +23 -12
  509. package/dist/composition/probe/corpus.js.map +1 -1
  510. package/dist/composition/probe/dataset.d.ts +18 -0
  511. package/dist/composition/probe/dataset.d.ts.map +1 -1
  512. package/dist/composition/probe/dataset.js +95 -50
  513. package/dist/composition/probe/dataset.js.map +1 -1
  514. package/dist/composition/probe/experiment-design.d.ts +7 -1
  515. package/dist/composition/probe/experiment-design.d.ts.map +1 -1
  516. package/dist/composition/probe/experiment-design.js +44 -24
  517. package/dist/composition/probe/experiment-design.js.map +1 -1
  518. package/dist/composition/probe/falsify.d.ts +2 -0
  519. package/dist/composition/probe/falsify.d.ts.map +1 -1
  520. package/dist/composition/probe/falsify.js +2 -0
  521. package/dist/composition/probe/falsify.js.map +1 -1
  522. package/dist/composition/probe/fit.d.ts +7 -0
  523. package/dist/composition/probe/fit.d.ts.map +1 -1
  524. package/dist/composition/probe/fit.js +46 -22
  525. package/dist/composition/probe/fit.js.map +1 -1
  526. package/dist/composition/probe/frontier.d.ts.map +1 -1
  527. package/dist/composition/probe/frontier.js +33 -15
  528. package/dist/composition/probe/frontier.js.map +1 -1
  529. package/dist/composition/probe/generator.d.ts +30 -1
  530. package/dist/composition/probe/generator.d.ts.map +1 -1
  531. package/dist/composition/probe/generator.js +58 -36
  532. package/dist/composition/probe/generator.js.map +1 -1
  533. package/dist/composition/probe/index.d.ts +14 -0
  534. package/dist/composition/probe/index.d.ts.map +1 -1
  535. package/dist/composition/probe/index.js +6 -0
  536. package/dist/composition/probe/index.js.map +1 -1
  537. package/dist/composition/probe/limits.d.ts +25 -1
  538. package/dist/composition/probe/limits.d.ts.map +1 -1
  539. package/dist/composition/probe/limits.js +53 -11
  540. package/dist/composition/probe/limits.js.map +1 -1
  541. package/dist/composition/probe/pipeline.d.ts +5 -0
  542. package/dist/composition/probe/pipeline.d.ts.map +1 -1
  543. package/dist/composition/probe/pipeline.js +73 -24
  544. package/dist/composition/probe/pipeline.js.map +1 -1
  545. package/dist/composition/probe/power-law.d.ts +121 -0
  546. package/dist/composition/probe/power-law.d.ts.map +1 -0
  547. package/dist/composition/probe/power-law.js +251 -0
  548. package/dist/composition/probe/power-law.js.map +1 -0
  549. package/dist/composition/probe/problem.d.ts +8 -4
  550. package/dist/composition/probe/problem.d.ts.map +1 -1
  551. package/dist/composition/probe/problem.js +177 -49
  552. package/dist/composition/probe/problem.js.map +1 -1
  553. package/dist/composition/probe/report.js +1 -1
  554. package/dist/composition/probe/report.js.map +1 -1
  555. package/dist/composition/probe/residual.d.ts +7 -1
  556. package/dist/composition/probe/residual.d.ts.map +1 -1
  557. package/dist/composition/probe/residual.js +10 -7
  558. package/dist/composition/probe/residual.js.map +1 -1
  559. package/dist/composition/probe/run-manifest.d.ts +1 -0
  560. package/dist/composition/probe/run-manifest.d.ts.map +1 -1
  561. package/dist/composition/probe/run-manifest.js.map +1 -1
  562. package/dist/composition/probe/scalar-search.d.ts +50 -0
  563. package/dist/composition/probe/scalar-search.d.ts.map +1 -0
  564. package/dist/composition/probe/scalar-search.js +169 -0
  565. package/dist/composition/probe/scalar-search.js.map +1 -0
  566. package/dist/composition/probe/scoring.d.ts +1 -0
  567. package/dist/composition/probe/scoring.d.ts.map +1 -1
  568. package/dist/composition/probe/scoring.js.map +1 -1
  569. package/dist/composition/probe/structure.d.ts +82 -17
  570. package/dist/composition/probe/structure.d.ts.map +1 -1
  571. package/dist/composition/probe/structure.js +129 -55
  572. package/dist/composition/probe/structure.js.map +1 -1
  573. package/dist/composition/probe/study.d.ts +31 -9
  574. package/dist/composition/probe/study.d.ts.map +1 -1
  575. package/dist/composition/probe/study.js +235 -184
  576. package/dist/composition/probe/study.js.map +1 -1
  577. package/dist/composition/probe/t-tail.d.ts +16 -0
  578. package/dist/composition/probe/t-tail.d.ts.map +1 -0
  579. package/dist/composition/probe/t-tail.js +29 -0
  580. package/dist/composition/probe/t-tail.js.map +1 -0
  581. package/dist/composition/probe/types.d.ts +3 -0
  582. package/dist/composition/probe/types.d.ts.map +1 -1
  583. package/dist/composition/probe/types.js.map +1 -1
  584. package/dist/composition/proposed-bridges.d.ts +52 -12
  585. package/dist/composition/proposed-bridges.d.ts.map +1 -1
  586. package/dist/composition/proposed-bridges.js +107 -60
  587. package/dist/composition/proposed-bridges.js.map +1 -1
  588. package/dist/composition/quantity-clusters.d.ts +48 -0
  589. package/dist/composition/quantity-clusters.d.ts.map +1 -0
  590. package/dist/composition/quantity-clusters.js +98 -0
  591. package/dist/composition/quantity-clusters.js.map +1 -0
  592. package/dist/composition/rational-exponent.d.ts +40 -0
  593. package/dist/composition/rational-exponent.d.ts.map +1 -0
  594. package/dist/composition/rational-exponent.js +65 -0
  595. package/dist/composition/rational-exponent.js.map +1 -0
  596. package/dist/composition/representative-values.d.ts +22 -0
  597. package/dist/composition/representative-values.d.ts.map +1 -1
  598. package/dist/composition/representative-values.js +29 -0
  599. package/dist/composition/representative-values.js.map +1 -1
  600. package/dist/composition/retrodiction.d.ts +15 -0
  601. package/dist/composition/retrodiction.d.ts.map +1 -1
  602. package/dist/composition/retrodiction.js +12 -4
  603. package/dist/composition/retrodiction.js.map +1 -1
  604. package/dist/composition/user-equation.d.ts +1 -0
  605. package/dist/composition/user-equation.d.ts.map +1 -1
  606. package/dist/composition/user-equation.js +3 -2
  607. package/dist/composition/user-equation.js.map +1 -1
  608. package/dist/core/assignment.d.ts +19 -0
  609. package/dist/core/assignment.d.ts.map +1 -0
  610. package/dist/core/assignment.js +19 -0
  611. package/dist/core/assignment.js.map +1 -0
  612. package/dist/core/compare.d.ts +32 -0
  613. package/dist/core/compare.d.ts.map +1 -0
  614. package/dist/core/compare.js +46 -0
  615. package/dist/core/compare.js.map +1 -0
  616. package/dist/core/constants.d.ts +42 -41
  617. package/dist/core/constants.d.ts.map +1 -1
  618. package/dist/core/constants.js +71 -51
  619. package/dist/core/constants.js.map +1 -1
  620. package/dist/core/data-file.d.ts +7 -0
  621. package/dist/core/data-file.d.ts.map +1 -1
  622. package/dist/core/data-file.js +17 -0
  623. package/dist/core/data-file.js.map +1 -1
  624. package/dist/core/format.d.ts +36 -0
  625. package/dist/core/format.d.ts.map +1 -0
  626. package/dist/core/format.js +39 -0
  627. package/dist/core/format.js.map +1 -0
  628. package/dist/core/hash.d.ts +14 -0
  629. package/dist/core/hash.d.ts.map +1 -0
  630. package/dist/core/hash.js +17 -0
  631. package/dist/core/hash.js.map +1 -0
  632. package/dist/core/json-schema.d.ts +2 -0
  633. package/dist/core/json-schema.d.ts.map +1 -1
  634. package/dist/core/json-schema.js +14 -13
  635. package/dist/core/json-schema.js.map +1 -1
  636. package/dist/core/labeled-tensor.d.ts.map +1 -1
  637. package/dist/core/labeled-tensor.js +0 -8
  638. package/dist/core/labeled-tensor.js.map +1 -1
  639. package/dist/core/mathts-read.d.ts +25 -0
  640. package/dist/core/mathts-read.d.ts.map +1 -0
  641. package/dist/core/mathts-read.js +51 -0
  642. package/dist/core/mathts-read.js.map +1 -0
  643. package/dist/core/tensor.d.ts.map +1 -1
  644. package/dist/core/tensor.js +24 -0
  645. package/dist/core/tensor.js.map +1 -1
  646. package/dist/core/types.d.ts +5 -5
  647. package/dist/diff/bridge-ast-gradient.d.ts +27 -23
  648. package/dist/diff/bridge-ast-gradient.d.ts.map +1 -1
  649. package/dist/diff/bridge-ast-gradient.js +75 -173
  650. package/dist/diff/bridge-ast-gradient.js.map +1 -1
  651. package/dist/diff/bridge-gradient.d.ts +19 -6
  652. package/dist/diff/bridge-gradient.d.ts.map +1 -1
  653. package/dist/diff/bridge-gradient.js +19 -11
  654. package/dist/diff/bridge-gradient.js.map +1 -1
  655. package/dist/diff/bridge-specs.d.ts.map +1 -1
  656. package/dist/diff/bridge-specs.js +3 -0
  657. package/dist/diff/bridge-specs.js.map +1 -1
  658. package/dist/dimensional/algebra.d.ts +18 -0
  659. package/dist/dimensional/algebra.d.ts.map +1 -1
  660. package/dist/dimensional/algebra.js +41 -1
  661. package/dist/dimensional/algebra.js.map +1 -1
  662. package/dist/dimensional/ast-builders.d.ts +7 -0
  663. package/dist/dimensional/ast-builders.d.ts.map +1 -1
  664. package/dist/dimensional/ast-builders.js +11 -0
  665. package/dist/dimensional/ast-builders.js.map +1 -1
  666. package/dist/dimensional/ast-leaves.d.ts +81 -0
  667. package/dist/dimensional/ast-leaves.d.ts.map +1 -0
  668. package/dist/dimensional/ast-leaves.js +146 -0
  669. package/dist/dimensional/ast-leaves.js.map +1 -0
  670. package/dist/dimensional/ast-types.d.ts +15 -0
  671. package/dist/dimensional/ast-types.d.ts.map +1 -1
  672. package/dist/dimensional/ast-types.js.map +1 -1
  673. package/dist/dimensional/buckingham.d.ts.map +1 -1
  674. package/dist/dimensional/buckingham.js +15 -27
  675. package/dist/dimensional/buckingham.js.map +1 -1
  676. package/dist/dimensional/constant-rows.js +9 -9
  677. package/dist/dimensional/constant-rows.js.map +1 -1
  678. package/dist/dimensional/curvature-composite.d.ts +1 -1
  679. package/dist/dimensional/curvature-composite.js.map +1 -1
  680. package/dist/dimensional/dimension-inference.d.ts.map +1 -1
  681. package/dist/dimensional/dimension-inference.js +1 -2
  682. package/dist/dimensional/dimension-inference.js.map +1 -1
  683. package/dist/dimensional/errors.d.ts +1 -1
  684. package/dist/dimensional/errors.d.ts.map +1 -1
  685. package/dist/dimensional/errors.js +1 -15
  686. package/dist/dimensional/errors.js.map +1 -1
  687. package/dist/dimensional/exact-scale.d.ts +24 -11
  688. package/dist/dimensional/exact-scale.d.ts.map +1 -1
  689. package/dist/dimensional/exact-scale.js +122 -130
  690. package/dist/dimensional/exact-scale.js.map +1 -1
  691. package/dist/dimensional/gauge-field.d.ts.map +1 -1
  692. package/dist/dimensional/gauge-field.js +2 -2
  693. package/dist/dimensional/gauge-field.js.map +1 -1
  694. package/dist/dimensional/hyphen-names.d.ts +12 -2
  695. package/dist/dimensional/hyphen-names.d.ts.map +1 -1
  696. package/dist/dimensional/hyphen-names.js +44 -19
  697. package/dist/dimensional/hyphen-names.js.map +1 -1
  698. package/dist/dimensional/mathts-unit-delegation.d.ts +29 -0
  699. package/dist/dimensional/mathts-unit-delegation.d.ts.map +1 -0
  700. package/dist/dimensional/mathts-unit-delegation.js +187 -0
  701. package/dist/dimensional/mathts-unit-delegation.js.map +1 -0
  702. package/dist/dimensional/mathts-unit-wrapper.d.ts +33 -0
  703. package/dist/dimensional/mathts-unit-wrapper.d.ts.map +1 -0
  704. package/dist/dimensional/mathts-unit-wrapper.js +190 -0
  705. package/dist/dimensional/mathts-unit-wrapper.js.map +1 -0
  706. package/dist/dimensional/metric.d.ts.map +1 -1
  707. package/dist/dimensional/metric.js +0 -1
  708. package/dist/dimensional/metric.js.map +1 -1
  709. package/dist/dimensional/scalar-lowering.d.ts +21 -0
  710. package/dist/dimensional/scalar-lowering.d.ts.map +1 -0
  711. package/dist/dimensional/scalar-lowering.js +45 -0
  712. package/dist/dimensional/scalar-lowering.js.map +1 -0
  713. package/dist/dimensional/symbolic-constants.d.ts +9 -0
  714. package/dist/dimensional/symbolic-constants.d.ts.map +1 -1
  715. package/dist/dimensional/symbolic-constants.js +13 -1
  716. package/dist/dimensional/symbolic-constants.js.map +1 -1
  717. package/dist/dimensional/types.d.ts +36 -0
  718. package/dist/dimensional/types.d.ts.map +1 -1
  719. package/dist/dimensional/types.js +45 -7
  720. package/dist/dimensional/types.js.map +1 -1
  721. package/dist/dimensional/unit-data.d.ts +5 -1
  722. package/dist/dimensional/unit-data.d.ts.map +1 -1
  723. package/dist/dimensional/unit-data.js +30 -6
  724. package/dist/dimensional/unit-data.js.map +1 -1
  725. package/dist/dimensional/units.d.ts +2 -0
  726. package/dist/dimensional/units.d.ts.map +1 -1
  727. package/dist/dimensional/units.js +59 -3
  728. package/dist/dimensional/units.js.map +1 -1
  729. package/dist/dimensional/validator.d.ts +2 -0
  730. package/dist/dimensional/validator.d.ts.map +1 -1
  731. package/dist/dimensional/validator.js.map +1 -1
  732. package/dist/index.d.ts +9 -3
  733. package/dist/index.d.ts.map +1 -1
  734. package/dist/index.js +10 -4
  735. package/dist/index.js.map +1 -1
  736. package/dist/numerical/christoffel-flat.d.ts.map +1 -1
  737. package/dist/numerical/christoffel-flat.js +3 -2
  738. package/dist/numerical/christoffel-flat.js.map +1 -1
  739. package/dist/numerical/connection-lowering-helpers.d.ts +3 -1
  740. package/dist/numerical/connection-lowering-helpers.d.ts.map +1 -1
  741. package/dist/numerical/connection-lowering-helpers.js +11 -15
  742. package/dist/numerical/connection-lowering-helpers.js.map +1 -1
  743. package/dist/numerical/covariant-eikonal.d.ts.map +1 -1
  744. package/dist/numerical/covariant-eikonal.js +34 -11
  745. package/dist/numerical/covariant-eikonal.js.map +1 -1
  746. package/dist/numerical/curvature-lowering-helpers.js +3 -2
  747. package/dist/numerical/curvature-lowering-helpers.js.map +1 -1
  748. package/dist/numerical/errors.d.ts.map +1 -1
  749. package/dist/numerical/errors.js +0 -3
  750. package/dist/numerical/errors.js.map +1 -1
  751. package/dist/numerical/finite-difference.d.ts +22 -0
  752. package/dist/numerical/finite-difference.d.ts.map +1 -0
  753. package/dist/numerical/finite-difference.js +27 -0
  754. package/dist/numerical/finite-difference.js.map +1 -0
  755. package/dist/numerical/geodesic-integrator.d.ts.map +1 -1
  756. package/dist/numerical/geodesic-integrator.js +22 -14
  757. package/dist/numerical/geodesic-integrator.js.map +1 -1
  758. package/dist/numerical/geometrized.d.ts.map +1 -1
  759. package/dist/numerical/geometrized.js +0 -1
  760. package/dist/numerical/geometrized.js.map +1 -1
  761. package/dist/numerical/mathts-engine.d.ts.map +1 -1
  762. package/dist/numerical/mathts-engine.js +10 -24
  763. package/dist/numerical/mathts-engine.js.map +1 -1
  764. package/dist/numerical/metric-inverse.d.ts.map +1 -1
  765. package/dist/numerical/metric-inverse.js +83 -46
  766. package/dist/numerical/metric-inverse.js.map +1 -1
  767. package/dist/numerical/null-ray-integrator.d.ts +2 -1
  768. package/dist/numerical/null-ray-integrator.d.ts.map +1 -1
  769. package/dist/numerical/null-ray-integrator.js +12 -12
  770. package/dist/numerical/null-ray-integrator.js.map +1 -1
  771. package/dist/numerical/painleve-gullstrand-metric.js +2 -2
  772. package/dist/numerical/painleve-gullstrand-metric.js.map +1 -1
  773. package/dist/numerical/pderiv.d.ts.map +1 -1
  774. package/dist/numerical/pderiv.js +2 -6
  775. package/dist/numerical/pderiv.js.map +1 -1
  776. package/dist/numerical/perihelion-finder.d.ts +0 -36
  777. package/dist/numerical/perihelion-finder.d.ts.map +1 -1
  778. package/dist/numerical/perihelion-finder.js +41 -87
  779. package/dist/numerical/perihelion-finder.js.map +1 -1
  780. package/dist/numerical/quadrature.d.ts.map +1 -1
  781. package/dist/numerical/quadrature.js +11 -13
  782. package/dist/numerical/quadrature.js.map +1 -1
  783. package/dist/numerical/rk4-trajectory.d.ts +10 -0
  784. package/dist/numerical/rk4-trajectory.d.ts.map +1 -0
  785. package/dist/numerical/rk4-trajectory.js +37 -0
  786. package/dist/numerical/rk4-trajectory.js.map +1 -0
  787. package/dist/numerical/schwarzschild.d.ts +14 -0
  788. package/dist/numerical/schwarzschild.d.ts.map +1 -0
  789. package/dist/numerical/schwarzschild.js +17 -0
  790. package/dist/numerical/schwarzschild.js.map +1 -0
  791. package/dist/numerical/spacetime-metrics.d.ts +12 -0
  792. package/dist/numerical/spacetime-metrics.d.ts.map +1 -1
  793. package/dist/numerical/spacetime-metrics.js +72 -56
  794. package/dist/numerical/spacetime-metrics.js.map +1 -1
  795. package/dist/numerical/statistics.d.ts +24 -0
  796. package/dist/numerical/statistics.d.ts.map +1 -0
  797. package/dist/numerical/statistics.js +52 -0
  798. package/dist/numerical/statistics.js.map +1 -0
  799. package/dist/numerical/strides.d.ts +3 -2
  800. package/dist/numerical/strides.d.ts.map +1 -1
  801. package/dist/numerical/strides.js +3 -10
  802. package/dist/numerical/strides.js.map +1 -1
  803. package/dist/numerical/tensor-engine.d.ts +21 -0
  804. package/dist/numerical/tensor-engine.d.ts.map +1 -1
  805. package/dist/numerical/tensor-engine.js +12 -0
  806. package/dist/numerical/tensor-engine.js.map +1 -1
  807. package/dist/relations/regime.d.ts +10 -0
  808. package/dist/relations/regime.d.ts.map +1 -1
  809. package/dist/relations/regime.js +18 -1
  810. package/dist/relations/regime.js.map +1 -1
  811. package/package.json +9 -12
  812. package/dist/cases/brownian-sphere.d.ts +0 -68
  813. package/dist/cases/brownian-sphere.d.ts.map +0 -1
  814. package/dist/cases/brownian-sphere.js +0 -354
  815. package/dist/cases/brownian-sphere.js.map +0 -1
  816. package/dist/cases/damped-resonator.d.ts +0 -23
  817. package/dist/cases/damped-resonator.d.ts.map +0 -1
  818. package/dist/cases/damped-resonator.js +0 -224
  819. package/dist/cases/damped-resonator.js.map +0 -1
  820. package/dist/cases/kepler-rv.d.ts +0 -13
  821. package/dist/cases/kepler-rv.d.ts.map +0 -1
  822. package/dist/cases/kepler-rv.js +0 -172
  823. package/dist/cases/kepler-rv.js.map +0 -1
  824. package/dist/cases/lumped-cooling.d.ts +0 -46
  825. package/dist/cases/lumped-cooling.d.ts.map +0 -1
  826. package/dist/cases/lumped-cooling.js +0 -261
  827. package/dist/cases/lumped-cooling.js.map +0 -1
  828. package/dist/cases/resistor-noise.d.ts +0 -14
  829. package/dist/cases/resistor-noise.d.ts.map +0 -1
  830. package/dist/cases/resistor-noise.js +0 -215
  831. package/dist/cases/resistor-noise.js.map +0 -1
  832. package/dist/cases/skin-depth.d.ts +0 -21
  833. package/dist/cases/skin-depth.d.ts.map +0 -1
  834. package/dist/cases/skin-depth.js +0 -174
  835. package/dist/cases/skin-depth.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ast-types.js","sourceRoot":"","sources":["../../src/dimensional/ast-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG","sourcesContent":["/**\n * The dimensional AST type system — `ExprNode` and every node/index interface\n * it unions, in ONE leaf module.\n *\n * Previously `ExprNode` lived in `validator.ts` and pulled its member node types\n * from ~9 sibling modules (`tensor`, `metric-validators`, `connection-\n * validators`, `curvature`, …). Two of those (`tensor`, `curvature`) imported\n * `ExprNode` back, forming type-only cycles, and several node interfaces used\n * `of: unknown` casts to dodge importing `ExprNode`. Consolidating the *types*\n * here (this module imports only `types.ts` + the leaf `curvature-composite.ts`,\n * so it has no back-edges) breaks both cycles and lets the derivative nodes type\n * `of`/`wrt` as real `ExprNode`.\n *\n * Each origin module now re-exports its types from here (so existing importers\n * are unchanged) and keeps only its validation FUNCTIONS.\n *\n * @module dimensional/ast-types\n */\n\nimport type { Dimension } from './types.js';\nimport type { CurvatureCompositeNode } from './curvature-composite.js';\n\n// ── index types ─────────────────────────────────────────────────────────────\n\nexport type Variance = 'upper' | 'lower';\nexport type Role = 'coordinate' | 'field' | 'constant';\n\nexport interface TensorIndex {\n readonly label: string;\n readonly variance: Variance;\n}\n\n/** A strictly-lower tensor index. */\nexport interface CovariantIndex {\n readonly label: string;\n readonly variance: 'lower';\n}\n\n/** A strictly-upper tensor index. */\nexport interface UpperIndex {\n readonly label: string;\n readonly variance: 'upper';\n}\n\n// ── transcendental functions ────────────────────────────────────────────────\n\n/**\n * Elementwise transcendental functions usable in a `transcendental` node. All\n * take a DIMENSIONLESS argument and return a DIMENSIONLESS result. (`sqrt`/`cbrt`\n * are excluded — they produce fractional dimensions.)\n */\nexport type TranscendentalFn =\n | 'exp'\n | 'ln'\n | 'log2'\n | 'log10'\n | 'sin'\n | 'cos'\n | 'tan'\n | 'sinh'\n | 'cosh'\n | 'tanh';\n\n// ── tensor nodes ────────────────────────────────────────────────────────────\n\nexport interface TensorSymbolNode {\n readonly kind: 'tensor-symbol';\n readonly name: string;\n readonly indices: ReadonlyArray<TensorIndex>;\n readonly dim: Dimension;\n /** Semantic classification (default 'field'). Structural metadata only. */\n readonly role?: Role;\n /** v0.3.5 numerical pderiv strategy when this is a partial-derivative `of`\n * operand (default 'symbolic'). */\n readonly numericalForm?: 'symbolic' | 'numerical-fn' | 'grid';\n}\n\nexport interface TensorProductNode {\n readonly kind: 'tensor-product';\n readonly args: ReadonlyArray<ExprNode>;\n}\n\n// ── metric nodes ────────────────────────────────────────────────────────────\n\nexport interface MetricTensorNode {\n readonly kind: 'metric-tensor';\n readonly name: string;\n readonly indices: ReadonlyArray<TensorIndex>;\n readonly signature: string;\n readonly dim: Dimension;\n /** v0.4.0 numerical-lowering hint for ∂g (default 'computed'). */\n readonly derivativeStrategy?: 'computed' | 'zero' | 'supplied';\n}\n\nexport interface KroneckerDeltaNode {\n readonly kind: 'kronecker-delta';\n readonly indices: ReadonlyArray<TensorIndex>;\n readonly dim: Dimension;\n}\n\nexport interface TensorPartialDerivativeNode {\n readonly kind: 'tensor-partial-derivative';\n readonly of: ExprNode;\n readonly wrt: ExprNode;\n readonly wrtIndex: CovariantIndex;\n}\n\n// ── connection / curvature nodes ────────────────────────────────────────────\n\n/**\n * AST node for the covariant derivative ∇_μ of a tensor expression.\n *\n * @public\n */\nexport interface CovariantDerivativeNode {\n readonly kind: 'covariant-derivative';\n readonly of: ExprNode;\n readonly wrt: ExprNode;\n readonly wrtIndex: CovariantIndex;\n readonly gLower: MetricTensorNode;\n readonly gInverse: MetricTensorNode;\n}\n\nexport type RiemannTensorNode = CurvatureCompositeNode<'riemann-tensor', {\n readonly upperIndex: UpperIndex;\n readonly lowerIndices: readonly [CovariantIndex, CovariantIndex, CovariantIndex];\n readonly gLower: MetricTensorNode;\n readonly gInverse: MetricTensorNode;\n readonly xCoord: TensorSymbolNode;\n}>;\n\n/**\n * AST node for the Ricci tensor R_μν, built by `ricci`.\n *\n * @public\n */\nexport type RicciTensorNode = CurvatureCompositeNode<'ricci-tensor', {\n /** The Riemann tensor, contracted on its upper index and its second lower index: R_μν = R^λ_{μλν}. */\n readonly riemann: RiemannTensorNode;\n}>;\n\n/**\n * AST node for the Einstein tensor G_μν, built by `einstein`.\n *\n * @public\n */\nexport type EinsteinTensorNode = CurvatureCompositeNode<'einstein-tensor', {\n /** The Riemann tensor whose contraction yields the inner Ricci R_μν. */\n readonly riemann: RiemannTensorNode;\n /** Lower metric g_μν — supplies the `½ R g_μν` subtraction tensor. */\n readonly gLower: MetricTensorNode;\n /** Upper metric g^μν — supplies the scalar trace `R = g^μν R_μν`. */\n readonly gInverse: MetricTensorNode;\n}>;\n\n/**\n * AST node for the cyclic second-Bianchi-identity residual, built by `bianchiResidual`.\n *\n * @public\n */\nexport type BianchiResidualNode = CurvatureCompositeNode<'bianchi-residual', {\n /** The Riemann tensor whose cyclic-derivative identity is checked. */\n readonly riemann: RiemannTensorNode;\n}>;\n\nexport type WeylTensorNode = CurvatureCompositeNode<'weyl-tensor', {\n /** Metric g_{μν} (both-lower). Present for numerical lowering consumers. */\n readonly metric: MetricTensorNode;\n /** Contravariant (upper) index ρ. */\n readonly upperIndex: UpperIndex;\n /** Three covariant (lower) indices [σ, μ, ν]. */\n readonly lowerIndices: readonly [CovariantIndex, CovariantIndex, CovariantIndex];\n /** Dimensional signature of each component: [L⁻²], same as Riemann. */\n readonly componentDim: Dimension;\n}>;\n\n/**\n * AST node for the Kretschmann scalar K = R_{ρσμν} R^{ρσμν}.\n *\n * @public\n */\nexport type KretschmannScalarNode = CurvatureCompositeNode<'kretschmann-scalar', {\n /** Riemann tensor R^ρ_{σμν}. */\n readonly riemann: RiemannTensorNode;\n /** Metric (both-lower preferred). */\n readonly metric: MetricTensorNode;\n}>;\n\n// ── Killing / stress-energy / field-equation nodes ──────────────────────────\n\nexport interface KillingVectorNode {\n readonly kind: 'killing-vector';\n readonly vector: TensorSymbolNode;\n readonly metric: MetricTensorNode;\n}\n\nexport interface ConservedChargeNode {\n readonly kind: 'conserved-charge';\n /** The Killing vector ξ^μ (rank-1, upper variance). */\n readonly killing: KillingVectorNode;\n /** The covariant momentum p_μ (rank-1, lower variance), sharing the Killing\n * vector's index label so ξ^μ p_μ is well-formed. */\n readonly momentum: TensorSymbolNode;\n}\n\nexport interface StressEnergyTensorNode {\n readonly kind: 'stress-energy';\n readonly symbol: 'T';\n readonly indices: readonly [CovariantIndex, CovariantIndex];\n readonly symmetry: 'symmetric';\n readonly componentDim: Dimension;\n}\n\nexport interface CosmologicalConstantNode {\n readonly kind: 'cosmological-constant';\n readonly symbol: 'Λ';\n readonly dim: Dimension; // [L⁻²]\n readonly value?: number; // optional numeric value (e.g., 1.1056e-52 m⁻²)\n}\n\n/**\n * AST node for the Einstein field equation G_μν + Λ g_μν = (8πG/c⁴) T_μν.\n *\n * @public\n */\nexport interface EinsteinFieldEquationNode {\n readonly kind: 'einstein-equation';\n readonly lhs: EinsteinTensorNode;\n readonly cosmological: CosmologicalConstantNode | null;\n readonly metric: MetricTensorNode;\n readonly rhs: StressEnergyTensorNode;\n readonly coupling: 'einstein';\n}\n\n// ── the ExprNode union ──────────────────────────────────────────────────────\n\nexport type ExprNode =\n | { kind: 'symbol'; name: string; dim: Dimension }\n | { kind: 'op'; op: '+' | '-' | '*' | '/' | '^'; args: ExprNode[] }\n // ∫ integrand d(over); optional lower/upper bounds make it a DEFINITE integral.\n | { kind: 'integral'; over: ExprNode; integrand: ExprNode; lower?: ExprNode; upper?: ExprNode }\n | { kind: 'derivative'; of: ExprNode; wrt: ExprNode }\n // Dirac-δ correlator: ∫δ(x)dx=1 ⟹ [δ(x)]=[x]⁻¹.\n | { kind: 'dirac-delta'; arg: ExprNode }\n // Functional derivative δF/δφ \"over\" the measure dμ: [δF/δφ]=[F]/([φ]·[μ]).\n | { kind: 'variational-derivative'; functional: ExprNode; field: ExprNode; over: ExprNode }\n // Elementwise transcendental of a DIMENSIONLESS arg → DIMENSIONLESS result.\n | { kind: 'transcendental'; fn: TranscendentalFn; arg: ExprNode }\n // Absolute value |x| — dimension-PRESERVING (unlike the transcendentals).\n | { kind: 'abs'; arg: ExprNode }\n | TensorSymbolNode\n | TensorProductNode\n | MetricTensorNode\n | KroneckerDeltaNode\n | TensorPartialDerivativeNode\n | CovariantDerivativeNode\n | RiemannTensorNode\n | RicciTensorNode\n | EinsteinTensorNode\n | BianchiResidualNode\n | KillingVectorNode\n | ConservedChargeNode\n | StressEnergyTensorNode\n | CosmologicalConstantNode\n | EinsteinFieldEquationNode\n | WeylTensorNode\n | KretschmannScalarNode;\n"]}
1
+ {"version":3,"file":"ast-types.js","sourceRoot":"","sources":["../../src/dimensional/ast-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG","sourcesContent":["/**\n * The dimensional AST type system — `ExprNode` and every node/index interface\n * it unions, in ONE leaf module.\n *\n * Previously `ExprNode` lived in `validator.ts` and pulled its member node types\n * from ~9 sibling modules (`tensor`, `metric-validators`, `connection-\n * validators`, `curvature`, …). Two of those (`tensor`, `curvature`) imported\n * `ExprNode` back, forming type-only cycles, and several node interfaces used\n * `of: unknown` casts to dodge importing `ExprNode`. Consolidating the *types*\n * here (this module imports only `types.ts` + the leaf `curvature-composite.ts`,\n * so it has no back-edges) breaks both cycles and lets the derivative nodes type\n * `of`/`wrt` as real `ExprNode`.\n *\n * Each origin module now re-exports its types from here (so existing importers\n * are unchanged) and keeps only its validation FUNCTIONS.\n *\n * @module dimensional/ast-types\n */\n\nimport type { Dimension } from './types.js';\nimport type { CurvatureCompositeNode } from './curvature-composite.js';\n\n// ── index types ─────────────────────────────────────────────────────────────\n\n/** The position of a tensor index: upper (contravariant) or lower (covariant). */\nexport type Variance = 'upper' | 'lower';\n/** The semantic class of a tensor symbol: coordinate, field or constant. */\nexport type Role = 'coordinate' | 'field' | 'constant';\n\n/** One index of a tensor: its label and whether it is upper or lower. */\nexport interface TensorIndex {\n readonly label: string;\n readonly variance: Variance;\n}\n\n/** A strictly-lower tensor index. */\nexport interface CovariantIndex {\n readonly label: string;\n readonly variance: 'lower';\n}\n\n/** A strictly-upper tensor index. */\nexport interface UpperIndex {\n readonly label: string;\n readonly variance: 'upper';\n}\n\n// ── transcendental functions ────────────────────────────────────────────────\n\n/**\n * Elementwise transcendental functions usable in a `transcendental` node. All\n * take a DIMENSIONLESS argument and return a DIMENSIONLESS result. (`sqrt`/`cbrt`\n * are excluded — they produce fractional dimensions.)\n */\nexport type TranscendentalFn =\n | 'exp'\n | 'ln'\n | 'log2'\n | 'log10'\n | 'sin'\n | 'cos'\n | 'tan'\n | 'sinh'\n | 'cosh'\n | 'tanh';\n\n// ── tensor nodes ────────────────────────────────────────────────────────────\n\n/** A named tensor, with its indices, dimension and optional role. */\nexport interface TensorSymbolNode {\n readonly kind: 'tensor-symbol';\n readonly name: string;\n readonly indices: ReadonlyArray<TensorIndex>;\n readonly dim: Dimension;\n /** Semantic classification (default 'field'). Structural metadata only. */\n readonly role?: Role;\n /** v0.3.5 numerical pderiv strategy when this is a partial-derivative `of`\n * operand (default 'symbolic'). */\n readonly numericalForm?: 'symbolic' | 'numerical-fn' | 'grid';\n}\n\n/** An Einstein-summation product of tensor and scalar operands. */\nexport interface TensorProductNode {\n readonly kind: 'tensor-product';\n readonly args: ReadonlyArray<ExprNode>;\n}\n\n// ── metric nodes ────────────────────────────────────────────────────────────\n\n/** A metric tensor, with its name, indices, signature and dimension. */\nexport interface MetricTensorNode {\n readonly kind: 'metric-tensor';\n readonly name: string;\n readonly indices: ReadonlyArray<TensorIndex>;\n readonly signature: string;\n readonly dim: Dimension;\n /** v0.4.0 numerical-lowering hint for ∂g (default 'computed'). */\n readonly derivativeStrategy?: 'computed' | 'zero' | 'supplied';\n}\n\n/** The Kronecker delta, with its tensor indices and dimension. */\nexport interface KroneckerDeltaNode {\n readonly kind: 'kronecker-delta';\n readonly indices: ReadonlyArray<TensorIndex>;\n readonly dim: Dimension;\n}\n\n/** The partial derivative of an expression, taken on a covariant index. */\nexport interface TensorPartialDerivativeNode {\n readonly kind: 'tensor-partial-derivative';\n readonly of: ExprNode;\n readonly wrt: ExprNode;\n readonly wrtIndex: CovariantIndex;\n}\n\n// ── connection / curvature nodes ────────────────────────────────────────────\n\n/**\n * AST node for the covariant derivative ∇_μ of a tensor expression.\n *\n * @public\n */\nexport interface CovariantDerivativeNode {\n readonly kind: 'covariant-derivative';\n readonly of: ExprNode;\n readonly wrt: ExprNode;\n readonly wrtIndex: CovariantIndex;\n readonly gLower: MetricTensorNode;\n readonly gInverse: MetricTensorNode;\n}\n\n/** The Riemann curvature tensor, with one upper and three lower indices. */\nexport type RiemannTensorNode = CurvatureCompositeNode<'riemann-tensor', {\n readonly upperIndex: UpperIndex;\n readonly lowerIndices: readonly [CovariantIndex, CovariantIndex, CovariantIndex];\n readonly gLower: MetricTensorNode;\n readonly gInverse: MetricTensorNode;\n readonly xCoord: TensorSymbolNode;\n}>;\n\n/**\n * AST node for the Ricci tensor R_μν, built by `ricci`.\n *\n * @public\n */\nexport type RicciTensorNode = CurvatureCompositeNode<'ricci-tensor', {\n /** The Riemann tensor, contracted on its upper index and its second lower index: R_μν = R^λ_{μλν}. */\n readonly riemann: RiemannTensorNode;\n}>;\n\n/**\n * AST node for the Einstein tensor G_μν, built by `einstein`.\n *\n * @public\n */\nexport type EinsteinTensorNode = CurvatureCompositeNode<'einstein-tensor', {\n /** The Riemann tensor whose contraction yields the inner Ricci R_μν. */\n readonly riemann: RiemannTensorNode;\n /** Lower metric g_μν — supplies the `½ R g_μν` subtraction tensor. */\n readonly gLower: MetricTensorNode;\n /** Upper metric g^μν — supplies the scalar trace `R = g^μν R_μν`. */\n readonly gInverse: MetricTensorNode;\n}>;\n\n/**\n * AST node for the cyclic second-Bianchi-identity residual, built by `bianchiResidual`.\n *\n * @public\n */\nexport type BianchiResidualNode = CurvatureCompositeNode<'bianchi-residual', {\n /** The Riemann tensor whose cyclic-derivative identity is checked. */\n readonly riemann: RiemannTensorNode;\n}>;\n\n/** The Weyl curvature tensor, the trace-free part of the Riemann tensor. */\nexport type WeylTensorNode = CurvatureCompositeNode<'weyl-tensor', {\n /** Metric g_{μν} (both-lower). Present for numerical lowering consumers. */\n readonly metric: MetricTensorNode;\n /** Contravariant (upper) index ρ. */\n readonly upperIndex: UpperIndex;\n /** Three covariant (lower) indices [σ, μ, ν]. */\n readonly lowerIndices: readonly [CovariantIndex, CovariantIndex, CovariantIndex];\n /** Dimensional signature of each component: [L⁻²], same as Riemann. */\n readonly componentDim: Dimension;\n}>;\n\n/**\n * AST node for the Kretschmann scalar K = R_{ρσμν} R^{ρσμν}.\n *\n * @public\n */\nexport type KretschmannScalarNode = CurvatureCompositeNode<'kretschmann-scalar', {\n /** Riemann tensor R^ρ_{σμν}. */\n readonly riemann: RiemannTensorNode;\n /** Metric (both-lower preferred). */\n readonly metric: MetricTensorNode;\n}>;\n\n// ── Killing / stress-energy / field-equation nodes ──────────────────────────\n\n/** A Killing vector field, with its vector and the metric it preserves. */\nexport interface KillingVectorNode {\n readonly kind: 'killing-vector';\n readonly vector: TensorSymbolNode;\n readonly metric: MetricTensorNode;\n}\n\n/** A conserved charge: a Killing vector contracted with a momentum. */\nexport interface ConservedChargeNode {\n readonly kind: 'conserved-charge';\n /** The Killing vector ξ^μ (rank-1, upper variance). */\n readonly killing: KillingVectorNode;\n /** The covariant momentum p_μ (rank-1, lower variance), sharing the Killing\n * vector's index label so ξ^μ p_μ is well-formed. */\n readonly momentum: TensorSymbolNode;\n}\n\n/** The symmetric stress-energy tensor T, with its indices and component dimension. */\nexport interface StressEnergyTensorNode {\n readonly kind: 'stress-energy';\n readonly symbol: 'T';\n readonly indices: readonly [CovariantIndex, CovariantIndex];\n readonly symmetry: 'symmetric';\n readonly componentDim: Dimension;\n}\n\n/** The cosmological constant Λ, with its dimension and optional numeric value. */\nexport interface CosmologicalConstantNode {\n readonly kind: 'cosmological-constant';\n readonly symbol: 'Λ';\n readonly dim: Dimension; // [L⁻²]\n readonly value?: number; // optional numeric value (e.g., 1.1056e-52 m⁻²)\n}\n\n/**\n * AST node for the Einstein field equation G_μν + Λ g_μν = (8πG/c⁴) T_μν.\n *\n * @public\n */\nexport interface EinsteinFieldEquationNode {\n readonly kind: 'einstein-equation';\n readonly lhs: EinsteinTensorNode;\n readonly cosmological: CosmologicalConstantNode | null;\n readonly metric: MetricTensorNode;\n readonly rhs: StressEnergyTensorNode;\n readonly coupling: 'einstein';\n}\n\n// ── the ExprNode union ──────────────────────────────────────────────────────\n\n/** Any node of a dimensional expression: scalar, calculus, tensor, curvature or field-equation. */\nexport type ExprNode =\n | { kind: 'symbol'; name: string; dim: Dimension }\n | { kind: 'op'; op: '+' | '-' | '*' | '/' | '^'; args: ExprNode[] }\n // ∫ integrand d(over); optional lower/upper bounds make it a DEFINITE integral.\n | { kind: 'integral'; over: ExprNode; integrand: ExprNode; lower?: ExprNode; upper?: ExprNode }\n | { kind: 'derivative'; of: ExprNode; wrt: ExprNode }\n // Dirac-δ correlator: ∫δ(x)dx=1 ⟹ [δ(x)]=[x]⁻¹.\n | { kind: 'dirac-delta'; arg: ExprNode }\n // Functional derivative δF/δφ \"over\" the measure dμ: [δF/δφ]=[F]/([φ]·[μ]).\n | { kind: 'variational-derivative'; functional: ExprNode; field: ExprNode; over: ExprNode }\n // Elementwise transcendental of a DIMENSIONLESS arg → DIMENSIONLESS result.\n | { kind: 'transcendental'; fn: TranscendentalFn; arg: ExprNode }\n // Absolute value |x| — dimension-PRESERVING (unlike the transcendentals).\n | { kind: 'abs'; arg: ExprNode }\n | TensorSymbolNode\n | TensorProductNode\n | MetricTensorNode\n | KroneckerDeltaNode\n | TensorPartialDerivativeNode\n | CovariantDerivativeNode\n | RiemannTensorNode\n | RicciTensorNode\n | EinsteinTensorNode\n | BianchiResidualNode\n | KillingVectorNode\n | ConservedChargeNode\n | StressEnergyTensorNode\n | CosmologicalConstantNode\n | EinsteinFieldEquationNode\n | WeylTensorNode\n | KretschmannScalarNode;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"buckingham.d.ts","sourceRoot":"","sources":["../../src/dimensional/buckingham.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAI5C;kEACkE;AAClE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;CACzB;AAED;;6BAE6B;AAC7B,MAAM,WAAW,OAAO;IACtB,uEAAuE;IACvE,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,2DAA2D;IAC3D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,yDAAyD;AACzD,MAAM,MAAM,iBAAiB,GACzB,2BAA2B,GAC3B,kBAAkB,GAClB,qBAAqB,CAAC;AAE1B,8CAA8C;AAC9C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,yDAAyD;IACzD,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,mCAAmC;IACn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,CAAC,CAAC;IACrD,oEAAoE;IACpE,QAAQ,CAAC,yBAAyB,CAAC,EAAE,IAAI,CAAC;IAC1C;;;;;OAKG;IACH,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;IACvC,6CAA6C;IAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;cACc;AACd,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AA+ED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,SAAS,mBAAmB,EAAE,GACxC,gBAAgB,CAsClB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,mBAAmB,EAC3B,SAAS,EAAE,SAAS,mBAAmB,EAAE,GACxC,8BAA8B,CAmEhC"}
@@ -26,7 +26,7 @@
26
26
  */
27
27
  import { Fraction } from '@danielsimonjr/mathts-core';
28
28
  import { rationalNullspace } from '@danielsimonjr/mathts-functions';
29
- const BASES = ['L', 'M', 'T', 'I', 'Theta', 'N', 'J'];
29
+ import { BASES } from './algebra.js';
30
30
  /** Rationalization failed: a dimension exponent is not a small rational.
31
31
  * @public */
32
32
  export class RationalizationError extends Error {
@@ -35,39 +35,28 @@ export class RationalizationError extends Error {
35
35
  this.name = 'RationalizationError';
36
36
  }
37
37
  }
38
- function gcd(a, b) {
39
- a = Math.abs(a);
40
- b = Math.abs(b);
41
- while (b) {
42
- [a, b] = [b, a % b];
43
- }
44
- return a || 1;
45
- }
46
- function frac(n, d) {
47
- if (d === 0)
48
- throw new RationalizationError('zero denominator');
49
- if (d < 0) {
50
- n = -n;
51
- d = -d;
52
- }
53
- const g = gcd(n, d);
54
- return { n: n / g, d: d / g };
55
- }
38
+ // ---------------------------------------------------------------------------
39
+ // Exact rational arithmetic: MathTS core `Fraction` (bigint-backed, reduced by
40
+ // its constructor). Dimension exponents are small rationals.
41
+ // ---------------------------------------------------------------------------
56
42
  const MAX_DEN = 720;
57
- /** Convert a (possibly rational) exponent to an exact fraction by scanning
58
- * small denominators; throws if none matches within tolerance. */
43
+ /**
44
+ * Convert a (possibly rational) exponent to an exact {@link Fraction} by
45
+ * scanning small denominators; throws if none matches within tolerance. The
46
+ * scan, not `Fraction.fromNumber`'s continued fraction, is what refuses an
47
+ * irrational exponent instead of approximating it.
48
+ */
59
49
  function toFrac(x) {
60
50
  if (Number.isInteger(x))
61
- return { n: x, d: 1 };
51
+ return new Fraction(x, 1);
62
52
  for (let d = 2; d <= MAX_DEN; d++) {
63
53
  const n = x * d;
64
54
  if (Math.abs(n - Math.round(n)) < 1e-9 * Math.max(1, Math.abs(n))) {
65
- return frac(Math.round(n), d);
55
+ return new Fraction(Math.round(n), d);
66
56
  }
67
57
  }
68
58
  throw new RationalizationError(`dimension exponent ${x} is not a rational with denominator ≤ ${MAX_DEN}`);
69
59
  }
70
- const fZero = (a) => a.n === 0;
71
60
  /**
72
61
  * Exact null space of the dimension matrix. Exponents pass through as
73
62
  * {@link Fraction} values after {@link toFrac}, so an irrational is still
@@ -76,8 +65,7 @@ const fZero = (a) => a.n === 0;
76
65
  * MathTS integerizes each vector (content 1, first nonzero entry positive).
77
66
  */
78
67
  function nullSpace(matrix, cols) {
79
- const entries = matrix.map((row) => row.map((f) => new Fraction(f.n, f.d)));
80
- const solved = rationalNullspace(entries, { columns: cols });
68
+ const solved = rationalNullspace(matrix, { columns: cols });
81
69
  const basis = solved.basis.map((vec) => vec.map((entry) => {
82
70
  if (entry.denominator !== 1n) {
83
71
  throw new RationalizationError(`null-space entry ${entry.toString()} is not an integer`);
@@ -91,7 +79,7 @@ function buildMatrix(variables) {
91
79
  const matrix = [];
92
80
  for (const base of BASES) {
93
81
  const row = variables.map((v) => toFrac(v.dim[base]));
94
- if (row.some((f) => !fZero(f))) {
82
+ if (row.some((f) => !f.isZero())) {
95
83
  spannedBases.push(base);
96
84
  matrix.push(row);
97
85
  }
@@ -1 +1 @@
1
- {"version":3,"file":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["/**\n * Buckingham-π enumerator (build target 1 of\n * docs/planning/Bridge-Inference-Epistemics-Note.md — the principled\n * primitive for the classifier's EXACTLY-DETERMINED case).\n *\n * Given a set of dimensional variables presumed to obey one\n * dimensionally-homogeneous relation, the Buckingham-π theorem says that\n * relation re-expresses as F(π₁,…,π_{n−r}) = 0, where each πᵢ is a\n * dimensionless power-product of the variables and there are exactly\n * n − r of them (n = variables, r = rank of the dimension matrix). The\n * π-groups are a basis of the NULL SPACE of the dimension matrix.\n *\n * THE HONEST BOUNDARY (enforced by the result types — there is no value\n * or constant field anywhere): this returns the FORM only. It yields the\n * π-groups and, for a target, the monomial that determines it UP TO A\n * DIMENSIONLESS CONSTANT (the 2π, the ½, α). It does NOT and cannot\n * supply that constant, nor the function F. That boundary is exactly what\n * separates dimensional analysis from numerology — see the epistemics\n * note.\n *\n * Computation is EXACT (rational arithmetic), not floating Gaussian\n * elimination: physics dimension exponents are small rationals, and the\n * null-space basis must be exact to be trustworthy.\n *\n * @module dimensional/buckingham\n */\n\nimport { Fraction } from '@danielsimonjr/mathts-core';\nimport { rationalNullspace } from '@danielsimonjr/mathts-functions';\nimport type { Dimension } from './types.js';\n\nconst BASES = ['L', 'M', 'T', 'I', 'Theta', 'N', 'J'] as const;\n\n/** A named physical quantity with a dimension — the enumerator's input.\n * Structurally satisfied by a composition `Quantity`. @public */\nexport interface DimensionalVariable {\n readonly name: string;\n readonly dim: Dimension;\n}\n\n/** A dimensionless power-product of the input variables (integer\n * exponents; the conventional form). No value — π-groups carry FORM,\n * not magnitude. @public */\nexport interface PiGroup {\n /** Integer exponent of each variable in this dimensionless product. */\n readonly exponents: Readonly<Record<string, number>>;\n /** Display form, e.g. `period^2 · gravity · length^-1`. */\n readonly formula: string;\n}\n\n/** The dimensional closure of a variable set. @public */\nexport type BuckinghamVerdict =\n | 'dimensionally-independent' // 0 π-groups: no dimensionless product exists\n | 'single-invariant' // 1 π-group: one dimensionless invariant\n | 'multiple-invariants'; // ≥2 π-groups: a family F(π₁,…)\n\n/** Result of {@link buckinghamPi}. @public */\nexport interface BuckinghamResult {\n readonly variables: readonly string[];\n /** Base SI dimensions actually spanned by the inputs. */\n readonly baseDimensions: readonly string[];\n /** n — the number of variables. */\n readonly variableCount: number;\n /** r — the rank of the dimension matrix. */\n readonly rank: number;\n /** n − r — the number of independent dimensionless groups. */\n readonly piGroupCount: number;\n readonly piGroups: readonly PiGroup[];\n readonly verdict: BuckinghamVerdict;\n}\n\n/** Result of {@link dimensionallyDetermines}. @public */\nexport interface DimensionalDeterminationResult {\n readonly target: string;\n readonly governing: readonly string[];\n /** True iff the target is fixed by the governing variables UP TO A\n * DIMENSIONLESS CONSTANT (unique monomial). */\n readonly determined: boolean;\n /**\n * When determined: target = const · Π(governingⱼ ^ monomial[j]). The\n * exponents may be rational (e.g. 0.5 for a √ law). Always read with\n * `upToDimensionlessConstant` — the leading constant is NOT supplied.\n */\n readonly monomial?: Readonly<Record<string, number>>;\n /** Always true when `monomial` is present — a standing reminder. */\n readonly upToDimensionlessConstant?: true;\n /**\n * True only when the target's dimension is not in the span of the governing\n * variables, so a monomial needs dimensionful constants the inputs do not\n * name. False when the governing variables are dimensionally dependent or\n * leave more than one π-group: that failure is not a missing constant.\n */\n readonly outsideGoverningSpan: boolean;\n /** Plain-language reason for the verdict. */\n readonly reason: string;\n}\n\n/** Rationalization failed: a dimension exponent is not a small rational.\n * @public */\nexport class RationalizationError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'RationalizationError';\n }\n}\n\n// ---------------------------------------------------------------------------\n// Exact rational arithmetic (number-backed; dimension exponents are small\n// rationals, so reduced fractions never overflow in practice).\n// ---------------------------------------------------------------------------\n\ninterface Frac {\n readonly n: number;\n readonly d: number;\n}\n\nfunction gcd(a: number, b: number): number {\n a = Math.abs(a);\n b = Math.abs(b);\n while (b) {\n [a, b] = [b, a % b];\n }\n return a || 1;\n}\n\nfunction frac(n: number, d: number): Frac {\n if (d === 0) throw new RationalizationError('zero denominator');\n if (d < 0) {\n n = -n;\n d = -d;\n }\n const g = gcd(n, d);\n return { n: n / g, d: d / g };\n}\n\nconst MAX_DEN = 720;\n\n/** Convert a (possibly rational) exponent to an exact fraction by scanning\n * small denominators; throws if none matches within tolerance. */\nfunction toFrac(x: number): Frac {\n if (Number.isInteger(x)) return { n: x, d: 1 };\n for (let d = 2; d <= MAX_DEN; d++) {\n const n = x * d;\n if (Math.abs(n - Math.round(n)) < 1e-9 * Math.max(1, Math.abs(n))) {\n return frac(Math.round(n), d);\n }\n }\n throw new RationalizationError(\n `dimension exponent ${x} is not a rational with denominator ≤ ${MAX_DEN}`,\n );\n}\n\nconst fZero = (a: Frac): boolean => a.n === 0;\n\n/**\n * Exact null space of the dimension matrix. Exponents pass through as\n * {@link Fraction} values after {@link toFrac}, so an irrational is still\n * {@link RationalizationError} and is not accepted by a continued fraction.\n * A matrix with no rows is `0×n`: `{ columns: n }` is the standard basis.\n * MathTS integerizes each vector (content 1, first nonzero entry positive).\n */\nfunction nullSpace(matrix: Frac[][], cols: number): { basis: number[][]; rank: number } {\n const entries = matrix.map((row) => row.map((f) => new Fraction(f.n, f.d)));\n const solved = rationalNullspace(entries, { columns: cols });\n const basis = solved.basis.map((vec) =>\n vec.map((entry) => {\n if (entry.denominator !== 1n) {\n throw new RationalizationError(\n `null-space entry ${entry.toString()} is not an integer`,\n );\n }\n return Number(entry.numerator);\n }),\n );\n return { basis, rank: solved.rank };\n}\n\nfunction buildMatrix(variables: readonly DimensionalVariable[]): {\n matrix: Frac[][];\n spannedBases: string[];\n} {\n const spannedBases: string[] = [];\n const matrix: Frac[][] = [];\n for (const base of BASES) {\n const row = variables.map((v) => toFrac(v.dim[base]));\n if (row.some((f) => !fZero(f))) {\n spannedBases.push(base);\n matrix.push(row);\n }\n }\n return { matrix, spannedBases };\n}\n\nfunction formatPiGroup(\n exponents: Record<string, number>,\n order: readonly string[],\n): string {\n const parts: string[] = [];\n for (const name of order) {\n const e = exponents[name];\n if (e === 0) continue;\n parts.push(e === 1 ? name : `${name}^${e}`);\n }\n return parts.join(' · ') || '1';\n}\n\n/**\n * Enumerate the Buckingham-π groups of a dimensional variable set. Returns\n * the rank, the count n − r, and a null-space basis of dimensionless\n * groups. FORM only — no constants (see module docs).\n *\n * @public\n */\nexport function buckinghamPi(\n variables: readonly DimensionalVariable[],\n): BuckinghamResult {\n if (variables.length === 0) {\n throw new RationalizationError('buckinghamPi requires at least one variable');\n }\n const names = variables.map((v) => v.name);\n if (new Set(names).size !== names.length) {\n throw new RationalizationError(\n `buckinghamPi requires unique variable names; got [${names.join(', ')}]`,\n );\n }\n\n const n = variables.length;\n const { matrix, spannedBases } = buildMatrix(variables);\n\n const { basis, rank } = nullSpace(matrix, n);\n const piGroups: PiGroup[] = basis.map((vec) => {\n const exponents: Record<string, number> = {};\n for (let j = 0; j < n; j++) exponents[names[j]] = vec[j];\n return { exponents, formula: formatPiGroup(exponents, names) };\n });\n\n const piGroupCount = n - rank;\n const verdict: BuckinghamVerdict =\n piGroupCount === 0\n ? 'dimensionally-independent'\n : piGroupCount === 1\n ? 'single-invariant'\n : 'multiple-invariants';\n\n return {\n variables: names,\n baseDimensions: spannedBases,\n variableCount: n,\n rank,\n piGroupCount,\n piGroups,\n verdict,\n };\n}\n\n/**\n * Does the governing set fix the target UP TO A DIMENSIONLESS CONSTANT?\n *\n * True iff the governing variables are dimensionally independent and the\n * target's dimension lies in their span — equivalently, the full set has\n * exactly one π-group and the governing set has none. When determined,\n * returns the (possibly rational) monomial exponents such that\n * target = const · Π(governingⱼ ^ monomial[j]). The constant is NOT\n * supplied — dimensional analysis cannot.\n *\n * @public\n */\nexport function dimensionallyDetermines(\n target: DimensionalVariable,\n governing: readonly DimensionalVariable[],\n): DimensionalDeterminationResult {\n const governingNames = governing.map((v) => v.name);\n\n const governingPi = buckinghamPi(\n governing.length > 0 ? governing : [target],\n );\n // A redundancy among the governing variables means the monomial is not\n // unique (any dimensionless governing combo can be folded into the\n // constant) → not determined.\n if (governing.length > 0 && governingPi.piGroupCount > 0) {\n return {\n target: target.name,\n governing: governingNames,\n determined: false,\n outsideGoverningSpan: false,\n reason:\n 'governing variables are dimensionally dependent ' +\n `(${governingPi.piGroupCount} dimensionless combination(s) among them); ` +\n 'the determining monomial is not unique',\n };\n }\n\n const full = buckinghamPi([target, ...governing]);\n if (full.piGroupCount !== 1) {\n return {\n target: target.name,\n governing: governingNames,\n determined: false,\n outsideGoverningSpan: full.piGroupCount === 0,\n reason:\n full.piGroupCount === 0\n ? \"the target's dimension is not in the span of the governing \" +\n 'variables — no dimensionless group exists, so no monomial determines it'\n : `${full.piGroupCount} independent π-groups — the target is fixed ` +\n 'only as a function of several dimensionless ratios (under-constrained)',\n };\n }\n\n // The single π-group involves the target; solve it for the target.\n const group = full.piGroups[0].exponents;\n const targetExp = group[target.name];\n if (!targetExp) {\n return {\n target: target.name,\n governing: governingNames,\n determined: false,\n outsideGoverningSpan: false,\n reason:\n 'the sole dimensionless group does not involve the target ' +\n '(the target is dimensionally redundant with the governing set)',\n };\n }\n const monomial: Record<string, number> = {};\n for (const name of governingNames) {\n monomial[name] = -(group[name] ?? 0) / targetExp;\n }\n\n return {\n target: target.name,\n governing: governingNames,\n determined: true,\n monomial,\n upToDimensionlessConstant: true,\n outsideGoverningSpan: false,\n reason:\n 'unique dimensionless group fixes the target up to a dimensionless constant',\n };\n}\n"]}
1
+ {"version":3,"file":"buckingham.js","sourceRoot":"","sources":["../../src/dimensional/buckingham.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAkErC;cACc;AACd,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAA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AC7C,MAAM,EACJ,IAAI,CAAC,YAAY,KAAK,CAAC;gBACrB,CAAC,CAAC,6DAA6D;oBAC7D,yEAAyE;gBAC3E,CAAC,CAAC,GAAG,IAAI,CAAC,YAAY,8CAA8C;oBAClE,wEAAwE;SAC/E,CAAC;IACJ,CAAC;IAED,mEAAmE;IACnE,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACzC,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO;YACL,MAAM,EAAE,MAAM,CAAC,IAAI;YACnB,SAAS,EAAE,cAAc;YACzB,UAAU,EAAE,KAAK;YACjB,oBAAoB,EAAE,KAAK;YAC3B,MAAM,EACJ,2DAA2D;gBAC3D,gEAAgE;SACnE,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAA2B,EAAE,CAAC;IAC5C,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;QAClC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC;IACnD,CAAC;IAED,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,IAAI;QACnB,SAAS,EAAE,cAAc;QACzB,UAAU,EAAE,IAAI;QAChB,QAAQ;QACR,yBAAyB,EAAE,IAAI;QAC/B,oBAAoB,EAAE,KAAK;QAC3B,MAAM,EACJ,4EAA4E;KAC/E,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Buckingham-π enumerator (build target 1 of\n * docs/planning/Bridge-Inference-Epistemics-Note.md — the principled\n * primitive for the classifier's EXACTLY-DETERMINED case).\n *\n * Given a set of dimensional variables presumed to obey one\n * dimensionally-homogeneous relation, the Buckingham-π theorem says that\n * relation re-expresses as F(π₁,…,π_{n−r}) = 0, where each πᵢ is a\n * dimensionless power-product of the variables and there are exactly\n * n − r of them (n = variables, r = rank of the dimension matrix). The\n * π-groups are a basis of the NULL SPACE of the dimension matrix.\n *\n * THE HONEST BOUNDARY (enforced by the result types — there is no value\n * or constant field anywhere): this returns the FORM only. It yields the\n * π-groups and, for a target, the monomial that determines it UP TO A\n * DIMENSIONLESS CONSTANT (the 2π, the ½, α). It does NOT and cannot\n * supply that constant, nor the function F. That boundary is exactly what\n * separates dimensional analysis from numerology — see the epistemics\n * note.\n *\n * Computation is EXACT (rational arithmetic), not floating Gaussian\n * elimination: physics dimension exponents are small rationals, and the\n * null-space basis must be exact to be trustworthy.\n *\n * @module dimensional/buckingham\n */\n\nimport { Fraction } from '@danielsimonjr/mathts-core';\nimport { rationalNullspace } from '@danielsimonjr/mathts-functions';\nimport type { Dimension } from './types.js';\nimport { BASES } from './algebra.js';\n\n/** A named physical quantity with a dimension — the enumerator's input.\n * Structurally satisfied by a composition `Quantity`. @public */\nexport interface DimensionalVariable {\n readonly name: string;\n readonly dim: Dimension;\n}\n\n/** A dimensionless power-product of the input variables (integer\n * exponents; the conventional form). No value — π-groups carry FORM,\n * not magnitude. @public */\nexport interface PiGroup {\n /** Integer exponent of each variable in this dimensionless product. */\n readonly exponents: Readonly<Record<string, number>>;\n /** Display form, e.g. `period^2 · gravity · length^-1`. */\n readonly formula: string;\n}\n\n/** The dimensional closure of a variable set. @public */\nexport type BuckinghamVerdict =\n | 'dimensionally-independent' // 0 π-groups: no dimensionless product exists\n | 'single-invariant' // 1 π-group: one dimensionless invariant\n | 'multiple-invariants'; // ≥2 π-groups: a family F(π₁,…)\n\n/** Result of {@link buckinghamPi}. @public */\nexport interface BuckinghamResult {\n readonly variables: readonly string[];\n /** Base SI dimensions actually spanned by the inputs. */\n readonly baseDimensions: readonly string[];\n /** n — the number of variables. */\n readonly variableCount: number;\n /** r — the rank of the dimension matrix. */\n readonly rank: number;\n /** n − r — the number of independent dimensionless groups. */\n readonly piGroupCount: number;\n readonly piGroups: readonly PiGroup[];\n readonly verdict: BuckinghamVerdict;\n}\n\n/** Result of {@link dimensionallyDetermines}. @public */\nexport interface DimensionalDeterminationResult {\n readonly target: string;\n readonly governing: readonly string[];\n /** True iff the target is fixed by the governing variables UP TO A\n * DIMENSIONLESS CONSTANT (unique monomial). */\n readonly determined: boolean;\n /**\n * When determined: target = const · Π(governingⱼ ^ monomial[j]). The\n * exponents may be rational (e.g. 0.5 for a √ law). Always read with\n * `upToDimensionlessConstant` — the leading constant is NOT supplied.\n */\n readonly monomial?: Readonly<Record<string, number>>;\n /** Always true when `monomial` is present — a standing reminder. */\n readonly upToDimensionlessConstant?: true;\n /**\n * True only when the target's dimension is not in the span of the governing\n * variables, so a monomial needs dimensionful constants the inputs do not\n * name. False when the governing variables are dimensionally dependent or\n * leave more than one π-group: that failure is not a missing constant.\n */\n readonly outsideGoverningSpan: boolean;\n /** Plain-language reason for the verdict. */\n readonly reason: string;\n}\n\n/** Rationalization failed: a dimension exponent is not a small rational.\n * @public */\nexport class RationalizationError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'RationalizationError';\n }\n}\n\n// ---------------------------------------------------------------------------\n// Exact rational arithmetic: MathTS core `Fraction` (bigint-backed, reduced by\n// its constructor). Dimension exponents are small rationals.\n// ---------------------------------------------------------------------------\n\nconst MAX_DEN = 720;\n\n/**\n * Convert a (possibly rational) exponent to an exact {@link Fraction} by\n * scanning small denominators; throws if none matches within tolerance. The\n * scan, not `Fraction.fromNumber`'s continued fraction, is what refuses an\n * irrational exponent instead of approximating it.\n */\nfunction toFrac(x: number): Fraction {\n if (Number.isInteger(x)) return new Fraction(x, 1);\n for (let d = 2; d <= MAX_DEN; d++) {\n const n = x * d;\n if (Math.abs(n - Math.round(n)) < 1e-9 * Math.max(1, Math.abs(n))) {\n return new Fraction(Math.round(n), d);\n }\n }\n throw new RationalizationError(\n `dimension exponent ${x} is not a rational with denominator ≤ ${MAX_DEN}`,\n );\n}\n\n/**\n * Exact null space of the dimension matrix. Exponents pass through as\n * {@link Fraction} values after {@link toFrac}, so an irrational is still\n * {@link RationalizationError} and is not accepted by a continued fraction.\n * A matrix with no rows is `0×n`: `{ columns: n }` is the standard basis.\n * MathTS integerizes each vector (content 1, first nonzero entry positive).\n */\nfunction nullSpace(matrix: Fraction[][], cols: number): { basis: number[][]; rank: number } {\n const solved = rationalNullspace(matrix, { columns: cols });\n const basis = solved.basis.map((vec) =>\n vec.map((entry) => {\n if (entry.denominator !== 1n) {\n throw new RationalizationError(\n `null-space entry ${entry.toString()} is not an integer`,\n );\n }\n return Number(entry.numerator);\n }),\n );\n return { basis, rank: solved.rank };\n}\n\nfunction buildMatrix(variables: readonly DimensionalVariable[]): {\n matrix: Fraction[][];\n spannedBases: string[];\n} {\n const spannedBases: string[] = [];\n const matrix: Fraction[][] = [];\n for (const base of BASES) {\n const row = variables.map((v) => toFrac(v.dim[base]));\n if (row.some((f) => !f.isZero())) {\n spannedBases.push(base);\n matrix.push(row);\n }\n }\n return { matrix, spannedBases };\n}\n\nfunction formatPiGroup(\n exponents: Record<string, number>,\n order: readonly string[],\n): string {\n const parts: string[] = [];\n for (const name of order) {\n const e = exponents[name];\n if (e === 0) continue;\n parts.push(e === 1 ? name : `${name}^${e}`);\n }\n return parts.join(' · ') || '1';\n}\n\n/**\n * Enumerate the Buckingham-π groups of a dimensional variable set. Returns\n * the rank, the count n − r, and a null-space basis of dimensionless\n * groups. FORM only — no constants (see module docs).\n *\n * @public\n */\nexport function buckinghamPi(\n variables: readonly DimensionalVariable[],\n): BuckinghamResult {\n if (variables.length === 0) {\n throw new RationalizationError('buckinghamPi requires at least one variable');\n }\n const names = variables.map((v) => v.name);\n if (new Set(names).size !== names.length) {\n throw new RationalizationError(\n `buckinghamPi requires unique variable names; got [${names.join(', ')}]`,\n );\n }\n\n const n = variables.length;\n const { matrix, spannedBases } = buildMatrix(variables);\n\n const { basis, rank } = nullSpace(matrix, n);\n const piGroups: PiGroup[] = basis.map((vec) => {\n const exponents: Record<string, number> = {};\n for (let j = 0; j < n; j++) exponents[names[j]] = vec[j];\n return { exponents, formula: formatPiGroup(exponents, names) };\n });\n\n const piGroupCount = n - rank;\n const verdict: BuckinghamVerdict =\n piGroupCount === 0\n ? 'dimensionally-independent'\n : piGroupCount === 1\n ? 'single-invariant'\n : 'multiple-invariants';\n\n return {\n variables: names,\n baseDimensions: spannedBases,\n variableCount: n,\n rank,\n piGroupCount,\n piGroups,\n verdict,\n };\n}\n\n/**\n * Does the governing set fix the target UP TO A DIMENSIONLESS CONSTANT?\n *\n * True iff the governing variables are dimensionally independent and the\n * target's dimension lies in their span — equivalently, the full set has\n * exactly one π-group and the governing set has none. When determined,\n * returns the (possibly rational) monomial exponents such that\n * target = const · Π(governingⱼ ^ monomial[j]). The constant is NOT\n * supplied — dimensional analysis cannot.\n *\n * @public\n */\nexport function dimensionallyDetermines(\n target: DimensionalVariable,\n governing: readonly DimensionalVariable[],\n): DimensionalDeterminationResult {\n const governingNames = governing.map((v) => v.name);\n\n const governingPi = buckinghamPi(\n governing.length > 0 ? governing : [target],\n );\n // A redundancy among the governing variables means the monomial is not\n // unique (any dimensionless governing combo can be folded into the\n // constant) → not determined.\n if (governing.length > 0 && governingPi.piGroupCount > 0) {\n return {\n target: target.name,\n governing: governingNames,\n determined: false,\n outsideGoverningSpan: false,\n reason:\n 'governing variables are dimensionally dependent ' +\n `(${governingPi.piGroupCount} dimensionless combination(s) among them); ` +\n 'the determining monomial is not unique',\n };\n }\n\n const full = buckinghamPi([target, ...governing]);\n if (full.piGroupCount !== 1) {\n return {\n target: target.name,\n governing: governingNames,\n determined: false,\n outsideGoverningSpan: full.piGroupCount === 0,\n reason:\n full.piGroupCount === 0\n ? \"the target's dimension is not in the span of the governing \" +\n 'variables — no dimensionless group exists, so no monomial determines it'\n : `${full.piGroupCount} independent π-groups — the target is fixed ` +\n 'only as a function of several dimensionless ratios (under-constrained)',\n };\n }\n\n // The single π-group involves the target; solve it for the target.\n const group = full.piGroups[0].exponents;\n const targetExp = group[target.name];\n if (!targetExp) {\n return {\n target: target.name,\n governing: governingNames,\n determined: false,\n outsideGoverningSpan: false,\n reason:\n 'the sole dimensionless group does not involve the target ' +\n '(the target is dimensionally redundant with the governing set)',\n };\n }\n const monomial: Record<string, number> = {};\n for (const name of governingNames) {\n monomial[name] = -(group[name] ?? 0) / targetExp;\n }\n\n return {\n target: target.name,\n governing: governingNames,\n determined: true,\n monomial,\n upToDimensionlessConstant: true,\n outsideGoverningSpan: false,\n reason:\n 'unique dimensionless group fixes the target up to a dimensionless constant',\n };\n}\n"]}
@@ -34,9 +34,9 @@ export const CONSTANT_ROWS = [
34
34
  row({ name: 'c', spellings: ['speed-of-light', 'speed_of_light'], value: C_SI, unit: 'm/s', canonical: true, mathts: 'speedOfLight', exact: true,
35
35
  meaning: 'speed of light in vacuum', source: `exact SI (${OWNER} C_SI)` }),
36
36
  row({ name: 'R_inf', spellings: ['Rinf', 'R_infinity', 'rydberg'], quantity: 'rydberg-constant', value: R_INF_SI, unit: '1/m', canonical: true, mathts: 'rydberg',
37
- meaning: 'Rydberg constant R∞, infinite nuclear mass (the reduced-mass correction R_M = R∞/(1 + m_e/M) is not applied)', source: `CODATA 2018 (${OWNER} R_INF_SI)` }),
37
+ meaning: 'Rydberg constant R∞, infinite nuclear mass (the reduced-mass correction R_M = R∞/(1 + m_e/M) is not applied)', source: `CODATA 2022, MathTS (${OWNER} R_INF_SI)` }),
38
38
  row({ name: 'G', value: G_SI, unit: 'm^3/(kg*s^2)', canonical: true, mathts: 'gravitationConstant',
39
- meaning: 'Newtonian gravitational constant', source: `CODATA 2018 (${OWNER} G_SI)` }),
39
+ meaning: 'Newtonian gravitational constant', source: `CODATA 2022, MathTS (${OWNER} G_SI)` }),
40
40
  row({ name: 'k_B', spellings: ['kB', 'boltzmann'], quantity: 'boltzmann-constant', value: K_B_SI, unit: 'J/K', canonical: true, mathts: 'boltzmann', exact: true,
41
41
  meaning: 'Boltzmann constant', source: `exact SI, 2019 redefinition (${OWNER} K_B_SI)` }),
42
42
  row({ name: 'ln2', value: Math.LN2, unit: '1', canonical: true, irrational: true,
@@ -53,25 +53,25 @@ export const CONSTANT_ROWS = [
53
53
  row({ name: 'e', spellings: ['e_charge'], value: E_SI, unit: 'C', canonical: true, mathts: 'elementaryCharge', exact: true,
54
54
  meaning: 'elementary charge', source: `exact SI, 2019 redefinition (${OWNER} E_SI)` }),
55
55
  row({ name: 'epsilon_0', spellings: ['epsilon0', 'eps0', 'vacuum-permittivity'], value: EPS0_SI, unit: 'F/m', canonical: true,
56
- meaning: 'vacuum permittivity', source: `CODATA 2018 (${OWNER} EPS0_SI)` }),
56
+ meaning: 'vacuum permittivity', source: `CODATA 2022, MathTS (${OWNER} EPS0_SI)` }),
57
57
  row({ name: 'sigma_sb', spellings: ['stefan-boltzmann-constant'], value: SIGMA_SB_SI, unit: 'W/(m^2*K^4)', canonical: true, mathts: 'stefanBoltzmann',
58
- meaning: 'Stefan–Boltzmann constant', source: `CODATA 2018 (${OWNER} SIGMA_SB_SI)` }),
58
+ meaning: 'Stefan–Boltzmann constant', source: `CODATA 2022, MathTS (${OWNER} SIGMA_SB_SI)` }),
59
59
  row({ name: 'b', spellings: ['wien-constant'], value: B_WIEN_SI, unit: 'm*K', canonical: true, mathts: 'wienDisplacement',
60
- meaning: 'Wien displacement constant', source: `CODATA 2018 (${OWNER} B_WIEN_SI)` }),
60
+ meaning: 'Wien displacement constant', source: `CODATA 2022, MathTS (${OWNER} B_WIEN_SI)` }),
61
61
  // IAU 2015 nominal solar parameter. M_sun in eval stays the rounded kilogram M_SUN_SI.
62
62
  row({ name: 'GM_sun', value: GM_SUN_SI, unit: 'm^3/s^2', canonical: true,
63
63
  meaning: 'IAU nominal solar gravitational parameter (GM)☉', source: `IAU 2015 Resolution B3 (${OWNER} GM_SUN_SI)` }),
64
64
  row({ name: 'Msun_iau', value: M_SUN_IAU_SI, unit: 'kg', canonical: true,
65
65
  meaning: 'IAU solar mass (GM)☉/G, the mass that reproduces GM_sun with G_SI', source: `GM_SUN_SI/G_SI (${OWNER} M_SUN_IAU_SI)` }),
66
66
  row({ name: 'm_u', value: M_U_SI, unit: 'kg', canonical: true, mathts: 'atomicMass',
67
- meaning: 'unified atomic mass unit (atomic mass constant)', source: `CODATA 2018 (${OWNER} M_U_SI)` }),
67
+ meaning: 'unified atomic mass unit (atomic mass constant)', source: `CODATA 2022, MathTS (${OWNER} M_U_SI)` }),
68
68
  row({ name: 'm_e', spellings: ['electron_mass', 'electron-mass'], value: M_E_SI, unit: 'kg', canonical: true, mathts: 'electronMass',
69
- meaning: 'electron mass', source: `CODATA 2018 (${OWNER} M_E_SI)` }),
69
+ meaning: 'electron mass', source: `CODATA 2022, MathTS (${OWNER} M_E_SI)` }),
70
70
  // ── overlay names for `upt eval` and the dimensional assignment only ────
71
71
  row({ name: 'mu_0', spellings: ['mu0'], value: MU0_SI, unit: 'H/m', mathts: 'magneticConstant',
72
72
  meaning: 'vacuum permeability 1/(ε₀ c²)', source: `1/(EPS0_SI·C_SI²) (${OWNER} MU0_SI)` }),
73
73
  row({ name: 'm_p', spellings: ['m_proton'], value: M_PROTON_SI, unit: 'kg', mathts: 'protonMass',
74
- meaning: 'proton mass', source: `CODATA 2018 (${OWNER} M_PROTON_SI)` }),
74
+ meaning: 'proton mass', source: `CODATA 2022, MathTS (${OWNER} M_PROTON_SI)` }),
75
75
  row({ name: 'N_A', value: N_A_SI, unit: 'mol^-1', mathts: 'avogadro', exact: true,
76
76
  meaning: 'Avogadro constant', source: `exact SI, 2019 redefinition (${OWNER} N_A_SI)` }),
77
77
  row({ name: 'F', value: FARADAY_SI, unit: 'C/mol', mathts: 'faraday', exact: true,
@@ -88,7 +88,7 @@ export const CONSTANT_ROWS = [
88
88
  row({ name: 'scale_factor', value: 1, unit: 'm',
89
89
  meaning: 'Friedmann scale factor, unit by default', source: 'this registry (default 1)' }),
90
90
  row({ name: 'sigma_T', value: THOMSON_CROSS_SECTION_SI, unit: 'm^2', mathts: 'thomsonCrossSection',
91
- meaning: 'Thomson cross section', source: `CODATA 2018 (${OWNER} THOMSON_CROSS_SECTION_SI)` }),
91
+ meaning: 'Thomson cross section', source: `CODATA 2022, MathTS (${OWNER} THOMSON_CROSS_SECTION_SI)` }),
92
92
  row({ name: 'lane_emden_omega_3', quantity: 'lane-emden-omega-3', value: LANE_EMDEN_OMEGA3, unit: '1',
93
93
  meaning: 'Lane–Emden n = 3 dimensionless radius', source: `${OWNER} LANE_EMDEN_OMEGA3` }),
94
94
  row({ name: 'euler_gamma', value: EULER_GAMMA, unit: '1',
@@ -1 +1 @@
1
- {"version":3,"file":"constant-rows.js","sourceRoot":"","sources":["../../src/dimensional/constant-rows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,WAAW,EACX,UAAU,EACV,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,iBAAiB,EACjB,MAAM,EACN,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,MAAM,EACN,MAAM,EACN,WAAW,EACX,wBAAwB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AA6CnE,MAAM,GAAG,GAAG,CAAC,KAAe,EAAe,EAAE,CAAC,CAAC;IAC7C,GAAG,KAAK;IACR,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,EAAE;IAChC,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,KAAK;CACpC,CAAC,CAAC;AAEH,MAAM,KAAK,GAAG,mBAAmB,CAAC;AAElC,2FAA2F;AAC3F,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,0EAA0E;IAC1E,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,yBAAyB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,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AAC;YAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,QAAQ,oBAAoB,CAAC,CAAC;QACpG,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;AACH,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,OAAO,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACnC,CAAC","sourcesContent":["/**\n * The constant registry's rows as written: name, spellings, SI value, SI unit\n * text, meaning, source and flags, one row per physical constant a formula or\n * the unit table may name.\n *\n * `symbolic-constants.ts` derives each row's dimension from its unit with\n * `parseUnit` and owns every projection. The rows live here, apart from that\n * derivation, because the unit table reads constants too: `data/units.json`\n * names `c`, `e`, `m_u`, `M_sun`, `Msun_iau` and `ln2` by these spellings, and\n * the unit parser cannot import a module that imports the unit parser. This\n * module imports only `core/constants.ts`, the owner of every value, so the\n * unit loader and the registry read one set of spellings with no cycle.\n *\n * INTERNAL — not on the public surface.\n *\n * @module dimensional/constant-rows\n */\n\nimport {\n B_WIEN_SI,\n C_SI,\n E_SI,\n EPS0_SI,\n EULER_GAMMA,\n FARADAY_SI,\n G_SI,\n GM_SUN_SI,\n H_SI,\n HBAR_CODATA_DISPLAY,\n HBAR_SI,\n K_B_SI,\n LANE_EMDEN_OMEGA3,\n M_E_SI,\n M_PROTON_SI,\n M_SUN_IAU_SI,\n M_SUN_SI,\n M_U_SI,\n MU0_SI,\n N_A_SI,\n SIGMA_SB_SI,\n THOMSON_CROSS_SECTION_SI, R_INF_SI } from '../core/constants.js';\n\n/** One registered constant as written: everything but the dimension, which `symbolic-constants.ts` derives from `unit`. @internal */\nexport interface ConstantRow {\n /** The formula name; the first spelling, and the key of every projection. */\n readonly name: string;\n /** Other exact-case spellings a caller may type. */\n readonly spellings: readonly string[];\n readonly value: number;\n /** The SI unit, in the syntax `parseUnit` reads. The dimension is derived from it. */\n readonly unit: string;\n readonly meaning: string;\n readonly source: string;\n /** A universal constant a canonical `governing` list may bake. */\n readonly canonical: boolean;\n /** A caveat printed wherever the constant is used (`upt eval`, a relation that names it). */\n readonly note?: string;\n /** The `@danielsimonjr/mathts-functions` export that states the same constant (CODATA 2022 there), when one exists. The second method. */\n readonly mathts?: string;\n /** The two libraries agree to the last bit: exact in the 2019 SI, or a product of exact constants. */\n readonly exact?: true;\n /**\n * The `data/quantities.json` id this constant is also a quantity of. The\n * quantity registry takes the constant's spellings as that row's aliases;\n * the file does not repeat them, so a spelling has one owner.\n */\n readonly quantity?: string;\n /**\n * A mathematical constant no rational states (ln 2, 2π, 4π, 8π). An exact\n * reader (`data/units.json`'s scale expressions) carries `value` as the\n * irrational factor instead of reading its decimal as a rational.\n */\n readonly irrational?: true;\n}\n\ntype RowInput = Omit<ConstantRow, 'spellings' | 'canonical' | 'note' | 'mathts' | 'exact' | 'quantity' | 'irrational'> & {\n readonly quantity?: string;\n readonly irrational?: true;\n readonly note?: string;\n readonly mathts?: string;\n readonly exact?: true;\n readonly spellings?: readonly string[];\n readonly canonical?: boolean;\n};\n\nconst row = (input: RowInput): ConstantRow => ({\n ...input,\n spellings: input.spellings ?? [],\n canonical: input.canonical ?? false,\n});\n\nconst OWNER = 'core/constants.ts';\n\n/** Every registered constant as written. Order is the order the tables print. @internal */\nexport const CONSTANT_ROWS: readonly ConstantRow[] = [\n // ── universal constants a canonical equation may bake ──────────────────\n row({ name: 'hbar', spellings: ['ℏ', 'reduced-planck-constant'], value: HBAR_SI, unit: 'J*s', canonical: true, mathts: 'reducedPlanckConstant', exact: true,\n meaning: 'reduced Planck constant h/(2π)', source: `exact H_SI/(2π) (${OWNER} HBAR_SI)`,\n note:\n `hbar is HBAR_SI = H_SI/(2π), the exact reduced Planck constant. The CODATA display ${HBAR_CODATA_DISPLAY} ` +\n `is that quotient truncated (relative difference ${(Math.abs(HBAR_CODATA_DISPLAY - HBAR_SI) / HBAR_SI).toExponential(3)}).` }),\n row({ name: 'h', quantity: 'planck-constant', value: H_SI, unit: 'J*s', canonical: true, mathts: 'planckConstant', exact: true,\n meaning: 'Planck constant', source: `exact SI, 2019 redefinition (${OWNER} H_SI)` }),\n row({ name: 'c', spellings: ['speed-of-light', 'speed_of_light'], value: C_SI, unit: 'm/s', canonical: true, mathts: 'speedOfLight', exact: true,\n meaning: 'speed of light in vacuum', source: `exact SI (${OWNER} C_SI)` }),\n row({ name: 'R_inf', spellings: ['Rinf', 'R_infinity', 'rydberg'], quantity: 'rydberg-constant', value: R_INF_SI, unit: '1/m', canonical: true, mathts: 'rydberg',\n meaning: 'Rydberg constant R∞, infinite nuclear mass (the reduced-mass correction R_M = R∞/(1 + m_e/M) is not applied)', source: `CODATA 2018 (${OWNER} R_INF_SI)` }),\n row({ name: 'G', value: G_SI, unit: 'm^3/(kg*s^2)', canonical: true, mathts: 'gravitationConstant',\n meaning: 'Newtonian gravitational constant', source: `CODATA 2018 (${OWNER} G_SI)` }),\n row({ name: 'k_B', spellings: ['kB', 'boltzmann'], quantity: 'boltzmann-constant', value: K_B_SI, unit: 'J/K', canonical: true, mathts: 'boltzmann', exact: true,\n meaning: 'Boltzmann constant', source: `exact SI, 2019 redefinition (${OWNER} K_B_SI)` }),\n row({ name: 'ln2', value: Math.LN2, unit: '1', canonical: true, irrational: true,\n meaning: 'natural logarithm of 2', source: 'mathematical constant (Math.LN2)' }),\n row({ name: '8pi', value: 8 * Math.PI, unit: '1', canonical: true, irrational: true,\n meaning: '8π', source: 'mathematical constant (8·Math.PI)' }),\n row({ name: '4pi', value: 4 * Math.PI, unit: '1', canonical: true, irrational: true,\n meaning: '4π', source: 'mathematical constant (4·Math.PI)' }),\n row({ name: '2pi', value: 2 * Math.PI, unit: '1', canonical: true, irrational: true,\n meaning: '2π', source: 'mathematical constant (2·Math.PI)' }),\n // ISO 80000 / CODATA: a bare e is the elementary charge. Eccentricity is\n // one_minus_e_sq. The canonical dimension guard still refuses to bake a\n // dimensionless governing name e.\n row({ name: 'e', spellings: ['e_charge'], value: E_SI, unit: 'C', canonical: true, mathts: 'elementaryCharge', exact: true,\n meaning: 'elementary charge', source: `exact SI, 2019 redefinition (${OWNER} E_SI)` }),\n row({ name: 'epsilon_0', spellings: ['epsilon0', 'eps0', 'vacuum-permittivity'], value: EPS0_SI, unit: 'F/m', canonical: true,\n meaning: 'vacuum permittivity', source: `CODATA 2018 (${OWNER} EPS0_SI)` }),\n row({ name: 'sigma_sb', spellings: ['stefan-boltzmann-constant'], value: SIGMA_SB_SI, unit: 'W/(m^2*K^4)', canonical: true, mathts: 'stefanBoltzmann',\n meaning: 'Stefan–Boltzmann constant', source: `CODATA 2018 (${OWNER} SIGMA_SB_SI)` }),\n row({ name: 'b', spellings: ['wien-constant'], value: B_WIEN_SI, unit: 'm*K', canonical: true, mathts: 'wienDisplacement',\n meaning: 'Wien displacement constant', source: `CODATA 2018 (${OWNER} B_WIEN_SI)` }),\n // IAU 2015 nominal solar parameter. M_sun in eval stays the rounded kilogram M_SUN_SI.\n row({ name: 'GM_sun', value: GM_SUN_SI, unit: 'm^3/s^2', canonical: true,\n meaning: 'IAU nominal solar gravitational parameter (GM)☉', source: `IAU 2015 Resolution B3 (${OWNER} GM_SUN_SI)` }),\n row({ name: 'Msun_iau', value: M_SUN_IAU_SI, unit: 'kg', canonical: true,\n meaning: 'IAU solar mass (GM)☉/G, the mass that reproduces GM_sun with G_SI', source: `GM_SUN_SI/G_SI (${OWNER} M_SUN_IAU_SI)` }),\n row({ name: 'm_u', value: M_U_SI, unit: 'kg', canonical: true, mathts: 'atomicMass',\n meaning: 'unified atomic mass unit (atomic mass constant)', source: `CODATA 2018 (${OWNER} M_U_SI)` }),\n row({ name: 'm_e', spellings: ['electron_mass', 'electron-mass'], value: M_E_SI, unit: 'kg', canonical: true, mathts: 'electronMass',\n meaning: 'electron mass', source: `CODATA 2018 (${OWNER} M_E_SI)` }),\n // ── overlay names for `upt eval` and the dimensional assignment only ────\n row({ name: 'mu_0', spellings: ['mu0'], value: MU0_SI, unit: 'H/m', mathts: 'magneticConstant',\n meaning: 'vacuum permeability 1/(ε₀ c²)', source: `1/(EPS0_SI·C_SI²) (${OWNER} MU0_SI)` }),\n row({ name: 'm_p', spellings: ['m_proton'], value: M_PROTON_SI, unit: 'kg', mathts: 'protonMass',\n meaning: 'proton mass', source: `CODATA 2018 (${OWNER} M_PROTON_SI)` }),\n row({ name: 'N_A', value: N_A_SI, unit: 'mol^-1', mathts: 'avogadro', exact: true,\n meaning: 'Avogadro constant', source: `exact SI, 2019 redefinition (${OWNER} N_A_SI)` }),\n row({ name: 'F', value: FARADAY_SI, unit: 'C/mol', mathts: 'faraday', exact: true,\n meaning: 'Faraday constant N_A e', source: `N_A_SI·E_SI (${OWNER} FARADAY_SI)` }),\n // R = N_A k_B, the molar gas constant the thermochemical records state in their titles.\n row({ name: 'R', value: N_A_SI * K_B_SI, unit: 'J/(mol*K)', mathts: 'gasConstant', exact: true,\n meaning: 'molar gas constant N_A k_B', source: `N_A_SI·K_B_SI (${OWNER})` }),\n row({ name: 'M_sun', value: M_SUN_SI, unit: 'kg',\n meaning: 'solar mass, the repo-conventional kilogram value', source: `${OWNER} M_SUN_SI` }),\n // `curvature_k` and `scale_factor` are the Friedmann curvature extension\n // (the frozen `CE-friedmann` entry is the flat term).\n row({ name: 'curvature_k', value: 0, unit: '1',\n meaning: 'Friedmann curvature index, flat by default', source: 'this registry (flat default 0)' }),\n row({ name: 'scale_factor', value: 1, unit: 'm',\n meaning: 'Friedmann scale factor, unit by default', source: 'this registry (default 1)' }),\n row({ name: 'sigma_T', value: THOMSON_CROSS_SECTION_SI, unit: 'm^2', mathts: 'thomsonCrossSection',\n meaning: 'Thomson cross section', source: `CODATA 2018 (${OWNER} THOMSON_CROSS_SECTION_SI)` }),\n row({ name: 'lane_emden_omega_3', quantity: 'lane-emden-omega-3', value: LANE_EMDEN_OMEGA3, unit: '1',\n meaning: 'Lane–Emden n = 3 dimensionless radius', source: `${OWNER} LANE_EMDEN_OMEGA3` }),\n row({ name: 'euler_gamma', value: EULER_GAMMA, unit: '1',\n meaning: 'Euler–Mascheroni constant γ', source: `${OWNER} EULER_GAMMA` }),\n // GRW mass amplification: λ = λ₀ · (m / m₀), with λ₀ a rate and m₀ a mass.\n // The two numbers are the catalog expression's, so the rate is unchanged.\n row({ name: 'grw_lambda0', value: 1e-16, unit: 'Hz',\n meaning: 'GRW localization rate λ₀', source: 'catalog expression (Ghirardi–Rimini–Weber 1986)' }),\n row({ name: 'grw_m0', value: 1.67e-27, unit: 'kg',\n meaning: 'GRW reference mass m₀ (a nucleon)', source: 'catalog expression (Ghirardi–Rimini–Weber 1986)' }),\n];\n\nconst BY_SPELLING = new Map<string, ConstantRow>();\nfor (const constant of CONSTANT_ROWS) {\n for (const spelling of [constant.name, ...constant.spellings]) {\n if (BY_SPELLING.has(spelling)) throw new Error(`constant registry: '${spelling}' is spelled twice`);\n BY_SPELLING.set(spelling, constant);\n }\n}\n\n/** The registered constant row `spelling` names, or undefined. @internal */\nexport function constantRow(spelling: string): ConstantRow | undefined {\n return BY_SPELLING.get(spelling);\n}\n"]}
1
+ {"version":3,"file":"constant-rows.js","sourceRoot":"","sources":["../../src/dimensional/constant-rows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,WAAW,EACX,UAAU,EACV,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,iBAAiB,EACjB,MAAM,EACN,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,MAAM,EACN,MAAM,EACN,WAAW,EACX,wBAAwB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AA6CnE,MAAM,GAAG,GAAG,CAAC,KAAe,EAAe,EAAE,CAAC,CAAC;IAC7C,GAAG,KAAK;IACR,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,EAAE;IAChC,SAAS,EAAE,KAAK,C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QAC/C,OAAO,EAAE,mCAAmC,EAAE,MAAM,EAAE,iDAAiD,EAAE,CAAC;CAC7G,CAAC;AAEF,MAAM,WAAW,GAAG,IAAI,GAAG,EAAuB,CAAC;AACnD,KAAK,MAAM,QAAQ,IAAI,aAAa,EAAE,CAAC;IACrC,KAAK,MAAM,QAAQ,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9D,IAAI,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,QAAQ,oBAAoB,CAAC,CAAC;QACpG,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;AACH,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,OAAO,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACnC,CAAC","sourcesContent":["/**\n * The constant registry's rows as written: name, spellings, SI value, SI unit\n * text, meaning, source and flags, one row per physical constant a formula or\n * the unit table may name.\n *\n * `symbolic-constants.ts` derives each row's dimension from its unit with\n * `parseUnit` and owns every projection. The rows live here, apart from that\n * derivation, because the unit table reads constants too: `data/units.json`\n * names `c`, `e`, `m_u`, `M_sun`, `Msun_iau` and `ln2` by these spellings, and\n * the unit parser cannot import a module that imports the unit parser. This\n * module imports only `core/constants.ts`, the owner of every value, so the\n * unit loader and the registry read one set of spellings with no cycle.\n *\n * INTERNAL — not on the public surface.\n *\n * @module dimensional/constant-rows\n */\n\nimport {\n B_WIEN_SI,\n C_SI,\n E_SI,\n EPS0_SI,\n EULER_GAMMA,\n FARADAY_SI,\n G_SI,\n GM_SUN_SI,\n H_SI,\n HBAR_CODATA_DISPLAY,\n HBAR_SI,\n K_B_SI,\n LANE_EMDEN_OMEGA3,\n M_E_SI,\n M_PROTON_SI,\n M_SUN_IAU_SI,\n M_SUN_SI,\n M_U_SI,\n MU0_SI,\n N_A_SI,\n SIGMA_SB_SI,\n THOMSON_CROSS_SECTION_SI, R_INF_SI } from '../core/constants.js';\n\n/** One registered constant as written: everything but the dimension, which `symbolic-constants.ts` derives from `unit`. @internal */\nexport interface ConstantRow {\n /** The formula name; the first spelling, and the key of every projection. */\n readonly name: string;\n /** Other exact-case spellings a caller may type. */\n readonly spellings: readonly string[];\n readonly value: number;\n /** The SI unit, in the syntax `parseUnit` reads. The dimension is derived from it. */\n readonly unit: string;\n readonly meaning: string;\n readonly source: string;\n /** A universal constant a canonical `governing` list may bake. */\n readonly canonical: boolean;\n /** A caveat printed wherever the constant is used (`upt eval`, a relation that names it). */\n readonly note?: string;\n /** The `@danielsimonjr/mathts-functions` export that states the same constant (CODATA 2022 there), when one exists. The second method. */\n readonly mathts?: string;\n /** The two libraries agree to the last bit: exact in the 2019 SI, or a product of exact constants. */\n readonly exact?: true;\n /**\n * The `data/quantities.json` id this constant is also a quantity of. The\n * quantity registry takes the constant's spellings as that row's aliases;\n * the file does not repeat them, so a spelling has one owner.\n */\n readonly quantity?: string;\n /**\n * A mathematical constant no rational states (ln 2, 2π, 4π, 8π). An exact\n * reader (`data/units.json`'s scale expressions) carries `value` as the\n * irrational factor instead of reading its decimal as a rational.\n */\n readonly irrational?: true;\n}\n\ntype RowInput = Omit<ConstantRow, 'spellings' | 'canonical' | 'note' | 'mathts' | 'exact' | 'quantity' | 'irrational'> & {\n readonly quantity?: string;\n readonly irrational?: true;\n readonly note?: string;\n readonly mathts?: string;\n readonly exact?: true;\n readonly spellings?: readonly string[];\n readonly canonical?: boolean;\n};\n\nconst row = (input: RowInput): ConstantRow => ({\n ...input,\n spellings: input.spellings ?? [],\n canonical: input.canonical ?? false,\n});\n\nconst OWNER = 'core/constants.ts';\n\n/** Every registered constant as written. Order is the order the tables print. @internal */\nexport const CONSTANT_ROWS: readonly ConstantRow[] = [\n // ── universal constants a canonical equation may bake ──────────────────\n row({ name: 'hbar', spellings: ['ℏ', 'reduced-planck-constant'], value: HBAR_SI, unit: 'J*s', canonical: true, mathts: 'reducedPlanckConstant', exact: true,\n meaning: 'reduced Planck constant h/(2π)', source: `exact H_SI/(2π) (${OWNER} HBAR_SI)`,\n note:\n `hbar is HBAR_SI = H_SI/(2π), the exact reduced Planck constant. The CODATA display ${HBAR_CODATA_DISPLAY} ` +\n `is that quotient truncated (relative difference ${(Math.abs(HBAR_CODATA_DISPLAY - HBAR_SI) / HBAR_SI).toExponential(3)}).` }),\n row({ name: 'h', quantity: 'planck-constant', value: H_SI, unit: 'J*s', canonical: true, mathts: 'planckConstant', exact: true,\n meaning: 'Planck constant', source: `exact SI, 2019 redefinition (${OWNER} H_SI)` }),\n row({ name: 'c', spellings: ['speed-of-light', 'speed_of_light'], value: C_SI, unit: 'm/s', canonical: true, mathts: 'speedOfLight', exact: true,\n meaning: 'speed of light in vacuum', source: `exact SI (${OWNER} C_SI)` }),\n row({ name: 'R_inf', spellings: ['Rinf', 'R_infinity', 'rydberg'], quantity: 'rydberg-constant', value: R_INF_SI, unit: '1/m', canonical: true, mathts: 'rydberg',\n meaning: 'Rydberg constant R∞, infinite nuclear mass (the reduced-mass correction R_M = R∞/(1 + m_e/M) is not applied)', source: `CODATA 2022, MathTS (${OWNER} R_INF_SI)` }),\n row({ name: 'G', value: G_SI, unit: 'm^3/(kg*s^2)', canonical: true, mathts: 'gravitationConstant',\n meaning: 'Newtonian gravitational constant', source: `CODATA 2022, MathTS (${OWNER} G_SI)` }),\n row({ name: 'k_B', spellings: ['kB', 'boltzmann'], quantity: 'boltzmann-constant', value: K_B_SI, unit: 'J/K', canonical: true, mathts: 'boltzmann', exact: true,\n meaning: 'Boltzmann constant', source: `exact SI, 2019 redefinition (${OWNER} K_B_SI)` }),\n row({ name: 'ln2', value: Math.LN2, unit: '1', canonical: true, irrational: true,\n meaning: 'natural logarithm of 2', source: 'mathematical constant (Math.LN2)' }),\n row({ name: '8pi', value: 8 * Math.PI, unit: '1', canonical: true, irrational: true,\n meaning: '8π', source: 'mathematical constant (8·Math.PI)' }),\n row({ name: '4pi', value: 4 * Math.PI, unit: '1', canonical: true, irrational: true,\n meaning: '4π', source: 'mathematical constant (4·Math.PI)' }),\n row({ name: '2pi', value: 2 * Math.PI, unit: '1', canonical: true, irrational: true,\n meaning: '2π', source: 'mathematical constant (2·Math.PI)' }),\n // ISO 80000 / CODATA: a bare e is the elementary charge. Eccentricity is\n // one_minus_e_sq. The canonical dimension guard still refuses to bake a\n // dimensionless governing name e.\n row({ name: 'e', spellings: ['e_charge'], value: E_SI, unit: 'C', canonical: true, mathts: 'elementaryCharge', exact: true,\n meaning: 'elementary charge', source: `exact SI, 2019 redefinition (${OWNER} E_SI)` }),\n row({ name: 'epsilon_0', spellings: ['epsilon0', 'eps0', 'vacuum-permittivity'], value: EPS0_SI, unit: 'F/m', canonical: true,\n meaning: 'vacuum permittivity', source: `CODATA 2022, MathTS (${OWNER} EPS0_SI)` }),\n row({ name: 'sigma_sb', spellings: ['stefan-boltzmann-constant'], value: SIGMA_SB_SI, unit: 'W/(m^2*K^4)', canonical: true, mathts: 'stefanBoltzmann',\n meaning: 'Stefan–Boltzmann constant', source: `CODATA 2022, MathTS (${OWNER} SIGMA_SB_SI)` }),\n row({ name: 'b', spellings: ['wien-constant'], value: B_WIEN_SI, unit: 'm*K', canonical: true, mathts: 'wienDisplacement',\n meaning: 'Wien displacement constant', source: `CODATA 2022, MathTS (${OWNER} B_WIEN_SI)` }),\n // IAU 2015 nominal solar parameter. M_sun in eval stays the rounded kilogram M_SUN_SI.\n row({ name: 'GM_sun', value: GM_SUN_SI, unit: 'm^3/s^2', canonical: true,\n meaning: 'IAU nominal solar gravitational parameter (GM)☉', source: `IAU 2015 Resolution B3 (${OWNER} GM_SUN_SI)` }),\n row({ name: 'Msun_iau', value: M_SUN_IAU_SI, unit: 'kg', canonical: true,\n meaning: 'IAU solar mass (GM)☉/G, the mass that reproduces GM_sun with G_SI', source: `GM_SUN_SI/G_SI (${OWNER} M_SUN_IAU_SI)` }),\n row({ name: 'm_u', value: M_U_SI, unit: 'kg', canonical: true, mathts: 'atomicMass',\n meaning: 'unified atomic mass unit (atomic mass constant)', source: `CODATA 2022, MathTS (${OWNER} M_U_SI)` }),\n row({ name: 'm_e', spellings: ['electron_mass', 'electron-mass'], value: M_E_SI, unit: 'kg', canonical: true, mathts: 'electronMass',\n meaning: 'electron mass', source: `CODATA 2022, MathTS (${OWNER} M_E_SI)` }),\n // ── overlay names for `upt eval` and the dimensional assignment only ────\n row({ name: 'mu_0', spellings: ['mu0'], value: MU0_SI, unit: 'H/m', mathts: 'magneticConstant',\n meaning: 'vacuum permeability 1/(ε₀ c²)', source: `1/(EPS0_SI·C_SI²) (${OWNER} MU0_SI)` }),\n row({ name: 'm_p', spellings: ['m_proton'], value: M_PROTON_SI, unit: 'kg', mathts: 'protonMass',\n meaning: 'proton mass', source: `CODATA 2022, MathTS (${OWNER} M_PROTON_SI)` }),\n row({ name: 'N_A', value: N_A_SI, unit: 'mol^-1', mathts: 'avogadro', exact: true,\n meaning: 'Avogadro constant', source: `exact SI, 2019 redefinition (${OWNER} N_A_SI)` }),\n row({ name: 'F', value: FARADAY_SI, unit: 'C/mol', mathts: 'faraday', exact: true,\n meaning: 'Faraday constant N_A e', source: `N_A_SI·E_SI (${OWNER} FARADAY_SI)` }),\n // R = N_A k_B, the molar gas constant the thermochemical records state in their titles.\n row({ name: 'R', value: N_A_SI * K_B_SI, unit: 'J/(mol*K)', mathts: 'gasConstant', exact: true,\n meaning: 'molar gas constant N_A k_B', source: `N_A_SI·K_B_SI (${OWNER})` }),\n row({ name: 'M_sun', value: M_SUN_SI, unit: 'kg',\n meaning: 'solar mass, the repo-conventional kilogram value', source: `${OWNER} M_SUN_SI` }),\n // `curvature_k` and `scale_factor` are the Friedmann curvature extension\n // (the frozen `CE-friedmann` entry is the flat term).\n row({ name: 'curvature_k', value: 0, unit: '1',\n meaning: 'Friedmann curvature index, flat by default', source: 'this registry (flat default 0)' }),\n row({ name: 'scale_factor', value: 1, unit: 'm',\n meaning: 'Friedmann scale factor, unit by default', source: 'this registry (default 1)' }),\n row({ name: 'sigma_T', value: THOMSON_CROSS_SECTION_SI, unit: 'm^2', mathts: 'thomsonCrossSection',\n meaning: 'Thomson cross section', source: `CODATA 2022, MathTS (${OWNER} THOMSON_CROSS_SECTION_SI)` }),\n row({ name: 'lane_emden_omega_3', quantity: 'lane-emden-omega-3', value: LANE_EMDEN_OMEGA3, unit: '1',\n meaning: 'Lane–Emden n = 3 dimensionless radius', source: `${OWNER} LANE_EMDEN_OMEGA3` }),\n row({ name: 'euler_gamma', value: EULER_GAMMA, unit: '1',\n meaning: 'Euler–Mascheroni constant γ', source: `${OWNER} EULER_GAMMA` }),\n // GRW mass amplification: λ = λ₀ · (m / m₀), with λ₀ a rate and m₀ a mass.\n // The two numbers are the catalog expression's, so the rate is unchanged.\n row({ name: 'grw_lambda0', value: 1e-16, unit: 'Hz',\n meaning: 'GRW localization rate λ₀', source: 'catalog expression (Ghirardi–Rimini–Weber 1986)' }),\n row({ name: 'grw_m0', value: 1.67e-27, unit: 'kg',\n meaning: 'GRW reference mass m₀ (a nucleon)', source: 'catalog expression (Ghirardi–Rimini–Weber 1986)' }),\n];\n\nconst BY_SPELLING = new Map<string, ConstantRow>();\nfor (const constant of CONSTANT_ROWS) {\n for (const spelling of [constant.name, ...constant.spellings]) {\n if (BY_SPELLING.has(spelling)) throw new Error(`constant registry: '${spelling}' is spelled twice`);\n BY_SPELLING.set(spelling, constant);\n }\n}\n\n/** The registered constant row `spelling` names, or undefined. @internal */\nexport function constantRow(spelling: string): ConstantRow | undefined {\n return BY_SPELLING.get(spelling);\n}\n"]}
@@ -45,7 +45,7 @@ export type CurvatureKind = 'riemann-tensor' | 'ricci-tensor' | 'einstein-tensor
45
45
  * `componentDim` is the SI dimension of each component in the F8/I3 convention
46
46
  * (metric is dimensionless, coordinates carry [L]).
47
47
  *
48
- * @public
48
+ * @internal
49
49
  */
50
50
  interface CurvatureKindSpec {
51
51
  readonly freeIndicesShape: 'rank-4-1upper-3lower' | 'rank-2-lower-lower' | 'rank-3-lower' | 'scalar';
@@ -1 +1 @@
1
- {"version":3,"file":"curvature-composite.js","sourceRoot":"","sources":["../../src/dimensional/curvature-composite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAwDH,gFAAgF;AAChF,0BAA0B;AAC1B,gFAAgF;AAEhF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAA6C;IAC/E,gBAAgB,EAAE;QAChB,gBAAgB,EAAE,sBAAsB;QACxC,YAAY,EAAE,EAAE,CAAC,EAAE,CAAC,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;KAChE;IACD,cAAc,EAAE;QACd,gBAAgB,EAAE,oBAAoB;QACtC,YAAY,EAAE,EAAE,CAAC,EAAE,CAAC,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;KAChE;IACD,iBAAiB,EAAE;QACjB,gBAAgB,EAAE,oBAAoB;QACtC,YAAY,EAAE,EAAE,CAAC,EAAE,CAAC,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;KAChE;IACD,kBAAkB,EAAE;QAClB,yFAAyF;QACzF,gBAAgB,EAAE,cAAc;QAChC,YAAY,EAAE,EAAE,CAAC,EAAE,CAAC,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;KAChE;IACD,aAAa,EAAE;QACb,gBAAgB,EAAE,sBAAsB;QACxC,YAAY,EAAE,EAAE,CAAC,EAAE,CAAC,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;KAChE;IACD,oBAAoB,EAAE;QACpB,gBAAgB,EAAE,QAAQ;QAC1B,YAAY,EAAE,EAAE,CAAC,EAAE,CAAC,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;KAChE;CACF,CAAC","sourcesContent":["/**\n * Curvature composite-AST factory (v0.6.0 Phase 3, Task 3.9).\n *\n * PD-6 trigger fires: Weyl is the 5th curvature primitive (after\n * Riemann/Ricci/Einstein/Bianchi from v0.5.0). The 4-kind parallel\n * duplication is now extracted into a shared factory.\n *\n * Net LOC change: −180 (per design Decision #5).\n *\n * P-1 fix: `CurvatureCompositeNode<K, S>` is an intersection type, not an\n * interface with an unused S. Without the intersection, the per-kind\n * slot type-safety would silently drop (the S parameter would be\n * decorative and TypeScript would not compose it into the result).\n *\n * @module dimensional/curvature-composite\n */\n\nimport type { Dimension } from './types.js';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// CurvatureKind discriminant union\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Discriminant union of all curvature-composite AST node kinds in UPT v0.6.0.\n *\n * Six curvature primitives:\n * - `riemann-tensor` — R^ρ_{σμν} (rank-4, 1-up 3-down, [L⁻²])\n * - `ricci-tensor` — R_{μν} (rank-2 lower-lower, [L⁻²])\n * - `einstein-tensor` — G_{μν} (rank-2 lower-lower, [L⁻²])\n * - `bianchi-residual` — B_{λμνρσ} (rank-5 lower, [L⁻³])\n * - `weyl-tensor` — C^ρ_{σμν} (rank-4, 1-up 3-down, [L⁻²])\n * - `kretschmann-scalar` — K (scalar, [L⁻⁴])\n *\n * @public\n */\nexport type CurvatureKind =\n | 'riemann-tensor'\n | 'ricci-tensor'\n | 'einstein-tensor'\n | 'bianchi-residual'\n | 'weyl-tensor'\n | 'kretschmann-scalar';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// CurvatureKindSpec — per-kind shape + dim descriptor\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Per-kind specification record used by the registry.\n *\n * `freeIndicesShape` is a human-readable summary of the free-index structure:\n * - `'rank-4-1upper-3lower'` — 1 upper + 3 lower (Riemann, Weyl)\n * - `'rank-2-lower-lower'` — 2 lower (Ricci, Einstein)\n * - `'rank-3-lower'` — the Bianchi residual B_{λμνρσ}, which has FIVE lower\n * indices. The \"3\" is not the rank: it counts the three\n * cyclic terms over (λ, μ, ν) in\n * B_{λμνρσ} = ∇_λ R_{μνρσ} + ∇_μ R_{νλρσ} + ∇_ν R_{λμρσ}.\n * The name stays because the registry is public.\n * - `'scalar'` — 0 free indices (Kretschmann)\n *\n * `componentDim` is the SI dimension of each component in the F8/I3 convention\n * (metric is dimensionless, coordinates carry [L]).\n *\n * @public\n */\ninterface CurvatureKindSpec {\n readonly freeIndicesShape: 'rank-4-1upper-3lower' | 'rank-2-lower-lower' | 'rank-3-lower' | 'scalar';\n readonly componentDim: Dimension;\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// CURVATURE_KIND_REGISTRY\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Registry mapping each `CurvatureKind` to its shape + dimensional spec.\n *\n * Used by:\n * - Tests: to assert all 6 kinds are registered and that Riemann + Weyl\n * share the rank-4 shape (refactor-only invariant).\n * - Future lowering consolidation: `CURVATURE_KIND_REGISTRY[node.kind]`\n * can supply common validation data without per-kind duplication.\n *\n * @public\n */\nexport const CURVATURE_KIND_REGISTRY: Record<CurvatureKind, CurvatureKindSpec> = {\n 'riemann-tensor': {\n freeIndicesShape: 'rank-4-1upper-3lower',\n componentDim: { L: -2, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 },\n },\n 'ricci-tensor': {\n freeIndicesShape: 'rank-2-lower-lower',\n componentDim: { L: -2, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 },\n },\n 'einstein-tensor': {\n freeIndicesShape: 'rank-2-lower-lower',\n componentDim: { L: -2, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 },\n },\n 'bianchi-residual': {\n // Five lower indices; '3' counts the cyclic terms, not the rank (see CurvatureKindSpec).\n freeIndicesShape: 'rank-3-lower',\n componentDim: { L: -3, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 },\n },\n 'weyl-tensor': {\n freeIndicesShape: 'rank-4-1upper-3lower',\n componentDim: { L: -2, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 },\n },\n 'kretschmann-scalar': {\n freeIndicesShape: 'scalar',\n componentDim: { L: -4, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 },\n },\n};\n\n// ─────────────────────────────────────────────────────────────────────────────\n// CurvatureCompositeNode<K, S> — shared factory type\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Generic factory type for all curvature-composite AST nodes.\n *\n * **P-1 fix (v0.6.0 plan-vet):** Must be an intersection type, not an\n * interface with an unused type parameter. The intersection `{ kind: K } & S`\n * ensures TypeScript actually composes the kind-specific slot type `S` into\n * the resulting type, giving real discriminant + kind-specific type safety.\n *\n * Usage (type alias):\n * ```typescript\n * type RicciTensorNode = CurvatureCompositeNode<'ricci-tensor', {\n * readonly riemann: RiemannTensorNode;\n * }>;\n * ```\n *\n * The intersection produces:\n * ```typescript\n * { readonly kind: 'ricci-tensor' } & { readonly riemann: RiemannTensorNode }\n * // ≡ { readonly kind: 'ricci-tensor'; readonly riemann: RiemannTensorNode }\n * ```\n *\n * @public\n */\nexport type CurvatureCompositeNode<K extends CurvatureKind, S extends object> = {\n readonly kind: K;\n} & S;\n"]}
1
+ {"version":3,"file":"curvature-composite.js","sourceRoot":"","sources":["../../src/dimensional/curvature-composite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAwDH,gFAAgF;AAChF,0BAA0B;AAC1B,gFAAgF;AAEhF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAA6C;IAC/E,gBAAgB,EAAE;QAChB,gBAAgB,EAAE,sBAAsB;QACxC,YAAY,EAAE,EAAE,CAAC,EAAE,CAAC,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;KAChE;IACD,cAAc,EAAE;QACd,gBAAgB,EAAE,oBAAoB;QACtC,YAAY,EAAE,EAAE,CAAC,EAAE,CAAC,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;KAChE;IACD,iBAAiB,EAAE;QACjB,gBAAgB,EAAE,oBAAoB;QACtC,YAAY,EAAE,EAAE,CAAC,EAAE,CAAC,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;KAChE;IACD,kBAAkB,EAAE;QAClB,yFAAyF;QACzF,gBAAgB,EAAE,cAAc;QAChC,YAAY,EAAE,EAAE,CAAC,EAAE,CAAC,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;KAChE;IACD,aAAa,EAAE;QACb,gBAAgB,EAAE,sBAAsB;QACxC,YAAY,EAAE,EAAE,CAAC,EAAE,CAAC,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;KAChE;IACD,oBAAoB,EAAE;QACpB,gBAAgB,EAAE,QAAQ;QAC1B,YAAY,EAAE,EAAE,CAAC,EAAE,CAAC,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;KAChE;CACF,CAAC","sourcesContent":["/**\n * Curvature composite-AST factory (v0.6.0 Phase 3, Task 3.9).\n *\n * PD-6 trigger fires: Weyl is the 5th curvature primitive (after\n * Riemann/Ricci/Einstein/Bianchi from v0.5.0). The 4-kind parallel\n * duplication is now extracted into a shared factory.\n *\n * Net LOC change: −180 (per design Decision #5).\n *\n * P-1 fix: `CurvatureCompositeNode<K, S>` is an intersection type, not an\n * interface with an unused S. Without the intersection, the per-kind\n * slot type-safety would silently drop (the S parameter would be\n * decorative and TypeScript would not compose it into the result).\n *\n * @module dimensional/curvature-composite\n */\n\nimport type { Dimension } from './types.js';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// CurvatureKind discriminant union\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Discriminant union of all curvature-composite AST node kinds in UPT v0.6.0.\n *\n * Six curvature primitives:\n * - `riemann-tensor` — R^ρ_{σμν} (rank-4, 1-up 3-down, [L⁻²])\n * - `ricci-tensor` — R_{μν} (rank-2 lower-lower, [L⁻²])\n * - `einstein-tensor` — G_{μν} (rank-2 lower-lower, [L⁻²])\n * - `bianchi-residual` — B_{λμνρσ} (rank-5 lower, [L⁻³])\n * - `weyl-tensor` — C^ρ_{σμν} (rank-4, 1-up 3-down, [L⁻²])\n * - `kretschmann-scalar` — K (scalar, [L⁻⁴])\n *\n * @public\n */\nexport type CurvatureKind =\n | 'riemann-tensor'\n | 'ricci-tensor'\n | 'einstein-tensor'\n | 'bianchi-residual'\n | 'weyl-tensor'\n | 'kretschmann-scalar';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// CurvatureKindSpec — per-kind shape + dim descriptor\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Per-kind specification record used by the registry.\n *\n * `freeIndicesShape` is a human-readable summary of the free-index structure:\n * - `'rank-4-1upper-3lower'` — 1 upper + 3 lower (Riemann, Weyl)\n * - `'rank-2-lower-lower'` — 2 lower (Ricci, Einstein)\n * - `'rank-3-lower'` — the Bianchi residual B_{λμνρσ}, which has FIVE lower\n * indices. The \"3\" is not the rank: it counts the three\n * cyclic terms over (λ, μ, ν) in\n * B_{λμνρσ} = ∇_λ R_{μνρσ} + ∇_μ R_{νλρσ} + ∇_ν R_{λμρσ}.\n * The name stays because the registry is public.\n * - `'scalar'` — 0 free indices (Kretschmann)\n *\n * `componentDim` is the SI dimension of each component in the F8/I3 convention\n * (metric is dimensionless, coordinates carry [L]).\n *\n * @internal\n */\ninterface CurvatureKindSpec {\n readonly freeIndicesShape: 'rank-4-1upper-3lower' | 'rank-2-lower-lower' | 'rank-3-lower' | 'scalar';\n readonly componentDim: Dimension;\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// CURVATURE_KIND_REGISTRY\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Registry mapping each `CurvatureKind` to its shape + dimensional spec.\n *\n * Used by:\n * - Tests: to assert all 6 kinds are registered and that Riemann + Weyl\n * share the rank-4 shape (refactor-only invariant).\n * - Future lowering consolidation: `CURVATURE_KIND_REGISTRY[node.kind]`\n * can supply common validation data without per-kind duplication.\n *\n * @public\n */\nexport const CURVATURE_KIND_REGISTRY: Record<CurvatureKind, CurvatureKindSpec> = {\n 'riemann-tensor': {\n freeIndicesShape: 'rank-4-1upper-3lower',\n componentDim: { L: -2, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 },\n },\n 'ricci-tensor': {\n freeIndicesShape: 'rank-2-lower-lower',\n componentDim: { L: -2, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 },\n },\n 'einstein-tensor': {\n freeIndicesShape: 'rank-2-lower-lower',\n componentDim: { L: -2, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 },\n },\n 'bianchi-residual': {\n // Five lower indices; '3' counts the cyclic terms, not the rank (see CurvatureKindSpec).\n freeIndicesShape: 'rank-3-lower',\n componentDim: { L: -3, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 },\n },\n 'weyl-tensor': {\n freeIndicesShape: 'rank-4-1upper-3lower',\n componentDim: { L: -2, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 },\n },\n 'kretschmann-scalar': {\n freeIndicesShape: 'scalar',\n componentDim: { L: -4, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 },\n },\n};\n\n// ─────────────────────────────────────────────────────────────────────────────\n// CurvatureCompositeNode<K, S> — shared factory type\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Generic factory type for all curvature-composite AST nodes.\n *\n * **P-1 fix (v0.6.0 plan-vet):** Must be an intersection type, not an\n * interface with an unused type parameter. The intersection `{ kind: K } & S`\n * ensures TypeScript actually composes the kind-specific slot type `S` into\n * the resulting type, giving real discriminant + kind-specific type safety.\n *\n * Usage (type alias):\n * ```typescript\n * type RicciTensorNode = CurvatureCompositeNode<'ricci-tensor', {\n * readonly riemann: RiemannTensorNode;\n * }>;\n * ```\n *\n * The intersection produces:\n * ```typescript\n * { readonly kind: 'ricci-tensor' } & { readonly riemann: RiemannTensorNode }\n * // ≡ { readonly kind: 'ricci-tensor'; readonly riemann: RiemannTensorNode }\n * ```\n *\n * @public\n */\nexport type CurvatureCompositeNode<K extends CurvatureKind, S extends object> = {\n readonly kind: K;\n} & S;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dimension-inference.d.ts","sourceRoot":"","sources":["../../src/dimensional/dimension-inference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAK/C;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,QAAQ,CAa1F;AAQD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,SAAS,GACnB,SAAS,GAAG,IAAI,CAyBlB"}
1
+ {"version":3,"file":"dimension-inference.d.ts","sourceRoot":"","sources":["../../src/dimensional/dimension-inference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,QAAQ,CAa1F;AAQD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,SAAS,GACnB,SAAS,GAAG,IAAI,CAyBlB"}
@@ -18,9 +18,8 @@
18
18
  * @module dimensional/dimension-inference
19
19
  */
20
20
  import { DIMENSIONLESS, LENGTH } from './types.js';
21
- import { divide, power, EXPONENT_TOL } from './algebra.js';
21
+ import { BASES, divide, power, EXPONENT_TOL } from './algebra.js';
22
22
  import { validate } from './validator.js';
23
- const BASES = ['L', 'M', 'T', 'I', 'Theta', 'N', 'J'];
24
23
  /**
25
24
  * Rebuild `node`, replacing the dimension of every `symbol` named `name` with
26
25
  * `dim`. Walks the scalar arms (`symbol`/`op`/`transcendental`/`abs`); other
@@ -1 +1 @@
1
- {"version":3,"file":"dimension-inference.js","sourceRoot":"","sources":["../../src/dimensional/dimension-inference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,KAAK,GAAmC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAEtF;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAc,EAAE,IAAY,EAAE,GAAc;IAC9E,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,QAAQ;YACX,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACtD,KAAK,IAAI;YACP,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,mBAAmB,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;QACpF,KAAK,gBAA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,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC,CAAC,oBAAoB;IAC7E,CAAC;IACD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACnD,8EAA8E;IAC9E,8EAA8E;IAC9E,8EAA8E;IAC9E,6EAA6E;IAC7E,+EAA+E;IAC/E,MAAM,OAAO,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;IAC9B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACzC,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,YAAY;YAAE,OAAO,IAAI,CAAC;QACjE,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;IAC1B,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["/**\n * Single-unknown dimensional inference.\n *\n * Given a parsed scalar `ExprNode` (e.g. the RHS of a user equation) in which\n * exactly one symbol's dimension is unknown, and the known dimension the whole\n * expression must equal (the target), recover the unknown's dimension from\n * dimensional homogeneity — or abstain (`null`) when it is not uniquely pinned\n * (the unknown is sum-constrained, absent, or appears non-cleanly).\n *\n * Method (no symbolic differentiation): probe the unknown with two dimensions\n * and read off its net power. With the unknown set to `DIMENSIONLESS` the\n * expression has dimension `D0`; set to `LENGTH` it has `D1`. The unknown enters\n * the dimension as a single power `p`, so `D1 / D0 = LENGTH^p`; if that quotient\n * is a clean power of the probe (only the `L` component nonzero), then from\n * `target = D0 · unknown^p` we get `unknown = (target / D0)^(1/p)`. Pure; reuses\n * the dimensional `algebra`.\n *\n * @module dimensional/dimension-inference\n */\n\nimport type { Dimension } from './types.js';\nimport { DIMENSIONLESS, LENGTH } from './types.js';\nimport { divide, power, EXPONENT_TOL } from './algebra.js';\nimport type { ExprNode } from './validator.js';\nimport { validate } from './validator.js';\n\nconst BASES: ReadonlyArray<keyof Dimension> = ['L', 'M', 'T', 'I', 'Theta', 'N', 'J'];\n\n/**\n * Rebuild `node`, replacing the dimension of every `symbol` named `name` with\n * `dim`. Walks the scalar arms (`symbol`/`op`/`transcendental`/`abs`); other\n * arms are returned unchanged (they do not occur in parsed scalar expressions).\n *\n * @public\n */\nexport function substituteSymbolDim(node: ExprNode, name: string, dim: Dimension): ExprNode {\n switch (node.kind) {\n case 'symbol':\n return node.name === name ? { ...node, dim } : node;\n case 'op':\n return { ...node, args: node.args.map((a) => substituteSymbolDim(a, name, dim)) };\n case 'transcendental':\n return { ...node, arg: substituteSymbolDim(node.arg, name, dim) };\n case 'abs':\n return { ...node, arg: substituteSymbolDim(node.arg, name, dim) };\n default:\n return node;\n }\n}\n\n/** Homogeneous dimension of `node`, or `null` if it is not well-formed. */\nfunction dimensionOrNull(node: ExprNode): Dimension | null {\n const r = validate(node);\n return r.ok && r.inferredDimension !== null ? r.inferredDimension : null;\n}\n\n/**\n * Infer the dimension of `unknown` in `expr` such that `expr` has dimension\n * `targetDim`, or `null` when it is not uniquely determined.\n *\n * @public\n */\nexport function inferUnknownDimension(\n expr: ExprNode,\n unknown: string,\n targetDim: Dimension,\n): Dimension | null {\n const d0 = dimensionOrNull(substituteSymbolDim(expr, unknown, DIMENSIONLESS));\n const d1 = dimensionOrNull(substituteSymbolDim(expr, unknown, LENGTH));\n if (d0 === null || d1 === null) return null;\n\n // D1 / D0 must be a clean power of the probe (LENGTH): only the L exponent.\n const quotient = divide(d1, d0);\n const p = quotient.L;\n if (p === 0) return null; // the unknown does not affect the dimension\n for (const base of BASES) {\n if (base !== 'L' && quotient[base] !== 0) return null; // not a clean power\n }\n const result = power(divide(targetDim, d0), 1 / p);\n // Snap each exponent to its nearest integer within tolerance, then abstain if\n // any is GENUINELY fractional (e.g. x^2 = [length] ⟹ [length]^½ is not a real\n // physical dimension). The tolerance absorbs FP round-off that arrives in the\n // target from a v0.20 fractional-power computation, so a real integer answer\n // (L = 2 + ε) is not spuriously rejected — consistent with `equals` (bb15432).\n const snapped = { ...result };\n for (const base of BASES) {\n const rounded = Math.round(result[base]);\n if (Math.abs(result[base] - rounded) > EXPONENT_TOL) return null;\n snapped[base] = rounded;\n }\n return snapped;\n}\n"]}
1
+ {"version":3,"file":"dimension-inference.js","sourceRoot":"","sources":["../../src/dimensional/dimension-inference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAElE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAc,EAAE,IAAY,EAAE,GAAc;IAC9E,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,QAAQ;YACX,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACtD,KAAK,IAAI;YACP,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,mBAAmB,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;QACpF,KAAK,gBAAgB;YACnB,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,mBAAmB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;QACpE,KAAK,KAAK;YACR,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,mBAAmB,CAAC,IA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,8EAA8E;IAC9E,6EAA6E;IAC7E,+EAA+E;IAC/E,MAAM,OAAO,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;IAC9B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACzC,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,YAAY;YAAE,OAAO,IAAI,CAAC;QACjE,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;IAC1B,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["/**\n * Single-unknown dimensional inference.\n *\n * Given a parsed scalar `ExprNode` (e.g. the RHS of a user equation) in which\n * exactly one symbol's dimension is unknown, and the known dimension the whole\n * expression must equal (the target), recover the unknown's dimension from\n * dimensional homogeneity — or abstain (`null`) when it is not uniquely pinned\n * (the unknown is sum-constrained, absent, or appears non-cleanly).\n *\n * Method (no symbolic differentiation): probe the unknown with two dimensions\n * and read off its net power. With the unknown set to `DIMENSIONLESS` the\n * expression has dimension `D0`; set to `LENGTH` it has `D1`. The unknown enters\n * the dimension as a single power `p`, so `D1 / D0 = LENGTH^p`; if that quotient\n * is a clean power of the probe (only the `L` component nonzero), then from\n * `target = D0 · unknown^p` we get `unknown = (target / D0)^(1/p)`. Pure; reuses\n * the dimensional `algebra`.\n *\n * @module dimensional/dimension-inference\n */\n\nimport type { Dimension } from './types.js';\nimport { DIMENSIONLESS, LENGTH } from './types.js';\nimport { BASES, divide, power, EXPONENT_TOL } from './algebra.js';\nimport type { ExprNode } from './validator.js';\nimport { validate } from './validator.js';\n\n/**\n * Rebuild `node`, replacing the dimension of every `symbol` named `name` with\n * `dim`. Walks the scalar arms (`symbol`/`op`/`transcendental`/`abs`); other\n * arms are returned unchanged (they do not occur in parsed scalar expressions).\n *\n * @public\n */\nexport function substituteSymbolDim(node: ExprNode, name: string, dim: Dimension): ExprNode {\n switch (node.kind) {\n case 'symbol':\n return node.name === name ? { ...node, dim } : node;\n case 'op':\n return { ...node, args: node.args.map((a) => substituteSymbolDim(a, name, dim)) };\n case 'transcendental':\n return { ...node, arg: substituteSymbolDim(node.arg, name, dim) };\n case 'abs':\n return { ...node, arg: substituteSymbolDim(node.arg, name, dim) };\n default:\n return node;\n }\n}\n\n/** Homogeneous dimension of `node`, or `null` if it is not well-formed. */\nfunction dimensionOrNull(node: ExprNode): Dimension | null {\n const r = validate(node);\n return r.ok && r.inferredDimension !== null ? r.inferredDimension : null;\n}\n\n/**\n * Infer the dimension of `unknown` in `expr` such that `expr` has dimension\n * `targetDim`, or `null` when it is not uniquely determined.\n *\n * @public\n */\nexport function inferUnknownDimension(\n expr: ExprNode,\n unknown: string,\n targetDim: Dimension,\n): Dimension | null {\n const d0 = dimensionOrNull(substituteSymbolDim(expr, unknown, DIMENSIONLESS));\n const d1 = dimensionOrNull(substituteSymbolDim(expr, unknown, LENGTH));\n if (d0 === null || d1 === null) return null;\n\n // D1 / D0 must be a clean power of the probe (LENGTH): only the L exponent.\n const quotient = divide(d1, d0);\n const p = quotient.L;\n if (p === 0) return null; // the unknown does not affect the dimension\n for (const base of BASES) {\n if (base !== 'L' && quotient[base] !== 0) return null; // not a clean power\n }\n const result = power(divide(targetDim, d0), 1 / p);\n // Snap each exponent to its nearest integer within tolerance, then abstain if\n // any is GENUINELY fractional (e.g. x^2 = [length] ⟹ [length]^½ is not a real\n // physical dimension). The tolerance absorbs FP round-off that arrives in the\n // target from a v0.20 fractional-power computation, so a real integer answer\n // (L = 2 + ε) is not spuriously rejected — consistent with `equals` (bb15432).\n const snapped = { ...result };\n for (const base of BASES) {\n const rounded = Math.round(result[base]);\n if (Math.abs(result[base] - rounded) > EXPONENT_TOL) return null;\n snapped[base] = rounded;\n }\n return snapped;\n}\n"]}
@@ -153,7 +153,7 @@ export declare class PartialDerivativeIndexVarianceError extends UPTError {
153
153
  * a dimensional → numerical import cycle; re-exported from numerical/index.ts
154
154
  * for the public API surface per v0.4.0-Implementation-Plan Task 13.
155
155
  *
156
- * Uses `Object.setPrototypeOf` for correct `instanceof` after ES5 transpilation.
156
+ * A plain `class extends Error` under the ES2022 target: `instanceof` holds without a prototype reset.
157
157
  *
158
158
  * @public
159
159
  */
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/dimensional/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,4CAA4C;AAC5C,qBAAa,QAAS,SAAQ,KAAK;IACjC,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAKlE;CACF;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,QAAQ;IAClD,SAAgB,QAAQ,EAAE,SAAS,CAAC;IACpC,SAAgB,MAAM,EAAE,SAAS,CAAC;IAClC,YAAY,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAMlE;CACF;AAED;;;;;;;;;GASG;AACH,qBAAa,wBAAyB,SAAQ,QAAQ;IACpD,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,YAAY,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAU5C;CACF;AAED;;;;GAIG;AACH,qBAAa,wBAAyB,SAAQ,QAAQ;IACpD,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC;;;;OAIG;IACH,SAAgB,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAChD,YACE,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EA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