Closed trbromley closed 3 weeks ago
Hi, I would like to tackle this issue as part of the UnitaryHack
Hi @Coffee4MePlz! That would be great :rocket:
We're here to help with guidance if you need it. Is it clear how to get started?
Great. I'm studying the plugin first and from_qiskit
to get a sense of how things were implemented . If any doubts arise I'll get in touch. Thank you.
Hello,
I've updated both the core library and the plugin to solve this issue. I've created a pull request in the plugin repo (https://github.com/PennyLaneAI/pennylane-qiskit/pull/555). How will the CI tests work if I create a PR in this repo since it will rely on the other PR? Please let me know what the process for developing on the two different repos simultaneously is. Thank you.
Thanks @MashAliK! Great job with this, and congrats on completing this bounty :medal_military:
Would you optionally like to be tagged in any of our announcements around unitaryHACK or the upcoming PennyLane 0.37 release at the start of July? This would be on LinkedIn and Twitter, so if you would like, please share your username(s).
Feature details
The
from_qasm
function allows users to convert a QASM2 string into a PennyLane quantum function (see docs). Internally, this is done via the converter in the PennyLane-Qiskit plugin.Similar to the recently-added improvement to
from_qiskit
, we wantfrom_qasm
to be able toCurrently,
from_qasm
ignores any measurements present in the QASM2 string.Implementation
For point 1, PennyLane supports a host of measurements (
MeasurementProcess
objects) like expectation values that cannot be represented in QASM2. We would like for a user to be able to convert their QASM2 string withfrom_qasm
and append their desired PennyLane measurement to the end of the circuit like so:For point 2, a QASM2 string can contain simple
measure
primitives representing qubit measurement in the standard basis. This can in principle be mapped to PennyLane'sqml.measure()
. We would like for anymeasure
primitives in the input QASM2 string to be faithfully converted when usingfrom_qasm
, following the same behaviour specified infrom_qiskit
.A successful PR must include:
Check out our development guide for more information, and don't hesitate to reach out to us if you need assistance.
How important would you say this feature is?
1: Not important. Would be nice to have.
Additional information
This issue will require work in both the core PennyLane repo and the PennyLane-Qiskit plugin repo where the existing conversion functionality lives. The solution to this issue can rely on existing QASM2 to Qiskit conversion support, e.g., via
qiskit.qasm2
.