Add state and restored to AllocOp#3017
Open
albi3ro wants to merge 3 commits into
Open
Conversation
Contributor
|
Adding these might require additional validation in other places (any current users of the alloc op essentially), because in general those mechanisms are not going to be aware of these attributes and won't know what to do with it (likely just ignoring it, otherwise failing). Neither is great, but especially a silent ignore would be bad since it will lead to incorrect results. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context:
In
qp.allocate, users can specify whether or not they need the new qubits to be in a zero state withstate="zero"orstate="any". They can also specify whether or not the qubits are returned to their initial state. This allows dynamically allocated qubits to be reused for another allocation after deallocation.To be able to replace
pennylane.estimatorfunctionality, we need to be able to track the different types of wire allocations.Description of the Change:
Just adds optional
stateandrestoredproperties toAllocOpthat default tostate="zero"andrestored=True.Benefits:
We can start tracking the different types of wire allocations.
Possible Drawbacks:
Related GitHub Issues: