CnotBipartite
QuICT.qcda.optimization.cnot_dag.CnotBipartite ¶
Optimize a bipartite CNOT circuit. A CNOT circuit is said to be bipartite if all the control qubits and target qubits of CNOT gates can be grouped into 2 seperated subset of qubits.
Examples:
from QuICT.qcda.optimization.cnot_dag import CnotBipartite cb = CnotBipartite()
Input circuit has 3 qubits on each side of bipartite.¶
Every qubit is connected with all qubits on the other side.¶
circ = cb.execute(3, 3, [(0, 3), (0, 4), (0, 5), (1, 3), (1, 4), (1, 5), (2, 3), (2, 4), (2, 5)])
execute
classmethod
¶
Execute optimization.
Parameters:
-
left(int) –The number of qubits on left side of bipartite.
-
right(int) –The number of qubits on right side of bipartite.
-
edges(List[Tuple[int, int]]) –All CNOT gates as edges starting from control qubits and ending at target qubits.
-
n_ancilla(int, default:0) –The number of ancillary qubits, default 0. If provided, ancillae number must be larger than number of edges.