-
Notifications
You must be signed in to change notification settings - Fork 615
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix consistency of
QNode
results processing (#6568)
**Context:** The output of QNode execution was not consistent based on the type of the qfunc output, ```python @qml.qnode(qml.device('default.qubit')) def circuit(t): return t([qml.expval(qml.Z(0))]) >>> circuit(tuple) 1.0 >>> circuit(list) [1.0] ``` **Description of the Change:** Updates how the results of the QNode execution gets "type-converted" according to the `qfunc_output`. After this fix we get consistency, ```python @qml.qnode(qml.device('default.qubit')) def circuit(t): return t([qml.expval(qml.Z(0))]) >>> circuit(tuple) (1.0,) >>> circuit(list) [1.0] ``` **Benefits:** Consistency **Possible Drawbacks:** Output of QNode execution may look different than people are used to. A direct example is needed to change some tests to squeeze out the new dimension that has been introduced. **Related GitHub Issue:** #6540 [sc-77682]
- Loading branch information
1 parent
cb994be
commit 76f9d7c
Showing
4 changed files
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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