-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: Classical op params #56
Conversation
// Note: The order of the variants here is important. | ||
// Serde will return the first matching variant when deserializing, | ||
// so CopyBits and SetBits must come after other variants that | ||
// define `values` and `n_i`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bit puzzled by this, does the serialization not include the name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name is in Operation::type
, but this field is not directly linked to it.
If type
was a closed set we would be able to link classical
and type
more easily, but as it is now we just have a string field where some special values cause the classical
enum to be of some type.
It's probably still possible to do something, but it'd be a big refactor of the Operation
definition.
And to be pedantic, the schema does not link specific names with their required fields. It only lists a set of names for which classical
must be defined. The Classical
object itself is just a oneOf
set of options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
## 🤖 New release * `tket-json-rs`: 0.4.2 -> 0.5.0 <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## 0.5.0 (2024-07-09) ### Features - Handle legacy tk1 optype ([#54](#54)) - [**breaking**] Classical op params ([#56](#56)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/MarcoIeni/release-plz/). --------- Co-authored-by: Agustín Borgna <[email protected]>
Closes #53
drive-by: Add missing
data
field to Operation (schema).drive-by: Remove
created_qubits
/discarded_qubits
from the test files. Those fields are not in the schema.drive-by: Mark more structs as
non_exhaustive
, so in the future a change like this does not have to be breaking.BREAKING CHANGE: Added
data
andclassical
fields toOperation
. Marked some structs/enums as non_exhaustive.