Basic Compilation

Rigetti’s native compiler quilc is a highly advanced and world class compiler. It has many features to optimize the performance of quantum algorithms.

In QCVV we need to be certain that the circuit we wish to run is the one that is run. For this reason we have built the module compilation. Its functionality is rudimentary but easy to understand.

Basic Compile

basic_compile(program) A rudimentary but predictable compiler.

Helper Functions

match_global_phase(a, b) Phases the given matrices so that they agree on the phase of one entry.
is_magic_angle(angle)

Gates

_RY(angle, q) A RY in terms of RX(+-pi/2) and RZ(theta)
_RX(angle, q) A RX in terms of native RX(+-pi/2) and RZ gates.
_X(q1) An RX in terms of RX(pi/2)
_H(q1) A Hadamard in terms of RX(+-pi/2) and RZ(theta)
_T(q1[, dagger]) A T in terms of RZ(theta)
_CNOT(q1, q2) A CNOT in terms of RX(+-pi/2), RZ(theta), and CZ
_SWAP(q1, q2) A SWAP in terms of _CNOT
_CCNOT(q1, q2, q3) A CCNOT in terms of RX(+-pi/2), RZ(theta), and CZ