Generate random circuits, unitary matrices, and test circuit equivalence.
qbraid.NATIVE_REGISTRY
. For example:
dim
):
qbraid.programs.NATIVE_REGISTRY
. Below is an example demonstrating
the comparison between two circuits that each create a Bell state using different quantum programming libraries
(Cirq and Qiskit).
index_contig
: If set to True, maps both circuits to use sequential qubit indexing prior to computing their unitaries. Defaults to False.allow_rev_qubits
: If set to True, allows the function to consider circuits as equivalent even if their qubits are in reversed order. Defaults to False.strict_gphase
: If set to False, ignores differences in global phase between the circuits. Defaults to True.atol
: Sets the absolute tolerance level for the numerical comparison of unitaries, using np.allclose. Defaults to 1e-7.