-
Notifications
You must be signed in to change notification settings - Fork 631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add measure functions for MCMs in X, Y and arbitrary measurement basis #6953
Conversation
Co-authored-by: Joey Carter <[email protected]>
…ne into parametric_mcm_class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @lillian542 . LGTM!
Co-authored-by: Joey Carter <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, nice work! 🚀
Just had a few final editorial fixes and thoughts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a bunch @lillian542
No concerns from my side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lillian542 for the nice work!
Co-authored-by: Mudit Pandey <[email protected]>
Co-authored-by: Mudit Pandey <[email protected]>
Note: I also added docs rendering in this PR (I meant to in the previous one), so we should include the docs rendering for the
ftqc
module in the review processContext:
In the existing architecture of PennyLane, if a MCM returns a value that we would like to manipulate/use following the measurement, the MCM needs to be stored in a
MeasurementValue
. For the computational basis,qml.measure
is the function that creates an MCM, links it to aMeasurementValue
, and returns theMeasurementValue
for use.We've added a base class for creating MCMs in bases other than the computational basis to the ftqc module, but it doesn't have this functionality yet.
Description of the Change:
We add
ftqc.measure_arbitrary_basis
,ftqc.measure_x
, andftqc.measure_y
, analogous toqml.measure
.Additionally, we add classes
XMidMeasureMP
andYMidMeasureMP
(used in the x and y measurement functions), as subclasses ofParametrizedMidMeasureMP
.Benefits:
measure
functions allow us to easily return a measurement value and use or manipulate is, as in:[sc-83347]