Skip to content

Commit

Permalink
Handle qpy serialization across versions and delete vendored fork
Browse files Browse the repository at this point in the history
For the next qiskit-ibm-runtime release it is desired to have it support
both Qiskit 0.45.x/0.46.x and Qiskit 1.0.0. To do this with QPY it means
we need to emit a fixed qpy version of 10 as that's currently the
maximum version the server side can parse. The easiest way to manage
this across versions is actually to rely on Qiskit's qpy module again.
Starting in Qiskit 1.0.0 the qiskit.qpy.dump() function a new kwarg,
version exists to specify the version of qpy emitted. We can use this
to control the rollout of QPY format versions as the server side is
updated. For right now this is fixed to version 10 which is the same as
the QPY format version emitted by 0.45.x and 0.46.0. Because the
versions are the same we can just use qiskit's qpy module moving forward
as either we're on qiskit 0.45.x/0.46.x and will emit version 10 (as there
is no option) or we're on >=1.0.0 and we explicitly set the qpy version
to one that's compatible with the server side.

The qpy internals usage to serialize parameters and parameter
expressions are left in place (although expanded on to include Qiskit#1355 for
parameter expressions) as an alternative needs to be considered for
this. It is not a good idea to rely on qpy internals and explicitly
private functions to do partial serialization.

This commit also deletes the vendored fork as it's never been included
in a released version of qiskit-ibm-runtime and nothing is using it
anymore.

Related to: Qiskit#1375
  • Loading branch information
mtreinish committed Feb 5, 2024
1 parent bf33ce8 commit 4d9b99a
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 4,217 deletions.
87 changes: 0 additions & 87 deletions qiskit_ibm_runtime/qpy/__init__.py

This file was deleted.

38 changes: 0 additions & 38 deletions qiskit_ibm_runtime/qpy/binary_io/__init__.py

This file was deleted.

Loading

0 comments on commit 4d9b99a

Please sign in to comment.