qat.synthopline.util.extract_pauli_rotations

qat.synthopline.util.extract_pauli_rotations(circuit)

Crawls a circuit and outputs an equivalent sequence of Pauli rotations and a final Clifford operator.

Example

from qat.lang.AQASM import *

prog = Program()
qbits = prog.qalloc(2)
CNOT(qbits)
PH(1.234)(qbits[1])
RX(2.345)(qbits[0])
CNOT(qbits)
circuit = prog.to_circ()

from qat.synthopline.util import extract_pauli_rotations

rotations, clifford = extract_pauli_rotations(circuit)

for angle, axis in rotations:
    print(axis, angle)

print(clifford)
ZZ 1.234
XX 2.345
1 0 0 0 0 
----------
0|1 2 0 0 
0|0 1 0 0 
0|0 0 1 0 
0|0 0 2 1 

Parameters

circuit (Circuit) – a quantum circuit

Returns

a list of pairs of angles, axis,

and a Clifford tableau

Return type

list<pair<angle, axis>>, OperatorTableau