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+ gate set.
Input File Conditions
The following input circuit conditions must be met:
- The file must be less than or equal to 10 MB in size.
- The file name and description may contain only letters, numbers, spaces, underscores, and hyphens. Other characters are not permitted.
- 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:
- OpenQASM 2.0 format TopQAD accepts input files in the OpenQASM 2.0 format. The input file must be a valid OpenQASM 2.0 file.
- Quantum subroutines TopQAD's suite of tools can compile, optimize, and perform resource estimations on quantum circuits. If an algorithm has subroutines to be executed as part of a larger program, the input file should specify only the quantum portion of the algorithm.
- Quantum circuit TopQAD accepts quantum circuits. The OpenQASM standard supports higher-level language features, beyond quantum circuits, which are not supported by TopQAD; custom gate definitions, including opaque gates, and classical control are examples of such higher-level language features.
- Supported gates Currently, TopQAD supports the gates listed in the table below. These gates are defined in the standard OpenQASM header
qelib1.inc. - Measurements at the end of the circuit Mid-circuit measurements are not supported.
A complete listing of supported gates is provided below.
| Gate | Description |
|---|---|
rz | rotates a qubit around the -axis by a given angle |
ry | rotates a qubit around the -axis by a given angle |
rx | rotates a qubit around the -axis by a given angle |
u1 | equivalent to rz, up to a global phase |
u2 | equivalent to u3(pi/2, theta, phi) |
u3 | a single-qubit unitary parameterized by three arbitrary angles |
h | the Hadamard gate |
x | the Pauli- gate |
y | the Pauli- gate |
z | the Pauli- gate |
s | the phase gate |
sdg | the inverse of the phase gate |
t | the gate, a rotation |
tdg | the inverse of the gate |
cx | the controlled-NOT (CNOT) gate |
