Closed yitchen-tim closed 1 year ago
Hello @yitchen-tim, 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.
Hi @yitchen-tim, thanks for reporting this! Mitiq doesn't support GPi gates and many other platform-specific gates. I think there are two alternative paths that you could try:
execute
function such that all the Mitiq circuit workflow happens with "standard gates" until the final step in which circuits are compiled right before entering the IonQ backend.mitiq.zne.scaling
, but compatible with your native gates. I am not sure if this will work, it's just an idea. Thanks for the pointers to alternatives. Adding compilation as the final step of execute
function sounds like the best way for those who want to use Mitiq with IonQ native gates today. But, for long term, I feel like adding native gates is still the best solution. I am happy to contribute to add the gates. I already started to do so, but I ran into issue that the inverse of IonQ native gates are not implemented in Cirq. I am looking into how to solve this. Any idea how I can bypass this issue besides implementing the inverse method in Cirq?
Thanks for the pointers to alternatives. Adding compilation as the final step of
execute
function sounds like the best way for those who want to use Mitiq with IonQ native gates today. But, for long term, I feel like adding native gates is still the best solution. I am happy to contribute to add the gates.
That would be great, thanks!
I already started to do so, but I ran into issue that the inverse of IonQ native gates are not implemented in Cirq. I am looking into how to solve this. Any idea how I can bypass this issue besides implementing the inverse method in Cirq?
I fear that defining the inverse is necessary since in Mitiq we need to call the inverse method of Cirq gates. E.g. all unitary folding functions in Mitiq requires the evaluation of inverse gates.
Opened a PR in Cirq to implement the inverse of these gates. Once Cirq is updated, I will implement the Braket-Cirq translation in Mitiq.
Perfect! thanks @yitchen-tim
@andreamari The PR for gate conversion is out #1525 !
This issue was actually closed by #1525
Issue Description
Amazon Braket now supports verbatim compilation now for IonQ. But when I tired to run this example with verbatim compilation and native gates, I got the validation error that the gate does not exist.
ValueError: Unable to convert the instruction Instruction('operator': GPi('angle': 0.0, 'qubit_count': 1), 'target': QubitSet([Qubit(0)])) to Cirq. If you think this is a bug, you can open an issue on the Mitiq GitHub at https://github.com/unitaryfund/mitiq.
Proposed Solution
Add IonQ native gates, GPi, GPi2 and MS, as part of the supported gates of Mitiq.
Additional References
Amazon Braket's Developer Guide IonQ's doc