Article view

How to write a simulator for quantum circuits from scratch: A tutorial

By Michael J. McGuffin, Jean–Marc Robert, Kazuki Ikeda

Article information

Publication
Published 3 August 2026
Institutions at publication
École de Technologie Supérieure; University of Massachusetts Boston
5 Citations OpenAlex, 4 December 2026 FULL LIST: Citations
Countries with citations No data yet
Usage Phase 3: not collected yet

Abstract

We guide a competent programmer through the programming of a quantum circuit simulator, supporting quantum logic gates with arbitrary control qubits on 20+ qubits, assuming no previous knowledge of quantum computing. We explain qubit-wise multiplication for updating the state vector; how to compute partial traces on arbitrary subsets of qubits to find reduced density matrices; and computing qubit phase and purity. A sample implementation in JavaScript is provided, which also demonstrates how to compute von Neumann entropy, concurrence (to quantify entanglement), and magic, with source code much smaller and easier to study than other popular software packages.

Citations per year

Citations per year
YearCitations
2026 5

OpenAlex counts citations by year for the last ten years only, so the total and the list of citing works can include earlier ones.

Works citing this article

OpenAlex counts 5 citations, but the citing work are not listed here yet: citing works are collected from OpenAlex a few at a time, and it lists most, not all, of the citations it counts.

Where its authors are based

Countries of the institutions the article's authors were affiliated to when it was published.

  • AUTHORS
  • CITATIONS No data yet
  • USAGE Phase 3
Authors by country
CountryAuthors
Canada2
United States1