Closed tanujkhattar closed 7 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
6a40da5
) 97.82% compared to head (fb3c062
) 97.82%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
to stop the recursion. if it has 3 or less qubits then the from_unitary
strategy should have caught it
if it outputs the wrong result then the bug will be there not here.
is there an example of this producing the wrong result?
is there an example of this producing the wrong result?
The bug was in decompose_protocol.decompose_once(val)
. That works only when val
knows the qubits it acts upon (so operations, moments, circuits) but fails for gates. _try_decompose_into_operations_and_qubits
works in the general case. I've added a tests that was failing earlier but passes now
to stop the recursion
I think the check is redundant, because the control flow would reach the decomposition strategy only when it couldn't figure out the answer using the first 3 strategies and that would imply a scenario where, for example, the operation decomposes into non unitary operations (eg: measurements + cliffords) and therefore we should continue to check decomposition. An example in the test shows a scenario where _unitary_
is not defined but decomposition and _has_stabilizer_effect_
is.
Let's wait and not merge right now, I need to run some more tests
Fixes https://github.com/quantumlib/Qualtran/issues/665
@NoureldinYosri Do you remember why you added the following check?