Skip to content

Games and learning

Quirk

Maintained by Strilanc

Quirk is one of the most approachable browser-based tools for building intuition about circuits, gates, and measurement through direct visual feedback.

JavaScriptApache-2.0v2.3.2Flagship
Quirk illustration

Resource snapshot

Category

Games and learning

Stars

1.1K

Last pushed

Jul 16, 2024Updated 2y ago

Open issues

53

What it is

Quirk is not where most production code begins, but it is where a lot of intuition can begin. Its real value is pedagogical speed: readers can see how gates compose and how measurement changes outcomes without first setting up a full local environment.

That makes it a strong bridge resource. It sits between playful learning and more serious SDK work, which is exactly the kind of handoff a learn section should support.

Who it's for

Beginners, educators, and developers who want fast visual intuition before they move into code-heavy frameworks.

What you can build or learn

  • Explore circuits visually in the browser.
  • Use the tool as a teaching bridge into full SDKs.
  • Build intuition around gates, composition, and measurement.

License

Apache-2.0

SPDX identifier detected from the repository metadata or license files.

Repository README

Preview from the project README.

Rendered as Markdown inside a scrollable preview. Long READMEs stay contained; expand or open on GitHub for the full document.

~313 words · about 1 min readOpen on GitHub

Quirk

Build Status

Quirk is a toy quantum circuit simulator, intended to help people in learning about quantum computing.

If you want to quickly explore the behavior of a small quantum circuit, Quirk is the tool for you. There's no installing or configuring or scripting: just go to algassert.com/quirk, drag gates onto the circuit, and the output displays will update in real time.

(If you're still trying to understand what a quantum circuit even is, then I recommend the video series Quantum Computing for the Determined. Quirk assumes you already know background facts like "each wire represents a qubit".)

Defining features:

  • Runs in web browsers.
  • Drag-and-drop circuit editing.
  • Reacts, simulates, and animates in real time.
  • Inline state displays.
  • Bookmarkable / linkable circuits.
  • Up to 16 qubits.

Notable limitations:

Try it out:

algassert.com/quirk

Examples

Basic usage demo:

Demo

Grover search circuit with chance and sample displays (showing that the chance of success increases):

Grover search

Quantum teleportation circuit with Bloch sphere displays (showing that the qubit at the top has ended up at the bottom):

Quantum teleportation

Building

If you want to modify Quirk, this is how you get the code and turn your changes into working html/javascript.

  1. Have git and Node.js installed.

    sudo add-apt-repository universe

    sudo apt-get update

    sudo apt-get install --yes git npm nodejs-legacy

  2. Clone the repository.

    git clone https://github.com/Strilanc/Quirk.git

  3. Install the dev dependencies.

    cd Quirk

    npm install

  4. (Optional) Make your changes. Run the tests.

    npm run test-firefox

  5. Build the output.

    npm run build

  6. Confirm the output works by opening out/quirk.html with a web browser.

    firefox out/quirk.html

  7. Copy out/quirk.html to wherever you want.

Disclaimer

Quirk is not an official Google product.

Read on GitHub

Activity

Latest release

—

Watchers

45

Python support

—

Learn digest

Get monthly updates when library entries change.

Monthly digest: new library entries, updated flagships, and one editorial pick.

Related resources

Keep exploring nearby tools.

quantumlib

Cirq

Python framework for creating, editing, and running Noisy Intermediate-Scale Quantum (NISQ) circuits.

PythonApache-2.0Flagship

4,971 stars · Updated 3mo ago

XanaduAI

pennylane

PennyLane is an open-source quantum software platform for quantum computing, quantum machine learning, and quantum chemistry.

PythonApache-2.0FlagshipQtangl relevant

3,229 stars · Updated 3mo ago

QISKit

qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.

PythonApache-2.0FlagshipQtangl relevant

7,412 stars · Updated 3mo ago

stared

quantum-game

Quantum Game (old version) - a puzzle game with real quantum mechanics in a browser

JavaScriptMITFlagshipArchive

359 stars · Updated 10mo ago

Microsoft

QuantumKatas

Tutorials and programming exercises for learning Q# and quantum computing

Jupyter NotebookMITFlagshipArchive

4,862 stars · Updated 2y ago