Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Prevent circular references when serializing Qubit values. - #764

Closed
Cassandra Granade (cgranade) wants to merge 5 commits into
mainfrom
cgranade/circular-qubit-value
Closed

Prevent circular references when serializing Qubit values.#764
Cassandra Granade (cgranade) wants to merge 5 commits into
mainfrom
cgranade/circular-qubit-value

Conversation

@cgranade

Copy link
Copy Markdown
Contributor

This PR adds the [JsonIgnore] attribute to Qubit.Value in the C# runtime, preventing circular references when serializing values of type Qubit. This in turn allows for DisplayableUnitaryOperator from Microsoft.Quantum.Standard and Microsoft.Quantum.Standard.Visualization to be sent from the IQ# kernel through to Python hosts correctly, such that Python host programs can capture operations dumped from Q# programs.

@bettinaheim

Copy link
Copy Markdown
Contributor

Cassandra Granade (@cgranade) Does this need to go into main urgently? If not, could we please first pull in the simulator feature before having other merges to the runtime.

@cgranade

Copy link
Copy Markdown
Contributor Author

Not urgent, no. Just a small bugfix I found while prototyping some Python features.

@cgranade

Copy link
Copy Markdown
Contributor Author

image

Sigh, another CI failure due to the simulator crashing.

@swernli

Stefan J. Wernli (swernli) commented Jul 2, 2021

Copy link
Copy Markdown
Collaborator

Sigh indeed. We did have a potential fix for this, but it's tied up with #710 (see specific comment thread at #710 (comment)). Perhaps it's worth pulling that part of the change out into its own PR?

@cgranade

Copy link
Copy Markdown
Contributor Author

Bettina Heim (@bettinaheim), Stefan J. Wernli (@swernli): Now that main is open again, would it be possible to merge this fix in for the July release? Thank you!

@swernli

Copy link
Copy Markdown
Collaborator

Closing as out of date, as there is now a workaround in IQ#.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants