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.5.0

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 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

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: This example uses only the APIs currently implemented. Computable bridge equation solvers (e.g., a BridgeEquations class with decoherence(...) methods) are specified in Parts I–III but not yet implemented — see Development Status.

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. Different slots may hold quantities of different physical dimensions (e.g., a Lagrangian density and a decoherence rate) and cannot be summed numerically. See Part I §1.2 for the formal treatment.

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

See Part I and Part II of the formal specification for the complete bridge equation catalog (Bridge Equations 11–50). Part III covers algorithmic implementation.

Documentation

Formal Specification (6-Part Series)

Complete theoretical foundation of the Universal Physics Tensor Framework:

Planning & Development

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

v0.4.5 baseline results are recorded in docs/architecture/benchmarks.md. These are correctness-first baselines, not optimization targets — no threshold gates in v0.4.5. Thresholds and comparative analysis are v0.5.0 scope.

Development Status

Current Version: v0.4.5 (released 2026-05-17). Refactor + benchmark scaffold release. Dead-code removal (4 deprecated/unused exports), Float64Tensor visibility cleanup, flattenNA JSDoc fix, bridge-test helper consolidation across 39 files (+84 LOC net), and bench/ infrastructure with AD + BE-37 eikonal + Schwarzschild geodesic baseline benchmarks. No new features, no bridge work, no breaking changes. See CHANGELOG for full details.

v0.4.5 — refactor + benchmark baselines (2026-05-17)

| Metric | Value | |---|---| | Bridge catalog | 42 / 42 (IDs 11-52, unchanged from v0.4.0) | | Test suite | passing (see npm test) | | tsc --noEmit | clean | | Benchmark suites | 4 (sanity, AD, BE-37 eikonal, Schwarzschild geodesic) | | Breaking changes | none |

Honest framing: This is a pure refactor + benchmark scaffold release. LOC delta across the bridge-test migration is +84 net (helper file +81 LOC; migration across 39 files is +3 LOC net). Benchmarks establish correctness-first baselines for v0.5.0+ comparison — not optimization wins.

Deferred to v0.5.0: Faraday-cascade BREAKING changes, symplectic geodesic integrator + bisection perihelion finder, benchmark threshold gates, Three.js viz.

v0.4.0 — connection layer + AD + 2 new bridges (2026-05-15)

| Metric | Value | |---|---| | Bridge catalog | 42 / 42 (IDs 11-52) | | Test suite | passing (see npm test) | | tsc --noEmit | clean | | New public-surface entries | 11 (christoffel, CovariantDerivativeNode, integrateGeodesic, evaluateGravitationalLensing, evaluatePerihelionPrecession, evaluateBE37CovariantEikonalNumerical, hasAutogradSupport, EngineCapabilityError, DuplicateCoordinateWarning, ForwardGradResult, ReverseGradResult) | | AD engines | Float64ReferenceEngine + MathTSEngine (both pass identical conformance suite) | | Default engine | MathTSEngine when optional deps installed; degrades to Float64ReferenceEngine with console.warn |

Honest framing: Both engines run the same naive O(n) algorithms in v0.4.0; the MathTSEngine-default flip is a dep-shape + code-path-signal change, not a performance win. MathTSEngine becomes default because that is where the AD capability lives.

Deferred to v0.5.0: Faraday-cascade BREAKING changes, symplectic geodesic integrator + bisection perihelion finder (needed for RK4-cross-validation of Mercury's Δφ ≈ 5.02e-7 rad/orbit), Three.js viz.

✅ Numerical backend (v0.3.5, 2026-05-14)

Numerical-contraction backend: TensorEngine interface + Float64ReferenceEngine (zero-dep, default) + MathTSEngine (backed by @danielsimonjr/mathts-tensor). AST→engine lowering, two-way numerical partial derivatives, InverseMetricInconsistencyWarning, BE-37 Shapiro-delay eikonal end-to-end to ±1e-9 relative error.

✅ Catalog closed at 40/40 (v0.1.0, 2026-05-12)

First tagged release; transitions the project out of pre-formalization to a stable scaffold. SemVer applies from this release onward.

✅ Catalog closed at 40/40 (master b358257, 2026-05-11)

The Tier-5 AST encoding rollout reached full coverage with the Wave Z arc (commits 9cb299f through b358257). Every bridge in src/bridges/index.ts has a non-null dimensional_signature, an AST module in src/bridges/equations/, a numerical evaluator with input-validation guards, and per-bridge encoding tests.

Final invariants:

| Metric | Value | |---|---| | AST encodings | 40 / 40 | | dimensional_signature === null count | 0 | | status === 'invalid' count | 0 | | tractability_class === 'undefined' count | 0 | | Test suite | 1161 / 1161 passing across 68 files | | Status distribution | 6 established · 31 speculative · 3 highly-speculative · 0 invalid |

Catalog: 40 bridge equations indexed in src/bridges/index.ts, each with structured KnownIssue records (severity / description / fixable), references, dependencies, and disposition status. Spec ↔ index drift guard: tests/bridges/spec-vs-index.test.ts asserts every audit-marker in the spec markdown has a matching entry.

Dimensional analyzer (src/dimensional/): operator-blind scalar AST with primitives symbol | op (* / + - ^) | integral | derivative. 22 named SI dimensions with round-trip format(). Validator hardening: ^ arity guard, switch-exhaustiveness never arm, integral / derivative shape guards, informative violation diagnostics. inferDimensionForBridge consults EXPECTED_DIMENSION_BY_BRIDGE for cross-checking; the lookup table now has 40 entries (one per encoded bridge).

Encoding patterns established during the rollout: typed-stubs for transcendentals and operator-valued interiors (log/exp/tensor contractions absorbed into single dimensioned symbols); squared-form to avoid fractional exponents (S², L²=Γt, Q_soft²); ensemble-average stubs (Jarzynski ⟨exp(-βW)⟩); observational-bound dimensionless ratios (GW170817 |c_GW-c|/c); integral primitive for boundary integrals (BE-26 WKB, BE-44 soft-hair L²-norm); and bridge reformulation — replacing broken or contested formulations with canonical literature forms while preserving the bridge label (precedent: BE-25 Penrose-Hameroff → IIT Φ_max; Wave Z applied this to BE-16 → Landauer, BE-37 → Shapiro delay, BE-28 → Onsager σ).

Catalog round-trip invariant: every entry's encoded RHS validates back to its registered dimensional_signature via tests/bridges/dimensional-signature-catalog.test.ts. All 40 entries are signature-populated and round-trip-verified.

Cross-LLM validation: the three highest-stakes Wave-Z reformulations (BE-16 Landauer, BE-37 Shapiro, BE-28 Onsager — all promoted from status='invalid') were independently cross-validated by both OpenAI o3 and Gemini Pro. Both reasoners agreed on the verdict for all three. The BE-28 Onsager relabeling carries a prominent ⚠ CRITICAL WARNING in its module docstring: the encoded σ = Σᵢ Jᵢ Xᵢ is the definiendum of MEPP, not the variational maximization principle itself.

Test suite: 1161 tests across 68 files, including property-style sweeps, limit identities, honest-archaeology disposition pins, and catalog-wide round-trip invariants. npm test runs the full suite in ~15 s on a modern dev box; typecheck is clean.

Planning artifacts in docs/planning/: Tier-5 encoding triage memo (refreshed 2026-05-11 with Wave Z closure record), BE-37 VSL disposition brief, dimensionless-stub convention doc, Bridge Remediation Plan (R0-R5 audit chain), v0.1.0 release procedure.

Planned (post-closure)

  • v0.1.0 release — trigger condition met; cut is a discretionary release decision documented in v0.1.0-Release-Procedure.md.
  • Grammar extensions for genuinely-deferred primitives: Dirac-δ correlators (would enable a fuller BE-15 Hohenberg-Halperin Model A Langevin encoding), variational-δ operator (would enable a faithful MEPP encoding for BE-28 that captures the maximization claim). Neither is currently planned — both are scope expansions beyond the scalar-AST design.
  • Wider rank-6 tensor with numerical operations — the catalog-encoding work has been the priority; tensor operators are the next conceptual layer.
  • Three.js / game-engine class visualization in a separate repo (out of UPT scope per project decision; see docs/planning/Future-Production-Hardening.md).
  • Experimental data validation pipelines — applicable now that catalog encoding is complete.
  • Collaboration with physics researchers — the open question is recruiting them (see Contributing section).

Contributing

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.