Quickstart#

Assume you want to prove that the following two circuits are equivalent:

[1]:
from qiskit import QuantumCircuit

qc1 = QuantumCircuit(2)
qc1.cx(0, 1)
qc1.draw(output="mpl")
/home/docs/checkouts/readthedocs.org/user_builds/qcec/envs/latest/lib/python3.11/site-packages/qiskit/visualization/circuit/matplotlib.py:266: FutureWarning: The default matplotlib drawer scheme will be changed to "iqp" in a following release. To silence this warning, specify the current default explicitly as style="clifford", or the new default as style="iqp".
  self._style, def_font_ratio = load_style(self._style)
[1]:
_images/Quickstart_2_1.svg
[2]:
from qiskit import QuantumCircuit

qc2 = QuantumCircuit(2)
qc2.h(0)
qc2.h(1)
qc2.cx(1, 0)
qc2.h(1)
qc2.h(0)
qc2.draw(output="mpl")
/home/docs/checkouts/readthedocs.org/user_builds/qcec/envs/latest/lib/python3.11/site-packages/qiskit/visualization/circuit/matplotlib.py:266: FutureWarning: The default matplotlib drawer scheme will be changed to "iqp" in a following release. To silence this warning, specify the current default explicitly as style="clifford", or the new default as style="iqp".
  self._style, def_font_ratio = load_style(self._style)
[2]:
_images/Quickstart_3_1.svg

Then, using QCEC to check the equivalence of these two circuits is as easy as

[3]:
from mqt import qcec

qcec.verify(qc1, qc2)
[3]:
{
  "check_time": 0.006961504,
  "equivalence": "equivalent",
  "parameterized": {
    "performed_instantiations": 0
  },
  "preprocessing_time": 0.000251724
}

Check out the reference documentation for more information.