Qiskit / qiskit-ibm-runtime

IBM Client for Qiskit Runtime
https://docs.quantum.ibm.com/api/qiskit-ibm-runtime
Apache License 2.0
149 stars 154 forks source link

Update QPY serialization in qiskit-ibm-runtime for deserialization of UCRX, UCRY, and UCRZ gates #285

Closed HuangJunye closed 2 years ago

HuangJunye commented 2 years ago

Describe the bug QPY currently can't deserialize UCRX, UCRY, UCRZ gates which are used in the Grover circuit (https://github.com/Qiskit/qiskit-terra/issues/7847). As a temporary solution, the circuit is decomposed 4 levels down below these gates for making the tutorials. (https://github.com/Qiskit/qiskit-ibm-runtime/issues/282). A fix in qiskit-terra is on the way and is planned to be released in qiskit-terrra 0.20.1. (https://github.com/Qiskit/qiskit-terra/pull/7933)

Steps to reproduce See the details here: https://github.com/Qiskit/qiskit-terra/issues/7847

Expected behavior Circuits containing UCRX, UCRY, and UCRZ gates can be serialized and deserialized for sending to the cloud without problems.

Suggested solutions Following the steps suggested here

  1. Make any changes to qpy module in terra and terra releases the changes.
  2. Copy those qpy module changes to qiskit-ibm-runtime and release qiskit-ibm-runtime.
  3. ntc-provider picks up the latest qiskit-ibm-runtime once it's released. (ntc-provider is not yet using qiskit-ibm-runtime yet).

Additional Information

HuangJunye commented 2 years ago

This is not needed to fix the bug because of https://github.com/Qiskit/qiskit-terra/pull/7933#issuecomment-1099102459

However, in this case I don't think it is necessary because deserialization is done server side and the error would occur in the qiskit-runtime service's environment itself and the not the client when it tried to load the qpy file. When the runtime environment updates their qiskit version to 0.20.1 with this fix I would expect it to just start working because there is no change in the file format as part of this fix.