Open ritu-thombre99 opened 1 month ago
I can confirm that this is a bug in how we eliminate measurements at the end of the circuit before we perform the equivalence check. The barriers after the measurements in the circuit prevent the optimiser to remove the measurements and the equivalence checker, then, can't handle them.
This should be a pretty easy fix here: https://github.com/cda-tum/mqt-core/blob/5be1c3ec4efb773d0330298621704e876afa7c16/src/circuit_optimizer/CircuitOptimizer.cpp#L468-L570
On vacation right now, but can look at that once I am back. Maybe @pehamTom has some time until then?
Environment information
OS: MacOS MQT version: 2.6.0 Compiler: C++
Description
This is related to the earlier issue 424
I'm trying to run a circuit equivalence check for two particular circuits (Steane code). The segmentation fault was fixed by removing measurements of two qubits onto the same clbit.
But now, when I run the code with Barriers, it runs properly (the result being non_equivalent) However, when I run it after removing all the barriers I get the following error:
Circuit 1:
Circuit 2:
Circuit 2 without barriers:
Output:
ValueError: DD for non-unitary operation not available!
Circuit 2 with barriers:
Output:
not_equivalent
Expected behavior
Not equivalent even when running the code with circuits that do not have barriers
How to Reproduce
Import qiskit, mqt.qcec and the run the code blocks mentioned above.