-
Notifications
You must be signed in to change notification settings - Fork 612
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add function to load Qiskit operators (#5251)
**Context:** The next release of the PennyLane-Qiskit plugin will include PennyLaneAI/pennylane-qiskit#401 which features a new function for converting Qiskit [SparsePauliOp](https://docs.quantum.ibm.com/api/qiskit/qiskit.quantum_info.SparsePauliOp) instances into PennyLane operators. **Description of the Change:** * Added a `from_qiskit_op()` function to the IO module for loading Qiskit operators. In a nutshell, ```python >>> import pennylane as qml >>> from qiskit.quantum_info import SparsePauliOp >>> qiskit_op = SparsePauliOp(["II", "XY"]) >>> qml.from_qiskit_op(qiskit_op) I(0) + X(1) @ Y(0) ``` **Benefits:** * Qiskit operators can be directly converted into PennyLane operators. **Possible Drawbacks:** None. **Related GitHub Issues:** None. --------- Co-authored-by: Thomas R. Bromley <[email protected]>
- Loading branch information
1 parent
880b9da
commit 6ff7a1f
Showing
3 changed files
with
168 additions
and
44 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