Skip to content

HyperlinksSpace/setra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setra — Quantum Computing Playground

A browser-based quantum computing playground for building circuits, running quantum algorithms, and validating simulations with @nxrix/ketra — a JavaScript quantum computing framework inspired by Qiskit.

What is this? An interactive lab for quantum programming: entanglement, Grover search, VQE, QFT, OpenQASM, noise models, Shor factorization, and a full quantum API test suite — all running in your browser.

Live demo

After enabling GitHub Pages (see below), the quantum playground opens at:

https://<your-username>.github.io/<repo-name>/

What's included

Tab Description
Quantum demos 8 live quantum experiments — Bell entanglement, Grover search, VQE, QFT, OpenQASM, noisy simulation, Shor, Bloch sphere
Quantum test suite 367 assertions across 28 sections — full validation of the quantum computing stack

Quantum computing coverage

  • Quantum linear algebra — complex amplitudes, Pauli matrices, tensor products
  • Quantum circuits — gates, registers, parameterized rotations, multi-controlled ops
  • Quantum simulation — statevector & noisy QASM simulators with shot-based measurement
  • Quantum information — statevectors, density matrices, Clifford/stabilizer formalism, Schmidt decomposition
  • Quantum algorithms — VQE, QAOA, Grover, phase estimation, Shor, HHL
  • Quantum noise — depolarizing, bit/phase flip, amplitude damping, readout errors
  • Quantum transpiler — gate decomposition, Sabre routing, basis translation, DAG optimization
  • Quantum languages — OpenQASM 2 & 3 import/export
  • Quantum primitives — Estimator & Sampler (v1 and v2) for expectation values and sampling
  • Quantum visualization — circuit diagrams, ASCII histograms, Bloch sphere, state plots

Local development

Serve the repository root with any static file server:

# Using npx (Node.js)
npx serve .

# Or Python
python -m http.server 8080

Open http://localhost:8080. The playground loads the Ketra quantum SDK from jsDelivr CDN — no build step required.

GitHub Pages setup

The quantum playground lives at the repository root (index.html), so the site URL serves it directly.

Option A — GitHub Actions (recommended)

  1. Push this repository to GitHub.
  2. Go to Settings → Pages.
  3. Set Source to GitHub Actions.
  4. Push to main — the workflow in .github/workflows/pages.yml deploys automatically.

Option B — Branch deploy

  1. Go to Settings → Pages.
  2. Set Source to Deploy from a branch.
  3. Choose branch main and folder / (root).

Project structure

index.html              # Quantum playground UI (site entry point)
css/style.css           # Styles
js/
├── main.js             # App bootstrap & UI wiring
├── runner.js           # Test runner with pass/fail tracking
├── demos.js            # Quantum computing demo definitions
├── tests.js            # Full quantum test suite (adapted from ketra/test.js)
└── tests-source.js     # Original upstream test file (reference)
vendor/                 # Local copy of @nxrix/ketra npm package (optional)

Quantum programming quick start

Install the quantum SDK:

npm install @nxrix/ketra

Create and simulate a Bell state — the canonical entangled quantum circuit:

import { QuantumCircuit, simulate } from "@nxrix/ketra";

const qc = new QuantumCircuit(2, 2);
qc.h(0);              // superposition on qubit 0
qc.cx(0, 1);          // entangle qubits 0 and 1
qc.measure(0, 0);     // measure qubit → classical bit
qc.measure(1, 1);

const result = simulate(qc, 1024);   // 1024 measurement shots
console.log(result.get_counts().to_dict());  // { "00": ~512, "11": ~512 }
console.log(qc.draw());              // ASCII circuit diagram

Or load the quantum SDK in the browser:

<script type="module">
  import * as ketra from "https://cdn.jsdelivr.net/npm/@nxrix/ketra@1.2.2/+esm";
</script>

Links

License

MIT — same as the Ketra library.

About

Quntum computing playground

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors