js-quantum is an open-source quantum circuit simulation and transpilation library implemented entirely in TypeScript with zero external dependencies for its core mathematical and simulation engine. Key Features Zero external dependencies: All complex arithmetic, matrix operations, gate definitions, state-vector simulation, transpilation, and serialization are implemented from first principles. 70+ quantum gates: Comprehensive gate library including single-qubit (H, X, Y, Z, S, T, Rx, Ry, Rz, U, etc. ), two-qubit (CNOT, CY, CZ, SWAP, iSWAP, ECR, etc. ), three-qubit (Toffoli, Fredkin, CCZ), and multi-controlled gates. State-vector simulator: Exact simulation via subspace iteration — gates are applied in O (2ⁿ) time without constructing full unitary matrices. Supports up to 30 qubits. Symbolic parametric circuits: Expression-tree-based parameter system for variational algorithms. Classical control flow: Mid-circuit measurement with if, for, while, and switch constructs conditioned on classical register values. Multi-stage transpilation pipeline: Gate decomposition, SABRE-based qubit layout, SWAP-insertion routing, and gate optimization (cancellation, rotation merging, identity elimination). Full OpenQASM 3 support: Bidirectional serialization/deserialization for cross-framework interoperability. Cloud backend integration: Execute circuits on IBM Quantum and qBraid platforms. Browser compatible: Runs natively in web browsers, Node. js, and Deno — no compiled backends required. Immutable pure gate constructor functions Circuit Builder — QuantumCircuit class with 80+ chainable methods, symbolic parameters, and classical control flow Backends multi-stage transpiler; OpenQASM 3 serializer High-Level API — Experimental problem-oriented abstraction (Problem, Space, Artifact, Process entities) Development Methodology js-quantum was developed using a specification-driven multi-agent methodology, guided by a comprehensive AGENTS. md specification (~3, 500 lines) that serves as both architectural blueprint and machine-actionable instruction set for an AI coding agent (Claude Opus 4. 6). The specification enforces immutability, zero dependencies, strict type safety, little-endian qubit ordering, and mandates 617+ tests (475 unit + 142 integration) covering quantum algorithms (Bell states, GHZ states, teleportation, Deutsch–Jozsa, Bernstein–Vazirani, Grover's search, QFT), transpilation verification, and round-trip OpenQASM 3 serialization. License MIT Links JSR: https: //jsr. io/@hviana/js-quantum AGENTS. md specification: https: //github. com/hviana/agents. md-for-quantum-simulation
HENRIQUE EMANOEL VIANA (Sat,) studied this question.