npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

universal-physics-tensor

v0.44.2

Published

Computational framework for exploring unified physics through tensor formalism

Readme

Universal Physics Tensor Framework

Computational framework for exploring unified physics through tensor formalism

License: MIT CI Node.js Version TypeScript

Vision

Modern physics is fragmented across scales and domains: quantum mechanics governs the microscopic, general relativity explains the cosmic, and statistical mechanics bridges between them. Each regime has its own mathematics, assumptions, and approximations. What if we could represent all of physics in a single mathematical object?

The Universal Physics Tensor Framework (UPTF) proposes a rank-6 tensor Π living in a product space of:

  • Scale (quantum → mesoscopic → classical → cosmological)
  • Force (gravitational, electromagnetic, weak, strong, emergent)
  • Symmetry (Poincaré, gauge, conformal, supersymmetry ('susy' in code))
  • Information (von Neumann, Shannon, Kolmogorov, quantum discord)
  • Dimension (dimensional analysis constraints)
  • Topology (topological invariants)

This framework provides a computational laboratory for exploring:

  • Bridge equations connecting different physical regimes
  • Emergence of macroscopic laws from microscopic interactions
  • Information-geometry connections between computation and spacetime
  • Unification patterns across seemingly disparate phenomena

Important Context

I am not a physicist by trade. I'm a systems engineer specializing in Test Program Set development for defense avionics. This project applies engineering systems thinking to theoretical physics questions.

Think of this as:

  • A computational framework for exploring ideas
  • An engineering approach to organizing physical knowledge
  • A collaboration platform inviting physicists to validate/improve
  • NOT claiming to have "solved" or "unified" physics
  • NOT peer-reviewed theoretical physics (yet)

Physicists: Your expertise is welcomed and needed! Please contribute validation, corrections, and improvements.

Quick Start

# Clone the repository
git clone https://github.com/danielsimonjr/universal-physics-tensor.git
cd universal-physics-tensor

# Install dependencies
npm install

# Build the project
npm run build

# Run the smoke test
node test-example.js

# Bridge-inference CLI (no TypeScript needed) — `upt` subcommands:
npm run upt -- explain hawking-temperature mass=1.989e30   # explain a built-in quantity
npm run upt -- priority                                    # triage speculative bridges
npm run upt -- audit                                       # derive the bridges by dimensions
npm run upt -- predict                                     # empty regime cells as link hypotheses
npm run upt -- discover                                    # vet link candidates (merge/unlock/consistency)
npm run upt -- discover --source=canonical                 # run the funnel on standard physics ALONE (no bridges)
npm run upt -- discover --derive                           # surface machine-derived identity consequences (--max-orders / --anchor flags available)
npm run upt -- probe scan                                  # experimental expression/residual frontier (Product B; not `upt discover`)
npm run upt -- probe run --problem=tests/fixtures/discovery/pendulum-scaling/public/problem.json
npm run upt -- connectors                                  # which isolated bridges can connect to the core
npm run upt -- coverage                                    # audit each bridge's empirical grounding
npm run upt -- canonical                                   # the standard-physics L-layer registry (answer key)
npm run upt -- recover                                     # validate bridges against standard physics
npm run upt -- symbolic --simplify                         # compose + fold bridges' SYMBOLIC forms (MathTS simplify)
npm run upt -- confront                                    # run the catalog's committed real-data confrontations (predicted vs observed)
npm run upt -- map --source=both --format=mermaid          # VISUAL map of the graph (Mermaid; also --format=dot|svg, --proposed, --out=PATH)
npm run upt -- map --equation "period = 2*pi*sqrt(length/gravity)"   # drop YOUR OWN equation onto the map: dimensional check + where it lands
# ...and YOUR OWN equations:
npm run upt -- eval "hbar*c^3/(8*pi*G*M*k_B)" hbar=1.054571817e-34 c=299792458 G=6.6743e-11 M=1.989e30 k_B=1.380649e-23
npm run upt -- derive period:time length:length gravity:acceleration --formula "2*pi*sqrt(length/gravity)"
#   → period ∝ length^0.5·gravity^-0.5 ; formula dimension: [time] ✓ matches target ;
#     formula MATCHES, recovered prefactor ≈ 6.2832 (2π)
npm run upt -- help
# Once published, the same commands run via `npx universal-physics-tensor <cmd>`.
# (`npm run explain` and `npm run bridge-priority` remain as aliases.)

eval/derive --formula use the MathTS expression engine (@danielsimonjr/mathts-functions) when the optional peers are installed, and a built-in, dependency-free parser otherwise — transparently, via a FormulaParser registry (add --debug to see which is active). UPT keeps zero hard dependencies; the MathTS packages are optional.

See cli/README.md for the full CLI reference — every command and alias, the --source=catalog|canonical|both flag, input syntax, exit codes, and troubleshooting. docs/architecture/PHYSICS_MAP.md shows the rendered map (upt map --format=mermaid|dot|svg).

Installation

npm install universal-physics-tensor

Or install directly from GitHub:

# Clone and build locally
git clone https://github.com/danielsimonjr/universal-physics-tensor.git
cd universal-physics-tensor
npm install
npm run build
import { UniversalTensor } from 'universal-physics-tensor';
import type { PhysicalLaw, BridgeEquation } from 'universal-physics-tensor';

// Create a tensor instance
const tensor = new UniversalTensor({
  rank: 3, // Start simple
  scales: ['quantum', 'classical'],
  forces: ['electromagnetic', 'gravitational'],
});

// Register a known law (e.g., Schrödinger equation)
const schrodinger: PhysicalLaw = {
  id: 'schrodinger',
  name: 'Schrödinger Equation',
  equation: 'iℏ ∂ψ/∂t = Ĥψ',
  scales: ['quantum'],
  forces: ['electromagnetic'],
  symmetries: ['poincare'], // strictly Galilean for non-relativistic Schrödinger; 'poincare' used as placeholder (no 'galilean' in current Symmetry type)
  confidence: 1.0,
};
tensor.addLaw(schrodinger);

// Query laws applicable to the quantum regime
const quantumLaws = tensor.queryLaws({ scale: 'quantum' });
console.log(quantumLaws.map(l => l.name));

Note: Each catalogued bridge ships a computable evaluate*() function, and the BridgeEquations facade (v0.14) gathers them under readable method names — e.g. BridgeEquations.decoherenceRate({ gamma0_per_s, lambda, lambda0 }) (BE-11) or BridgeEquations.hawkingTemperature({ M_kg }) (BE-42). The formal spec (Parts I–III) defines the underlying physics and AST encodings; the facade is the convenience layer over those evaluators.

Core Concepts

The Universal Tensor

The tensor Π is decomposed (classified) into three components:

Π = L + B + E

Where:

  • L (Laws): Known physics on the diagonal (QM, GR, SM, etc.)
  • B (Bridges): Off-diagonal equations connecting regimes
  • E (Emergence): Higher-order correlations producing emergent phenomena

Note on notation: the "+" here denotes disjoint union of catalog entries (each tensor slot holds content of exactly one category), not algebraic addition. The type system enforces this disjointness via the Cell discriminated union in src/core/cell.ts; UniversalTensor.populatedCells() is the canonical way to enumerate the populated catalog as typed Cell values. See also Part I §1.2 for the spec-level treatment. Different slots may hold quantities of different physical dimensions (e.g., a Lagrangian density and a decoherence rate) and cannot be summed numerically.

Bridge Equations

Bridge equations connect different physical regimes:

Quantum ↔ Classical:

  • Decoherence Master Equation
  • Mesoscopic Coherence Length

Information ↔ Geometry:

  • Landauer-Wheeler Information-Geometry Equation
  • Holographic Quantum Error Correction

Microscopic ↔ Macroscopic:

  • Universal Emergence Equation
  • Complexity-Entropy Production Relation

Parts I–II of the formal specification document the original BE-11…54 corpus; later established additions BE-55…65 are captured in the live code/research record. The authoritative current catalog is the versioned, test-pinned JSON artifact at data/bridge-catalog.json, which currently spans BE-11…65. Part III covers algorithmic implementation.

Composing Bridges (v0.8.0)

Bridges are edges in a typed quantity graph, and compatible edges compose — with an exact dimensional check at the junction, validity domains carried through, and confidence demoted to the weakest link:

import { composeEdges, be42Edge, be16Edge, M_SUN_KG } from 'universal-physics-tensor';

// Hawking temperature (M → T_H) ∘ Landauer bound (T → E_min)
const erasureCost = composeEdges(be42Edge, be16Edge);
erasureCost.evaluate({ mass: M_SUN_KG }); // ≈ 5.9e-31 J — E_min(M) = ℏc³ln2/(8πGM)
erasureCost.confidence;                   // 'highly-speculative' (min of the operands)

That derived relation — the minimum erasure cost at a black-hole horizon — is the framework's first derived (rather than encoded) literature-anchored result, pre-registered before implementation and pinned to relErr ≤ 10⁻¹² (see Part IX and docs/planning/v0.8.0-Design.md). A computable membership criterion (a bridge's endpoint quantities must differ in regime) now adjudicates the catalog — 36 bridges · 5 not-a-bridge · 3 contested — with rejections recorded in a reviewable negative catalog (src/bridges/rejected.ts).

Since v0.12, composition is also symbolic (composeSymbolic): bridges may carry an optional symbolic ExprNode form, and composing two of them substitutes one AST into the other's junction, dimensionally validated and numerically evaluable — not just a chained numeric closure. The composed form can be folded by MathTS simplify (optional peer), so CT-1 reduces to ℏc³ln2/(8πGM) with k_B cancelled. See upt symbolic --simplify.

Documentation

Formal Specification

Complete theoretical foundation of the Universal Physics Tensor Framework — see the specification index for the full reader's map and the spec revision history for how the documents evolved.

Planning & Development

Architecture

Grounded in a real parse of the code. Every authored document ends with a ## Verification block, and repo_map.py check fails when a claim in one stops matching the source.

Regenerate the three generated reports with npm run docs:deps; do not edit them by hand. The docs-fresh CI job fails if what is committed differs from a fresh generation.

Code Documentation

Benchmarks

UPT ships benchmark infrastructure via Vitest bench:

npm run bench        # interactive run (median, p99, ops/sec)
npm run bench:ci     # verbose run for CI log capture

Baseline results are recorded in docs/architecture/benchmarks.md. These are correctness-first baselines, not optimization targets. Comparative analysis has since landed: v0.6.0's BR-2 christoffelFn flat-array refactor delivered a measured 5-6× RK4 geodesic-integrator speedup (see CHANGELOG).

Development Status

The repository package version is v0.44.1. Release chronology and historical metrics live in the CHANGELOG; the README intentionally avoids copying release-by-release counts that can drift.

The current machine-checked state is:

| Surface | Current state | |---|---| | Bridge catalog | 55 entries (BE-11…65): 19 established, 33 speculative, 3 highly speculative; the JSON artifact is freshness-tested against the TypeScript registry | | Empirical spine | 19 committed confrontations, exposed through upt confront with rigor/caveat metadata | | Composition layer | 41 bridge edges plus the canonical L-layer graph; dimensional, symbolic, discovery, consequence, and visualization tooling | | Canonical reference layer | 103 canonical equations used as the non-speculative answer-key layer for bridge recovery/linkage | | Architecture | Generated dependency graph reports 0 circular dependencies and a clean unused-analysis report; npm run docs:deps is CI freshness-gated | | Quality gates | Build, strict source+test TypeScript checks, full Vitest suite, active-plan audit, package-content smoke test, and nightly long-horizon GL4/Shapiro accuracy tests |

The project is engineering-complete for its stated goal: it is a computational laboratory and falsification/review instrument, not a claim that physics itself is complete or unified. New physics claims remain reviewable hypotheses and require external evidence/domain review before promotion.

Remaining frontier (not code-completion blockers)

Contributing

See CONTRIBUTING.md — it lists bounded, no-code-required physics-review tasks (catalog adjudications, encoding checks against the literature, quantity-identification reviews) plus the dev quick-start, and explains the JSON catalog review surface.

Contributions are welcome, especially from:

  • Physicists - Validate equations, suggest corrections, add physics insights
  • Mathematicians - Verify formalism, improve rigor, suggest optimizations
  • Engineers - Improve architecture, add features, optimize performance
  • Educators - Create examples, improve documentation, develop tutorials

Background & Philosophy

This project emerged from a simple question: "If I had to design a test program set for all of physics, how would I structure it?"

In Test Program Set (TPS) development for avionics, we create systems that:

  • Interface across multiple domains (hardware, software, physics)
  • Bridge different measurement scales (micro to macro)
  • Maintain consistency across transformations
  • Enable diagnostic troubleshooting

The same systems thinking applies to physics:

  • Known laws = verified test procedures (diagonal elements)
  • Bridge equations = interface adapters (off-diagonal elements)
  • Emergence = higher-order system behaviors (correlations)
  • Validation = experimental data matching (consistency checks)

This is an engineer's approach to theoretical physics — systematic, organized, and open to collaboration with domain experts.

License

MIT License - see LICENSE for details.

Author

Daniel Simon Jr.

  • Systems Engineer specializing in Test Program Set Development
  • Electrical Engineering, University of Texas at Dallas
  • Currently: Senior Test Engineer, Lockheed Martin
  • Interests: Integrating Philosophy, Science, and Technology

Connect:

Acknowledgments

This work builds on the shoulders of giants:

  • Tensor formalism from differential geometry
  • Bridge equations inspired by effective field theory
  • Information-theoretic insights from quantum information theory
  • Emergence concepts from condensed matter physics
  • Systems thinking from engineering practice

Disclaimer: This is an exploratory computational framework, not peer-reviewed physics research. All results should be validated against experimental data and theoretical physics literature. Collaboration with professional physicists is actively sought to improve accuracy and rigor.