Closed epelofske-LANL closed 2 years ago
Hello @epelofske-LANL, thank you for your interest in Mitiq! If this is a bug report, please provide screenshots and/or minimum viable code to reproduce your issue, so we can do our best to help get it fixed. If you have any questions in the meantime, you can also ask us on the Unitary Fund Discord.
Thanks @epelofske-LANL for the bug report. I think there are problems with the current code of mitiq.ddd in the case in which there are measurements in the circuit.
This could be fixed by changing the code of insert_ddd_equences
and maybe also in the code of _get_circuit_mask
as follows:
_pop_measurements
_append_measurements
.Thanks for finding this one @epelofske-LANL! I'm happy to fix it up, collaborate on a fix, or hand it off to you. I'll assign myself for now, but just let me know if you have a different preference.
@Aaron-Robertson Feel free to go ahead if you have a fix; I am not sure how to implement a fix (largely because I am not terribly familiar with mitiq).
Thanks @Aaron-Robertson !
Hi @Aaron-Robertson, any update on this?
In general I think many DDD problems that we currently have are related to the presence of measurement gates in the middle of the circuits. In these cases, Mitiq erroneously tries to insert DDD gates in idle windows that are present after the measurement gates.
I think the bug may be fixed using cirq.synchronize_terminal_measurements()
somewhere in the Mitiq noise_scaling_converter
or in the insert_ddd_sequences
function (or both).
It is fine to always enforce/assume that measurements are all terminal and in the same moment. We could raise an error if it is not so.
Not sure if you are doing similar things, so I don't want to overlap. Maybe we can have a call on Discord when you have time.
Issue Description
Passing a specific Qiskit circuit to
ddd.insert_ddd_sequences()
throws an errorqiskit.circuit.exceptions.CircuitError
Code Snippet
example.qasm.txt
It is possible to get around this error by using the following code instead:
Error Output
Environment Context
Mitiq
about()
:Additional Python Environment Details: