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

quantum-computer-js

v2.1.0

Published

Interactive quantum computing simulator, fully-typed with math utilities, gates, and OpenQASM support.

Readme

Quantum Computer JS

An interactive quantum computing simulator library with fully typed TypeScript support.

Note: This is the core library engine powering the Quantum Computer Studio. For the full interactive web application, visit the Studio UI Repository or the Live Site.


Installation

Install via npm:

npm install quantum-computer-js

Features (v2.1.0)

  • Optimized Engine: Circuit transpiler with gate cancellation and rotation folding.
  • Realistic Simulation: Advanced Noise Models (Depolarizing, Phase Flip, Amplitude Damping).
  • Gate Decomposition: Decompose complex gates (SWAP, Toffoli) into hardware-native sets {CNOT, H, T, S}.
  • Advanced Metrics: State analysis tools including Fidelity, Partial Trace, and Von Neumann Entropy.
  • QNLP Support: Integrated Quantum Natural Language Processing primitives.
  • OpenQASM 2.0: Full support for importing and exporting OpenQASM strings.

Quick Start

The library exposes a complete web-worker powered quantum circuit simulator, gate logic, and math utilities.

import { runSimulation } from 'quantum-computer-js';

// 1. Define your circuit
const myCircuit = { 
  numQubits: 2, 
  gates: [
    { type: 'H', target: 0 }, 
    { type: 'CNOT', target: 1, control: 0 }
  ] 
};

// 2. Run the simulation
async function main() {
  const result = await runSimulation(myCircuit, { optimize: true });
  
  // 3. Output the results
  console.log('Probabilities:', result.probabilities);
}

main();

OpenQASM 2.0 Support

Integrate seamlessly with the academic quantum ecosystem (like IBM Qiskit) by importing and exporting OpenQASM string formats.

import { parseQASM, circuitToQASM } from 'quantum-computer-js';

const qasmString = `
OPENQASM 2.0;
include "qelib1.inc";
qreg q[2];
creg c[2];
h q[0];
cx q[0],q[1];
`;

const circuit = parseQASM(qasmString);
const exportedQasm = circuitToQASM(circuit);

Available Exports

  • Simulator: runSimulation(Circuit, SimulatorOptions), clearCache()
  • Transpiler: optimizeCircuit(Circuit), decomposeCircuit(Circuit)
  • Metrics: QuantumMetrics (Fidelity, Entropy, PartialTrace)
  • QNLP: QNLPService (Phrase parsing and sentiment analysis)
  • Math/Complex: C, add, sub, mul, scale, conj, norm2
  • Bloch Sphere: stateToBloch, toBlochPoint
  • OpenQASM: parseQASM, circuitToQASM

Links