unitaryfund / mitiq

Mitiq is an open source toolkit for implementing error mitigation techniques on most current intermediate-scale quantum computers.
https://mitiq.readthedocs.io
GNU General Public License v3.0
357 stars 157 forks source link

Problem with conversion of qiskit circuit with reset gate into mitiq #2469

Open Julie-Maria-Raju opened 3 weeks ago

Julie-Maria-Raju commented 3 weeks ago

I wanted to use the error mitigation using PEC for amplitude damping and I tried writing my own finding optimal representation code and is not working as it shows error in conversion of reset gate.

Given below is the error message:

raise CircuitConversionError(
mitiq.interface.conversions.CircuitConversionError: Circuit could not be converted to an internal Mitiq circuit. This may be because the circuit contains custom gates or Pragmas (pyQuil). If you think this is a bug or that this circuit should be supported, you can open an issue at https://github.com/unitaryfund/mitiq. 

 Provided circuit has type <class 'qiskit.circuit.quantumcircuit.QuantumCircuit'> and is:

   ┌───┐     
q: ┤ H ├─|0>─

Please help.

github-actions[bot] commented 3 weeks ago

Hello @Julie-Maria-Raju, 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.

natestemen commented 3 weeks ago

Hi @Julie-Maria-Raju! Thanks for opening an issue!

This is a known issue with Mitiq (https://github.com/unitaryfund/mitiq/issues/2042), and currently the only workaround is to define your circuit using Cirq. Apologies for not having a better suggestion here.

Under the hood this is a limitation in how Cirq imports circuits from QASM. I've opened an issue upstream (https://github.com/quantumlib/Cirq/issues/6704) to see if they are interested in making a change.