Skip to content

Add write_values and read_values for general data QPY serialization from python#15740

Open
gadial wants to merge 6 commits intoQiskit:mainfrom
gadial:qpy_parameter_expression_interface
Open

Add write_values and read_values for general data QPY serialization from python#15740
gadial wants to merge 6 commits intoQiskit:mainfrom
gadial:qpy_parameter_expression_interface

Conversation

@gadial
Copy link
Copy Markdown
Contributor

@gadial gadial commented Mar 2, 2026

Summary

Adds write_values and read_values functions for the Python interface of the QPY module, allowing for saving and loading arbitrary QPY-serializable data types.

Addresses #15727

Details and comments

In #15727 the need for QPY serialization of data not given as part of a circuit arose in the context of ParameterExpression values; instead of specific tailoring for this task, our inner Rust mechanism allows to serialize any QPY-serializable data (everything represented in the GenericValue struct).

@gadial gadial requested a review from a team as a code owner March 2, 2026 14:42
@qiskit-bot
Copy link
Copy Markdown
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core
  • @mtreinish

Comment thread crates/qpy/src/value.rs
Comment thread crates/qpy/src/value.rs Outdated
) -> Self {
QPYReadData {
circuit_data,
version: QPY_VERSION,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want the read side to also be able to set the qpy version?
\

Copy link
Copy Markdown
Contributor Author

@gadial gadial Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We must, this is another oversight by me, and it's a real shame because I actually thought about this but assumed the version is packaged in the qpy, since I just handled that in #15749 :-(

done in 645d0b6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants