TopQAD1Qbit

Input Circuit

Introduction

Quantum circuits can be written in a number of ways, for example, using a number of different languages, programs, and libraries. This section describes the format that TopQAD accepts for input quantum circuits. This format helps TopQAD to compile to the Pauli product rotations ISA. Recall that quantum programs can be compiled for different instruction sets and their corresponding gate set, as explained in the Quantum Architecture Basics section.

TopQAD currently accepts input circuits in the CNOT+SU(2)SU(2) gate set.

Input File Conditions

The following input circuit conditions must be met:

  1. The file must be less than or equal to 10 MB in size.
  2. The file name and description may contain only letters, numbers, spaces, underscores, and hyphens. Other characters are not permitted.
  3. The file format must adhere to the requirements stated below.

Input File Format Requirements

The following requirements must be met for an input circuit file to be compatible with TopQAD:

  1. The input file must be a valid OpenQASM 2.0 file.
  2. TopQAD supports purely quantum circuits; the classically-controlled if statement (if) is not supported.
  3. Currently, TopQAD supports the gates listed in the table below. These gates are defined in the standard OpenQASM header qelib1.inc. Custom gates (including opaque gates) are not supported. 4.qelib1.inc is assumed to be imported, but the import statement may still be present in input files. No other include statements can be present.
  4. Measurements are expected at the end of the circuit. Mid-circuit measurements are not supported. If no measurement is present on a qubit, a Z-basis measurement on that qubit will be appended to the circuit in the optimization phase.
  5. A creg of the same size as the total number of qubits is assumed to be present. creg declarations are ignored.
  6. Quantum register declarations (qreg name[size];) must appear before any gate invocations. All qubits are mapped to a linear address space in latter portions of the pipeline; all qregs will be appended to this space in declaration order.
  7. Neither reset nor barrier statements are supported.
  8. At present, classical arguments to a gate must be in one of the following formats (where n and m are integers, f is a float, no whitespace is allowed):
    • n * pi
    • pi * n
    • n * pi / m
    • pi * n / m
    • -n * pi
    • -pi * n
    • -n * pi / m
    • -pi * n / m
    • pi / n
    • -pi / n
    • f
    • f * pi
    • pi * f

A complete listing of supported gates is provided below.

GateDescription
rzrotates a qubit around the ZZ-axis by a given angle
ryrotates a qubit around the YY-axis by a given angle
rxrotates a qubit around the XX-axis by a given angle
u1equivalent to rz, up to a global phase
u2equivalent to u3(pi/2, theta, phi)
u3a single-qubit unitary parameterized by three arbitrary angles
hthe Hadamard gate
xthe Pauli-XX gate
ythe Pauli-YY gate
zthe Pauli-ZZ gate
sthe phase gate
sdgthe inverse of the phase gate
tthe TT gate, a π/8\pi/8 rotation
tdgthe inverse of the TT gate
cxthe controlled-NOT (CNOT) gate