Skip to content

Commit

Permalink
Qpy 0.21 updates (#409)
Browse files Browse the repository at this point in the history
* Copy Qiskit/qiskit#8055

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Copy qpy changes from Qiskit/qiskit#8093

Co-authored-by: Jake Lishman <jake@binhbar.com>
Co-authored-by: Jake Lishman <jake.lishman@ibm.com>

* Copy Qiskit/qiskit#8200

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Copy of Qiskit/qiskit#7300

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>

* Copy of Qiskit/qiskit#8235

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: Jake Lishman <jake@binhbar.com>
Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
  • Loading branch information
5 people authored Jul 5, 2022
1 parent 15dd103 commit 78626df
Show file tree
Hide file tree
Showing 9 changed files with 1,599 additions and 423 deletions.
6 changes: 3 additions & 3 deletions qiskit_ibm_runtime/qpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@
For example::
from qiskit.circuit import QuantumCircuit
from qiskit.circuit import qpy_serialization
from qiskit import qpy
qc = QuantumCircuit(2, name='Bell', metadata={'test': True})
qc.h(0)
qc.cx(0, 1)
qc.measure_all()
with open('bell.qpy', 'wb') as fd:
qpy_serialization.dump(qc, fd)
qpy.dump(qc, fd)
with open('bell.qpy', 'rb') as fd:
new_qc = qpy_serialization.load(fd)[0]
new_qc = qpy.load(fd)[0]
API documentation
=================
Expand Down
6 changes: 6 additions & 0 deletions qiskit_ibm_runtime/qpy/binary_io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
from .value import (
dumps_value,
loads_value,
write_value,
read_value,
# for backward compatibility; provider, runtime, experiment call this private methods.
_write_parameter,
_write_parameter_expression,
Expand All @@ -30,3 +32,7 @@
_write_instruction,
_read_instruction,
)
from .schedules import (
write_schedule_block,
read_schedule_block,
)
Loading

0 comments on commit 78626df

Please sign in to comment.