QuantumCircuitSimulator.jl

QuantumCircuitSimulator.jl loads quantum circuits from OpenQASM code and simulates them as tensor networks, using the ITensor library. Circuits are represented as sequences of layers of gates, which can then be turned into matrix product operators (MPOs) and applied to matrix product states (MPSs), enabling classical simulation of circuits that would otherwise be too large to represent as dense state vectors.

The package also provides tools to describe and apply a sparse Pauli-Lindblad noise model, and to inspect Pauli-string decompositions of matrix product states (useful, for example, when representing vectorized density matrices or observables).

Installation

From a registry

The package is not registered in the General registry, but in my TensorNetworkSimulations registry. Adding this registry first, with

using Pkg
Pkg.Registry.add("https://github.com/phaerrax/TensorNetworkSimulations.git")

(this must be done just once per Julia installation) then install the package as you would with a normal one:

using Pkg
Pkg.add("QuantumCircuitSimulator")

From GitHub

Alternatively, straight installation from GitHub is also possible:

using Pkg
Pkg.add("https://github.com/phaerrax/QuantumCircuitSimulator.jl")

Overview

Quick example

julia> using QuantumCircuitSimulator

julia> qasm = "OPENQASM 2.0; qreg q[2]; h q[0]; cx q[0], q[1];";

julia> circ = QuantumCircuit(qasm);

julia> mpos = layers_mpo(circ);

Bibliography

[1]
S. Filippov, M. Leahy, M. A. Rossi and G. García-Pérez. Scalable tensor-network error mitigation for near-term quantum computing (2023), arXiv:2307.11740 [quant-ph]. ↩1 ↩2 ↩3