Skip to content
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

Update json decoder #34

Merged
merged 5 commits into from
Jul 13, 2023
Merged

Update json decoder #34

merged 5 commits into from
Jul 13, 2023

Conversation

aborgna-q
Copy link
Collaborator

@aborgna-q aborgna-q commented Jul 12, 2023

Now using OpDefs and a TKET1 resource.
The logic for translating individual operations is contained by an internal JsonOp struct, which tries to make things as homogeneous as possible (given that any data in an tket_json_rs::Operation may be missing).

Next up is doing the encoder and testing the roundtrip. This should be straightforward now that we have the Commands iterator.

Note that free variables as parameters are not yet supported. (That'll probably go into an issue after this is merged.)


Note that until we solve CQCL/hugr#263 printing the graph will not show the actual name of wrapped operations:

Alternatively, we could dynamically add operations to the resource when we encounter new unsupported operation names. I'm not sure whether non-static resources would break something in the hugr...

@aborgna-q aborgna-q requested a review from ss2165 July 12, 2023 14:24
@aborgna-q aborgna-q mentioned this pull request Jul 13, 2023
Copy link
Member

@ss2165 ss2165 left a comment

Choose a reason for hiding this comment

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

👍

@aborgna-q aborgna-q merged commit 5cd8b8c into main Jul 13, 2023
5 checks passed
@aborgna-q aborgna-q deleted the feat/json-roundtrip branch July 13, 2023 10:51
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.

2 participants