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

@justinelliottcobb/amari-wasm

v0.23.0

Published

WebAssembly bindings for Amari mathematical computing library - geometric algebra, tropical algebra, automatic differentiation, measure theory, fusion systems, and information geometry

Readme

@justinelliottcobb/amari-wasm v0.22.0

Unified Mathematical Computing Library with High-Precision WebAssembly Support

npm version CI License: MIT

Amari is a comprehensive mathematical computing library that brings advanced algebraic systems to JavaScript/TypeScript through WebAssembly. Features high-precision arithmetic for spacecraft orbital mechanics and relativistic physics calculations with pure Rust implementation and no native dependencies for universal deployment.

Features

| Module | Crate | Since | Description | |--------|-------|-------|-------------| | Geometric Algebra | amari-core | v0.1 | Multivectors, rotors, geometric products for 3D rotations and spatial transformations | | Tropical Algebra | amari-tropical | v0.9.3 | Max-plus semiring operations plus 0.21.0 ordinal-weighted optimization carriers below ε₀ | | Automatic Differentiation | amari-dual | v0.9.3 | Forward-mode AD with 0.21.0 branch policies, multi-dual seeding, and fixed-size gradient wrappers | | Combinatorial Game Theory | amari-cgt | v0.22.0 | Short normal-play games, cuts, outcomes, comparison, nimbers, and inspection helpers | | Short Surreal Numbers | amari-surreal | v0.22.0 | Exact dyadic short-surreal arithmetic and conversion to/from numeric CGT games | | Cellular Automata | amari-automata | v0.9.4 | Geometric cellular automata with multivector states | | Holographic Memory | amari-fusion | v0.12.3 | Vector Symbolic Architecture for associative memory with binding and bundling | | Measure Theory | amari-measure | v0.10.0 | Lebesgue integration, probability measures, and measure-theoretic foundations | | Probability | amari-probabilistic | v0.13.0 | Distributions on multivector spaces, MCMC sampling, Monte Carlo estimation | | Functional Analysis | amari-functional | v0.15.0 | Hilbert spaces, linear operators, spectral decomposition, Sobolev spaces | | Optical Fields | amari-holographic | v0.15.1 | GA-native Lee hologram encoding for DMD displays and VSA-based optical processing | | Computational Topology | amari-topology | v0.16.0 | Simplicial complexes, homology, persistent homology, Morse theory | | Dynamical Systems | amari-calculus | v0.19.1 | ODE solvers, stability analysis, bifurcation diagrams, Lyapunov exponents | | Enumerative Geometry | amari-enumerative | v0.19.1 | WDVV curve counting, matroids, CSM classes, stability conditions | | Probabilistic Contracts | amari-flynn | v0.19.1 | SMT-LIB2 proof obligations, Monte Carlo verification, rare event tracking | | GF(2) Algebra | amari-core, amari-enumerative | v0.19.1 | GF(2) linear algebra, binary Clifford algebra, coding theory, matroid representability, Kazhdan-Lusztig polynomials | | Orbital Mechanics | amari-relativistic | v0.9.4 | Spacetime algebra (Cl(1,3)) with high-precision trajectory calculations |

Also includes bindings for: amari-network (geometric network analysis), amari-optimization (gradient descent, NSGA-II), amari-info-geom (Fisher metrics, statistical manifolds), amari-calculus (differential geometry, manifolds).

v0.23.0 Arbitrary-Signature GA (new in development)

The 0.23.0 release introduces generic runtime-signature multivector support:

  • WasmGenericMultivector(p, q, r) — create and operate on multivectors of any Clifford algebra signature Cl(p, q, r) at runtime. Signature is chosen at construction time and all operations (geometric product, inner product, outer product, reverse, grade projection, exp, normalize, inverse) automatically use the correct metric.
  • WasmGenericRotor — rotors for any signature, created from bivectors via the exponential map.
  • Match-table dispatch for all 84 signatures with total dimension ≤ 6 (compile-time optimized).
  • Cayley-table fallback for larger dimensions with thread-local caching.

8 fast-path aliases provide pre-configured wrappers for the most common signatures:

| Alias | Signature | Use case | |-------|-----------|----------| | WasmMultivector300 / GA | Cl(3,0,0) | 3D Euclidean rotations, graphics | | WasmMultivector210 / ST | Cl(2,1,0) | 2+1 spacetime physics | | WasmMultivector310 / MINK | Cl(3,1,0) | 3+1 Minkowski relativity | | WasmMultivector200 / PL | Cl(2,0,0) | 2D planar / complex numbers | | WasmMultivector030 / QUAT | Cl(0,3,0) | Pure quaternion algebra | | WasmMultivector410 / CGA | Cl(4,1,0) | Conformal GA (translations as rotors) | | WasmMultivector500 / P5D | Cl(5,0,0) | 5D Euclidean / projective GA | | WasmMultivector110 / S2D | Cl(1,1,0) | Split-complex / 1+1 spacetime |

Backward compatibility: WasmMultivector and WasmRotor remain as aliases for WasmMultivector300 and WasmRotor300.

v0.22.0 CGT / Surreal WASM Surface

The 0.22.0 release exposes the new short-game and short-surreal Rust APIs to JavaScript/TypeScript:

  • WasmCgtArena and WasmGameId for arena-backed short games, focused one-option cuts, addition/subtraction/negation, comparison, outcomes, canonicalization, and formatting.
  • WasmGameInspection for birthday, canonical form, outcome, numeric/impartial classification, and reachable-node counts.
  • WasmDyadic for exact dyadic arithmetic with checked division inside the short-surreal layer.
  • WasmShortSurreal for exact short-surreal arithmetic plus conversion from numeric CGT games and reconstruction back into a WasmCgtArena.

The scope remains intentionally short/exact: loopy games, misère play, symbolic infinite surreals, and surcomplex arithmetic are not part of the 0.22.0 WASM surface.

v0.21.0 Tropical / Dual WASM Surface

The 0.21.0 release exposes the new optimization-oriented Rust APIs to JavaScript/TypeScript:

  • TropicalBatch.foldOplus(...) and TropicalBatch.foldOtimes(...) for semiring folds.
  • WasmOrdinalArena, WasmOrdinal, and WasmOrdinalWeight for bounded ordinals below ε₀, ordinal formatting/inspection, and ordinal-weight oplus / otimes helpers.
  • WasmBranchPolicy plus maxByPolicy(...) / minByPolicy(...) on dual and multi-dual numbers for explicit tie behavior.
  • WasmMultiDualNumber.variables(...) for basis-seeded gradient setup.
  • WasmStaticMultiDual2, WasmStaticMultiDual3, and WasmStaticMultiDual4 for small fixed-size forward-mode AD loops in browser-facing workloads.

High-Precision Arithmetic

  • Pure Rust Backend: dashu-powered arithmetic with no native dependencies
  • Universal Deployment: Same precision guarantees across desktop, web, and edge environments
  • Orbital-Grade Tolerance: Configurable precision for critical trajectory calculations

Installation

npm install @justinelliottcobb/amari-wasm

Or with yarn:

yarn add @justinelliottcobb/amari-wasm

Quick Start

import init, {
  WasmGenericMultivector,
  WasmGenericRotor,
  WasmMultivector,   // alias for WasmMultivector300 (Cl 3,0,0)
  WasmRotor,
} from '@justinelliottcobb/amari-wasm';

async function main() {
  await init();

  // ── Generic API: any signature at runtime ──

  // Cl(2,1,0) — 2+1 spacetime
  const e1 = WasmGenericMultivector.basisVector(2, 1, 0, 0);
  const e3 = WasmGenericMultivector.basisVector(2, 1, 0, 2);

  // e3 squares to -1 in Cl(2,1,0) (negative metric signature)
  const e3Sq = e3.geometric_product(e3);
  console.log(e3Sq.getCoefficient(0)); // -1

  // ── Fast-path alias: Cl(3,0,0) Euclidean ──

  const a = WasmMultivector.basisVector(0);  // e1
  const b = WasmMultivector.basisVector(1);  // e2
  const product = a.geometric_product(b);
  console.log(product.getCoefficients()); // [0, 0, 0, 1, 0, 0, 0, 0] = e12

  // ── Rotor in Cl(3,0,0) ──

  const bivector = a.outer_product(b); // e12 bivector plane
  const rotor = WasmGenericRotor.fromBivector(bivector, Math.PI / 2);
  const rotated = rotor.apply(a);
  // 90° rotation in e12 plane: e1 → e2
  console.log(Math.abs(rotated.getCoefficient(2))); // ≈ 1.0
}

main();

Fast-path aliases: WasmMultivector300, WasmMultivector210 (ST), WasmMultivector310 (Minkowski), WasmMultivector200 (planar), WasmMultivector030 (quaternion), WasmMultivector410 (CGA), WasmMultivector500 (5D), WasmMultivector110 (split). Each has a matching WasmRotor* and a TypeScript convenience export (GA, ST, MINK, PL, QUAT, CGA, P5D, S2D).

See the docs/ directory for detailed guides and API references for each module.

Use Cases

  • Computer Graphics: 3D rotations and transformations using rotors
  • Physics Simulations: Geometric algebra for electromagnetic fields and relativistic calculations
  • Machine Learning: Tropical neural networks and automatic differentiation
  • Optimization: Tropical algebra for shortest path and scheduling problems
  • Scientific Computing: High-performance mathematical operations with orbital-grade precision
  • Probability & Statistics: Measure theory, numerical integration, and probabilistic modeling
  • Formal Verification: SMT-LIB2 proof obligation generation for browser-based verification workflows
  • Symbolic AI: Holographic memory for associative reasoning and concept binding
  • Holographic Displays: Lee hologram encoding for DMD and SLM devices
  • Topological Data Analysis: Persistent homology for shape and feature detection
  • Chaos Theory: Lorenz attractors, bifurcation diagrams, Lyapunov exponents
  • Algebraic Geometry: Rational curve counting, Schubert calculus, Gromov-Witten invariants
  • Error-Correcting Codes: Binary linear codes (Hamming, Reed-Muller, Golay) for communication systems
  • Finite Field Combinatorics: Grassmannian point counting, matroid representability, Kazhdan-Lusztig polynomials
  • Spacecraft Trajectory Planning: High-precision orbital mechanics in web applications

Building from Source

# Clone the repository
git clone https://github.com/justinelliottcobb/Amari.git
cd Amari/amari-wasm

# Install dependencies
npm install

# Build WASM module
npm run build

# Run tests
npm test

Contributing

Contributions are welcome. Please see CONTRIBUTING.md for details.

License

MIT License - see LICENSE for details.

Acknowledgments

  • Built with Rust and wasm-bindgen
  • Inspired by geometric algebra libraries like GAViewer and Ganja.js
  • Tropical algebra concepts from discrete mathematics

Contact


Made with Rust by the Amari team