QASMBench is moved to PNNL-QAMSBench.

June 10, 2021 · View on GitHub

An OpenQASM benchmark suite for NISQ evaluation. The .qasm code can be directly loaded in IBM Quantum Experience for execution. Please see our paper (attached and arXiv) for details.

alt text

Current version

Latest version: 1.2

About QASMBench

In this repository you will find a light-weighted benchmark suite based on IBM OpenQASM language (see spec). It collects commonly seen quantum algorithms and routines from various domains including chemistry, simulation, linear algebra, searching, optimization, arithmetic, machine learning, fault tolerance, cryptography, etc. QASMBench trades-off between generality and usability, covering the number of qubits ranging from 2 to 60K, and the circuit depth from 4 to 12M. We set most of the benchmarks with qubits less than 16 so they can be directly verified on IBM's public-available quantum machine -- IBM Quantum Experience. You may also want to use our Density-Matrix quantum simulator (DM-Sim) that can efficiently run on CPU and GPU-clusters.

OpenQASM

OpenQASM (Open Quantum Assembly Language) is a low-level quantum intermediate representation (IR) for quantum instructions, similar to the traditional Hardware-Description-Language (HDL) like Verilog and VHDL. OpenQASM is the open-source unified low-level assembly language for IBM quantum machines publically available on cloud that have been investigated and verified by many existing research works. Several popular quantum software frameworks use OpenQASM as one of their output-formats, including Qiskit, Cirq, Scaffold, ProjectQ, etc.

Qiskit

The Quantum Information Software Kit (Qiskit) is a quantum software developed by IBM. It is based on Python. OpenQASM can be generated from Qiskit via:

QuantumCircuit.qasm()

Cirq

Cirq is a quantum software framework from Google. OpenQASM can be generated from Cirq (not fully compatible) via:

cirq.Circuit.to_qasm()

Scaffold

Scaffold is a quantum programming language embedded in the C/C++ programming language based on the LLVM compiler toolchain. A Scaffold program can be compiled by Scaffcc to OpenQASM via "-b" compiler option.

ProjectQ

ProjectQ is a quantum software platform developed by Steiger et al. from ETH Zurich. The official website is here. ProjectQ can generate OpenQASM when using IBM quantum machines as the backends:

IBMBackend.get_qasm()

QASMBench Benchmarks

Depending on the number of qubits used, QASMBench includes three categories. For the introduction of the benchmarking routines under each category, please see our paper for detail. For each benchmark in the following tables, we list its name, brief description, and the algorithm category it belongs to, which is based on this Nature paper by adding the categories of quantum arithmetic, quantum machine learning and quantum communication.

The 'Gates' here refers to the number of Standard OpenQASM gates (see our paper) but excluding those gates in a branching if statement. It is known that physical qubits in an NISQ device follow a certain topology. Since the 2-qubit gates such as CNOT or CX can only be performed between two adjacent physical qubits, a series of SWAP operations can be required to move the relevant qubits until they become directly-connected. This is an important issue in machine-specific mapping and optimization, implying a significant potential overhead. Consequently, we also list the number of CNOT gates in the tables.

Small-scale

Qunatum circuits using 2 to 5 qubits.

BenchmarkDescriptionAlgorithmQubitsGatesCNOTReference
wstateW-state preparation and assessmentLogical Operation3309OpenQASM
adderQuantum ripple-carry adderQuantum Arithmetic42310Scaffold
basis_changeTransform the single-particle baseis of an linearly connected electronic structureQuantum Simulation35310OpenFermion
basis_trotterImplement Trotter steps for molecule LiH at equilibrium geometryQuantum Simulation41626582OpenFermion
cat_stateCoherent superposition of two coherent states with opposite phaseLogical Operation443Scaffold
deutschDeutsch algorithm with 2 qubits for f(x) = xHidden Subgroup251OpenQASM
error_correctiond3Error correction with distance 3 and 5 qubitsError Correction511449Ref
fredkinControlled-swap gateLogical Operation3198Scaffold
groverGrover’s algorithmSearch and Optimization2162AgentANAKIN
hs4Hidden subgroup problemHidden Subgroup4284Scaffold
inverseqftPerforms an exact inversion of quantum Fourier tranformHidden Subgroup480OpenQASM
ipeaIterative phase estimation algorithmHidden Subgroup26830OpenQASM
iswapAn entangling swapping gateLogical Operation292OpenQASM
linearsolverSolver for a linear equation of one qubitLinear Equation3194Ref
lpnLearning parity with noiseMachine Learning5112sampaio96
peaPhase estimation algorithmHidden Subgroup59842OpenQASM
qec_smRepetition code syndrome measurementError Correction554OpenQASM
qftQuantum Fourier transformHidden Subgroupe43612OpenQASM
qec_enQuantum repetition code encoderError Correction52510sampaio96
teleportationQuantum teleportationQuantum Communication382Ref
toffoliToffoli gateLogical Operation3186Scaffold
variationalVariational ansatz for a Jellium Hamiltonian with a linear-swap networkQuantum Simulation45416OpenFermion
vqe_uccsdVariational quantum eigensolver with UCCSDLinear Equation422088Scaffold
shorShor’s algorithmHidden Subgroup56430Qiskit
bellCircuit equivalent to Bell inequality testLogic Operation4337Cirq
qrngQuantum random number generatorQuantum Arithmetic440Paper, Repo
qaoaQuantum approximate optimization algorithmSearch and Optimization3156Repo
quantumwalksQuantum walks on graphs with up to 4 nodesQuantum Walk2113Repo
dnn3 layer quantum neural network sampleMachine Learning222642Ref

Medium-scale

Quantum circutis using 6 to 15 qubits.

BenchmarkDescriptionAlgorithmQubitsGatesCNOTReference
adderQuantum ripple-carry adderQuantum Arithmetic1014265OpenQASM
bvBernstein-Vazirani algorithmHidden Subgroup144113OpenQASM
ccCounterfeit coin finding problemSearch and Optimization122211OpenQASM
isingIsing model simulation via QCQuantum Simulation1048090Scaffold
multiplyPerforming 3×5 in a quantum circuitQuantum Arithmetic139840AgentANAKIN
qf21Using quantum phase estimation to factor the number 21Hidden Subgroup15311115AgentANAKIN
qftQuantum Fourier transformHidden Subgroup15540210OpenQASM
qpeQuantum phase estimation algorithmHidden Subgroup912343AgentANAKIN
satBoolean satisfiability problemSearch and Optimization11679252OpenQASM
secaShor's error correction algorithm for teleportationError Correction1121684AgentANAKIN
simonsSimon’s algorithmHidden Subgroup64414AgentANAKIN
vqe_uccsdVariational quantum eigensolver with UCCSDLinear Equation622821052Scaffold
vqe_uccsdVariational quantum eigensolver with UCCSDLinear Equation8108085488Scaffold
qaoaQuantum approximate optimization algorithmSearch and Optimization627054Cirq
bb84A quantum key distribution circuitQuantum Communication8270Cirq
multiplierQuantum multiplierQuantum Arithmetic15574246Cirq
dnn16-dimension quantum neural network sampleMachine Learning81008192Ref

Large-scale

Quantum circuits using more than 15 qubits.

BenchmarkDescriptionAlgorithmQubitsGatesCNOTReference
dnnquantum neural network sampleMachine Learning162016384Ref
bigadderQuantum ripple-carry adderQuantum Arithmetic18284130OpenQASM
ccCounterfeit coin finding problem via QCHidden Subgroup183417OpenQASM
bvBernstein-Vazirani algorithmHidden Subgroup195618OpenQASM
qftQuantum Fourier tranformHidden Subgroup20970380OpenQASM
bwtBinary Welded Tree: a quantum walk algorithm in continuous time domainQuantum Walk21462001174800QASMBench
cat_stateCoherent superposition of two coherent states with opposite phaseLogical Operation222221QASMBench
ghz_stateGreenberger-Horne-Zeilinger (GHZ) state for max entanglementLogical Operation232322QASMBench
isingIsing model simulation via QCQuantum Simulation2628050QASMBench
multiplierQuantum multiplierQuantum Arithmetic251743750Cirq
square_rootComputing the square root of an number via amplitude amplificationQuantum Arithmetic182300898Scaffold
swap_testSwap test to measure quantum state distanceMachine Learning2523096QASMBench
vqeVariational quantum eigensolver with UCCSDQuantum Simulation2423060721538240QASMBench
isingIsing model simulation via QCQuantum Simulation5005494998Scaffold
isingIsing model simulation via QCQuantum Simulation1000109941998Scaffold
class_numberCompute the class group of a real quadratic number fieldHidden Subgroups600523111050412460637Scaffold

qelib1.inc

OpenQASM header file that defines all the gates. Please see OpenQASM and our paper for details.

QASMBenchmark Suite Structure

Each benchmark folder include the following file:

  • bench.qasm: OpenQASM source file.
  • bench.png: Visualization of the circuit from IBM QE.
  • res_bench.png: Running results from IBM QE quantum backends (mainly 5-qubit Burlington, 15-qubit Melbourne, and 27-qubit Paris).
  • bench.cuh: Source file for our DM-Sim quantum simulator.

Tests

The small-scale benchmarks (except basis-trotter) can be directly uploaded and verified on real Quantum Machines IBM Quantum Experience.

The medium-scale benchmarks can be either validated by real quantum machines or simulators in IBM Quantum Experience.

Some of the large-scale benchmarks can be validated on IBM simulators.

DM-Sim simulation

You may also want to use our density-matrix quantum circuit simulator DM-Sim for simulating the QASMBench benchmark circuits efficiently on modern CPU (Intel X86, AMD X86, IBM Power), GPU (NVIDIA GPU and AMD GPU) and Xeon-Phi workstations or clusters ORNL Summit, ANL Theta, and NERSC Cori Supercomputers.

Authors

Ang Li, Pacific Northwest National Laboratory (PNNL)

Sriram Krishnamoorthy, Pacific Northwest National Laboratory (PNNL)

And also the original authors that developed these quantum routines.

Citation format

For research articles, please cite our paper:

  • Ang Li, Sriram Krishnamoorthy, "QASMBench: A Low-level QASM Benchmark Suite for NISQ Evaluation and Simulation" [arXiv:2005.13018].

Bibtex:

@article{li2020qasmbench,
    title={QASMBench: A Low-level QASM Benchmark Suite for NISQ Evaluation and Simulation},
    author={Li, Ang and Krishnamoorthy, Sriram},
    journal={arXiv preprint arXiv:2005.13018},
    year={2020}
}

License

This project is licensed under the BSD License, see LICENSE file for details.

Acknowledgments

We thank the many developers and open-source community for providing these awesome quantum circuits online so we are able to collect and form this benchmark suite. This work was originally supported by PNNL's Quantum Algorithms, Software, and Architectures (QUASAR) LDRD Initiative. It is now supported by U.S. DOE Co-design Center for Quantum Advantage (C2QA) Quantum Information Science (QIS) center XCITe crosscut. The Pacific Northwest National Laboratory (PNNL) is operated by Battelle for the U.S. Department of Energy (DOE) under contract DE-AC05-76RL01830.

Contributing

Please contact us If you'd like to add your circuits into the benchmark suite or you'd like to remove your circuits from the suite.