Skip to content
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

Merged
merged 74 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
a406cf8
use mcm_method in construct_batch
lillian542 Jan 28, 2025
5b07517
add labs/ftqc module and initial implementation
lillian542 Jan 28, 2025
6960082
update to inherit from MidMeasureMP
lillian542 Jan 29, 2025
654aec5
add diagonalizing transform and measure function
lillian542 Jan 30, 2025
36db790
start adding transform, capture support
lillian542 Feb 4, 2025
bcd446a
more work on making things capture compatible
lillian542 Feb 4, 2025
1d459e9
merge conflicts
lillian542 Feb 4, 2025
4352c52
move to ftqc module
lillian542 Feb 4, 2025
d60af23
isolate changes to arbitrary basis MCM class
lillian542 Feb 4, 2025
abe4d40
add labeling, drawing, transform, docstrings
lillian542 Feb 5, 2025
6512537
add tests outline
lillian542 Feb 5, 2025
670e344
add tests
lillian542 Feb 6, 2025
0068fa1
more tests
lillian542 Feb 6, 2025
17b10a0
tidying up in main file
lillian542 Feb 6, 2025
ee9b846
add a few more tests
lillian542 Feb 7, 2025
3c89436
tests and cleanup
lillian542 Feb 10, 2025
affdd9b
update changelog
lillian542 Feb 10, 2025
a584866
black formatting fix and clean up
lillian542 Feb 10, 2025
fdc94a6
Merge branch 'master' into parametric_mcm_class
lillian542 Feb 10, 2025
bc40931
switch rotation convention for ZY plane
lillian542 Feb 10, 2025
953569d
[H, PhaseShif] diagonalization for XY
lillian542 Feb 10, 2025
f811ce8
test hash for measure in ZX plane
lillian542 Feb 10, 2025
fec71cf
update tests for two gates diagonalizing XY
lillian542 Feb 10, 2025
77debdf
stop doing in-plane mutation of the MPs
lillian542 Feb 10, 2025
dbd5255
add test for tracking updated MCMs in cond
lillian542 Feb 10, 2025
f826a7f
Apply suggestions from code review
lillian542 Feb 11, 2025
d8b07ac
simplify decimal label
lillian542 Feb 11, 2025
c3d90bd
Merge branch 'parametric_mcm_class' of github.com:PennyLaneAI/pennyla…
lillian542 Feb 11, 2025
cf11005
Remove import warnings and associated tests
mlxd Feb 11, 2025
8cec6bc
clean up and codecov
lillian542 Feb 11, 2025
636b23c
update changelog
lillian542 Feb 11, 2025
2d9ca6d
add arbitrary_basis_measure, measure_x, measure_y
lillian542 Feb 11, 2025
c95d3a1
add to docs
lillian542 Feb 11, 2025
69e8c1f
Update pennylane/ftqc/parametric_midmeasure.py
lillian542 Feb 11, 2025
75d6752
Update pennylane/ftqc/parametric_midmeasure.py
lillian542 Feb 11, 2025
4303df5
add x and y measurement classes
lillian542 Feb 11, 2025
616a37e
Apply suggestions from code review
lillian542 Feb 13, 2025
95261bd
docstrings + minor edits
lillian542 Feb 13, 2025
818f5e2
docstrings + minor edits
lillian542 Feb 13, 2025
00948d2
pause qeueing in transform (code review change)
lillian542 Feb 13, 2025
c978574
Merge branch 'parametric_mcm_class' into ftqc_measure
lillian542 Feb 13, 2025
2fa8dc3
fix bug where conditionals with non-MCM base are skipped
lillian542 Feb 14, 2025
6b0d25d
Merge branch 'parametric_mcm_class' into ftqc_measure
lillian542 Feb 14, 2025
334ea93
add imports and small bug fixes
lillian542 Feb 14, 2025
9debedd
add tests
lillian542 Feb 14, 2025
8e41700
Merge branch 'master' into ftqc_measure
lillian542 Feb 14, 2025
9414f7b
add changelog
lillian542 Feb 14, 2025
1b37773
update workflow tests to use measure functions
lillian542 Feb 14, 2025
97102d3
Merge branch 'ftqc_measure' of github.com:PennyLaneAI/pennylane into …
lillian542 Feb 14, 2025
427bbf2
black formatting
lillian542 Feb 14, 2025
d597acd
fix some broken sphinx links, maybe
lillian542 Feb 14, 2025
d62cc73
Apply suggestions from code review
lillian542 Feb 19, 2025
47bbc2a
apply suggestions from code review
lillian542 Feb 19, 2025
c184017
apply suggestions from code review
lillian542 Feb 19, 2025
a119e0e
apply suggestions from code review
lillian542 Feb 19, 2025
309d8ac
refactor to remove duplicate code
lillian542 Feb 19, 2025
9ec9e07
specify and test diag gates for Y
lillian542 Feb 25, 2025
4aeb9f4
add type hints to label method
lillian542 Feb 25, 2025
8b59d23
add details about axis, plane and angle
lillian542 Feb 25, 2025
694488a
add link for details
lillian542 Feb 25, 2025
6833f17
Update pennylane/ftqc/parametric_midmeasure.py
lillian542 Feb 25, 2025
ef8c03d
appease sphinx (maybe)
lillian542 Feb 26, 2025
902d2de
improve math rendering and fix link
lillian542 Feb 26, 2025
59d0aff
make docstring for basis definition more concise
lillian542 Feb 27, 2025
c09a704
update label type hints and args
lillian542 Feb 27, 2025
c7d6abe
add missing test
lillian542 Feb 27, 2025
8fe7910
Merge branch 'master' into ftqc_measure
lillian542 Feb 28, 2025
51170d4
Apply suggestions from code review
lillian542 Feb 28, 2025
f0afa69
Use vanilla numpy in example
lillian542 Feb 28, 2025
1d7fb89
include diagonalization in example
lillian542 Feb 28, 2025
7cdafd3
fix merge conflict
lillian542 Feb 28, 2025
78a613a
Clean up change-log
lillian542 Feb 28, 2025
92e7659
Add comment regarding other possible decompositions
lillian542 Feb 28, 2025
503e115
Merge branch 'master' into ftqc_measure
lillian542 Feb 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions doc/code/qml_ftqc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
qml.ftqc
===========

.. currentmodule:: pennylane.ftqc

.. warning::

This module is currently experimental and will not maintain API stability between releases.

.. automodapi:: pennylane.ftqc
:no-heading:
:include-all-objects:
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ PennyLane is **free** and **open source**, released under the Apache License, Ve

code/qml_capture
code/qml_devices
code/qml_ftqc
code/qml_measurements
code/qml_pytrees
code/qml_operation
Expand Down
9 changes: 8 additions & 1 deletion doc/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,19 @@
[(#6842)](https://github.com/PennyLaneAI/pennylane/pull/6842)

* A `ParametrizedMidMeasure` class is added to represent a mid-circuit measurement in an arbitrary
measurement basis in the XY, YZ or ZX plane.
measurement basis in the XY, YZ or ZX plane. Subclasses `XMidMeasureMP` and `YMidMeasureMP` represent
X-basis and Y-basis measurements.
[(#6938)](https://github.com/PennyLaneAI/pennylane/pull/6938)
[(#6953)](https://github.com/PennyLaneAI/pennylane/pull/6953)

* A `diagonalize_mcms` transform is added that diagonalizes any `ParametrizedMidMeasure`, for devices
that only natively support mid-circuit measurements in the computational basis.
[(#6938)](https://github.com/PennyLaneAI/pennylane/pull/6938)

* Measurement functions `measure_x`, `measure_y` and `measure_arbitrary_basis` are added. These functions
apply a mid-circuit measurement and return a `MeasurementValue`. They are analogous to `qml.measure` for
the computational basis, but instead measure in the X-basis, Y-basis, or an arbitrary basis, respectively.
[(#6953)](https://github.com/PennyLaneAI/pennylane/pull/6953)

* `null.qubit` can now execute jaxpr.
[(#6924)](https://github.com/PennyLaneAI/pennylane/pull/6924)
Expand Down
18 changes: 16 additions & 2 deletions pennylane/ftqc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,24 @@
:toctree: api

"""
from pennylane import ExperimentalWarning
from .parametric_midmeasure import ParametricMidMeasureMP, diagonalize_mcms
from pennylane import measure as measure_z
from .parametric_midmeasure import (
ParametricMidMeasureMP,
XMidMeasureMP,
YMidMeasureMP,
measure_arbitrary_basis,
measure_x,
measure_y,
diagonalize_mcms,
)

__all__ = [
"ParametricMidMeasureMP",
"XMidMeasureMP",
"YMidMeasureMP",
"measure_arbitrary_basis",
"measure_x",
"measure_y",
"measure_z",
"diagonalize_mcms",
]
Loading
Loading