Skip to content
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
635 commits
Select commit Hold shift + click to select a range
a6fef0c
remove tests
soranjh Sep 17, 2025
f2d5ce7
add symbolic
soranjh Sep 17, 2025
d7bfeeb
fix conflict
soranjh Sep 17, 2025
b8fd88e
update init
soranjh Sep 17, 2025
4fe179e
Updated adjoint class
ddhawan11 Sep 17, 2025
8da4b95
Merge branch 'master' into add-single-paramteric-ops
ddhawan11 Sep 17, 2025
3f936d0
update arg name
soranjh Sep 17, 2025
050452a
Updated typechecks for nonparametric
ddhawan11 Sep 17, 2025
a1a364a
Merge remote-tracking branch 'origin/add-single-paramteric-ops' into …
ddhawan11 Sep 17, 2025
f08c485
Merge branch 'add-controlled-ops' into add-control-adjoint-symbolic
ddhawan11 Sep 17, 2025
b18e188
Update pennylane/estimator/ops/qubit/parametric_ops_single_qubit.py
ddhawan11 Sep 17, 2025
6a304e4
update arg name
soranjh Sep 17, 2025
9472959
Fixed tesst
ddhawan11 Sep 18, 2025
0cb6524
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
187bfe5
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
5dfc807
Added typechecks
ddhawan11 Sep 18, 2025
a973e74
Increased test coverage
ddhawan11 Sep 18, 2025
f42426d
Update tests/estimator/test_estimator_resOp.py
ddhawan11 Sep 18, 2025
4423f43
Fixed tests and signature
ddhawan11 Sep 18, 2025
7b23eb0
Fixed documentation
ddhawan11 Sep 18, 2025
87be3ed
Fix docs
ddhawan11 Sep 18, 2025
d7d99f2
Fix docs
ddhawan11 Sep 18, 2025
ba954a3
minor doc fix
ddhawan11 Sep 18, 2025
64a6061
minor doc fix
ddhawan11 Sep 18, 2025
18d9afc
fixed docs build
ddhawan11 Sep 18, 2025
a6a5cc2
fixed rendering
ddhawan11 Sep 18, 2025
ec5c2eb
Merge branch 'add-control-adjoint-symbolic' into add-multi-qubit-para…
ddhawan11 Sep 18, 2025
fa248c9
Fixed examples
ddhawan11 Sep 18, 2025
57dd102
Update pennylane/estimator/__init__.py
ddhawan11 Sep 18, 2025
165eef0
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
06632de
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
deb807d
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
bb4474a
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
1ee832c
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
42174e5
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
ccc8fb6
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
79864bf
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
a6fcd3b
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
fff05fa
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
1d1ba68
minor doc change
ddhawan11 Sep 18, 2025
f3edf4d
clean->zero
ddhawan11 Sep 18, 2025
dda1192
fix doc build
ddhawan11 Sep 18, 2025
2738fb6
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
0173012
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
34153cf
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
f59a290
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
af1a877
Renamed TempAND
ddhawan11 Sep 18, 2025
f7164e3
Updated changelog
ddhawan11 Sep 18, 2025
0c8efc9
Merge branch 'add-controlled-ops' into add-control-adjoint-symbolic
ddhawan11 Sep 18, 2025
0dd6777
fixed tests
ddhawan11 Sep 18, 2025
33b8a51
updated changelog
ddhawan11 Sep 18, 2025
fcaf87f
Merge branch 'add-control-adjoint-symbolic' into add-multi-qubit-para…
ddhawan11 Sep 18, 2025
fc0393d
move files
soranjh Sep 18, 2025
37c77bd
update names
soranjh Sep 18, 2025
b452eb9
move files
soranjh Sep 18, 2025
d8c641f
rename ops
soranjh Sep 18, 2025
584c32b
update tests
soranjh Sep 18, 2025
250108c
Update tests/estimator/ops/test_estimator_symbolics.py
ddhawan11 Sep 18, 2025
1508695
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
7f39f2a
update names
soranjh Sep 18, 2025
770e7e2
fix tests
soranjh Sep 18, 2025
a1bee15
fix more tests
soranjh Sep 18, 2025
2520912
fix all tests
soranjh Sep 18, 2025
b1ee21c
Added validation checks
ddhawan11 Sep 18, 2025
d9bb0ae
Added validation
ddhawan11 Sep 18, 2025
aa6bcb9
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
7ccf052
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
253e156
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
a43adaf
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
44bedcb
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
d60c2e0
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
76d3f55
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
38f3fac
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
63658e5
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
b7d72a0
Update pennylane/estimator/ops/op_math/controlled_ops.py
ddhawan11 Sep 18, 2025
ea9f392
Update pennylane/estimator/ops/identity.py
ddhawan11 Sep 18, 2025
5fdc13a
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 18, 2025
c278970
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 18, 2025
1edd79a
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 18, 2025
deeff3c
Update pennylane/estimator/ops/qubit/non_parametric_ops.py
ddhawan11 Sep 18, 2025
947a9f2
Update pennylane/estimator/ops/qubit/non_parametric_ops.py
ddhawan11 Sep 18, 2025
e9f42b2
add guard clause
soranjh Sep 19, 2025
5ccafd9
add type hint
soranjh Sep 19, 2025
a1fc4ba
update examples
soranjh Sep 19, 2025
b9468c0
Merge branch 'add-multi-qubit-parametric' into add-subroutines-to-est…
soranjh Sep 19, 2025
ec84532
update name
soranjh Sep 19, 2025
bfc915b
Merge branch 'add-controlled-ops' into add-control-adjoint-symbolic
ddhawan11 Sep 19, 2025
b4729c3
Merge branch 'add-control-adjoint-symbolic' into add-multi-qubit-para…
ddhawan11 Sep 19, 2025
d04f9d2
run black on init
soranjh Sep 19, 2025
6644834
add fix for pylint
soranjh Sep 19, 2025
43e17cc
add fix for pylint
soranjh Sep 19, 2025
1531ee5
correct import
soranjh Sep 19, 2025
c0313b9
correct format
soranjh Sep 19, 2025
339abe1
fix type hint
soranjh Sep 19, 2025
cb866c1
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 19, 2025
4fb27f7
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 19, 2025
1a1a057
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 19, 2025
503681e
update signature
soranjh Sep 19, 2025
d1b08cc
update wire names
soranjh Sep 19, 2025
8adab4c
update doc
soranjh Sep 19, 2025
27993d3
fix pylint
soranjh Sep 19, 2025
4fc7549
Addressed comment
ddhawan11 Sep 19, 2025
3dad56c
fix doc links
soranjh Sep 19, 2025
af2ec38
fix pylint
soranjh Sep 19, 2025
b5b4d06
fix doc
soranjh Sep 19, 2025
7e20816
[skip ci] fix doc
soranjh Sep 19, 2025
471a730
Merge branch 'master' into add-controlled-ops
ddhawan11 Sep 19, 2025
aa67d96
fixed unwanted changes
ddhawan11 Sep 19, 2025
8b7f4b2
fix doc links
soranjh Sep 19, 2025
f68bf6d
Resolved conflicts
ddhawan11 Sep 19, 2025
4cad155
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 19, 2025
35dc4f8
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 19, 2025
ce03cd7
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 19, 2025
7a43383
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 19, 2025
b5b8f22
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 19, 2025
4c1ad60
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 19, 2025
0d80499
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 19, 2025
6be8c88
Update pennylane/estimator/ops/qubit/parametric_ops_multi_qubit.py
ddhawan11 Sep 19, 2025
df9dbaf
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 19, 2025
ba3cfbd
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 19, 2025
88b6eab
Merge remote-tracking branch 'origin/add-control-adjoint-symbolic' in…
ddhawan11 Sep 19, 2025
bff5072
fix links
soranjh Sep 19, 2025
8a453f4
Addressed comments
ddhawan11 Sep 19, 2025
ab60a03
Added mcx for cnot controlled
ddhawan11 Sep 19, 2025
d592227
formatting
ddhawan11 Sep 19, 2025
95705ae
updated changelog
ddhawan11 Sep 19, 2025
2a45ec0
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 19, 2025
b8094f0
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 19, 2025
f899b4d
Update pennylane/estimator/ops/qubit/non_parametric_ops.py
ddhawan11 Sep 19, 2025
997a466
Update pennylane/estimator/ops/qubit/non_parametric_ops.py
ddhawan11 Sep 19, 2025
b2cd480
Update pennylane/estimator/ops/qubit/non_parametric_ops.py
ddhawan11 Sep 19, 2025
bbb59c7
Update pennylane/estimator/ops/qubit/non_parametric_ops.py
ddhawan11 Sep 19, 2025
021b877
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 19, 2025
304b136
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 19, 2025
6b55cd0
rearrange files
soranjh Sep 19, 2025
6077d49
fixed docs
ddhawan11 Sep 19, 2025
0215800
Merge branch 'add-multi-qubit-parametric' into add-subroutines-to-est…
soranjh Sep 19, 2025
f4d8c9a
fix sphinx
ddhawan11 Sep 19, 2025
c46f7e8
Merge branch 'master' into add-controlled-ops
ddhawan11 Sep 19, 2025
53278df
Merge branch 'add-controlled-ops' into add-control-adjoint-symbolic
ddhawan11 Sep 19, 2025
3c77db6
Addressed comments
ddhawan11 Sep 19, 2025
3c3502e
Merge branch 'add-control-adjoint-symbolic' into add-multi-qubit-para…
ddhawan11 Sep 19, 2025
19a1e04
fixed formatting
ddhawan11 Sep 19, 2025
ceaabe8
sphnx fix
ddhawan11 Sep 19, 2025
05805b1
sphinx fix
ddhawan11 Sep 19, 2025
1f7d356
update rst
soranjh Sep 19, 2025
63a53c4
fix link
soranjh Sep 19, 2025
c5cfb47
Merge branch 'add-multi-qubit-parametric' into add-subroutines-to-est…
soranjh Sep 19, 2025
e826cdf
check
ddhawan11 Sep 19, 2025
8b717dd
Merge branch 'master' into add-controlled-ops
ddhawan11 Sep 19, 2025
77190d2
sphinx fix
ddhawan11 Sep 19, 2025
065de4f
Merge branch 'master' into add-controlled-ops
ddhawan11 Sep 19, 2025
3b13bde
check
ddhawan11 Sep 20, 2025
ab85f0f
fix links
ddhawan11 Sep 20, 2025
ad164ee
fix sphinx check
ddhawan11 Sep 20, 2025
c89e7a1
Merge branch 'master' into add-controlled-ops
ddhawan11 Sep 20, 2025
9f3026c
fix rendering
ddhawan11 Sep 20, 2025
5140386
Merge branch 'add-controlled-ops' into add-control-adjoint-symbolic
ddhawan11 Sep 20, 2025
6dd5c44
Update tests/estimator/ops/test_estimator_identity.py
ddhawan11 Sep 20, 2025
9021452
Merge branch 'add-control-adjoint-symbolic' into add-multi-qubit-para…
ddhawan11 Sep 20, 2025
679f8da
remove unused import
soranjh Sep 21, 2025
2127d69
update docstring
soranjh Sep 21, 2025
5f01ad2
Merge branch 'add-control-adjoint-symbolic' into add-multi-qubit-para…
soranjh Sep 21, 2025
566e238
correct format
soranjh Sep 21, 2025
eb9b172
run isort
soranjh Sep 21, 2025
1ab39ce
Merge branch 'add-control-adjoint-symbolic' into add-multi-qubit-para…
soranjh Sep 21, 2025
e3358e9
fix test
soranjh Sep 21, 2025
98794e8
update format
soranjh Sep 21, 2025
8032098
Merge branch 'add-multi-qubit-parametric' into add-subroutines-to-est…
soranjh Sep 21, 2025
e6680ff
fix indentation
soranjh Sep 21, 2025
066163c
fix format
soranjh Sep 21, 2025
e8f2b07
correct format
soranjh Sep 21, 2025
7f3e848
Merge branch 'add-multi-qubit-parametric' into add-subroutines-to-est…
soranjh Sep 21, 2025
f32ed66
run isort
soranjh Sep 21, 2025
5290a02
add error test
soranjh Sep 22, 2025
50c8465
Merge branch 'master' into add-control-adjoint-symbolic
ddhawan11 Sep 22, 2025
589cb8e
Merge branch 'add-control-adjoint-symbolic' into add-multi-qubit-para…
ddhawan11 Sep 22, 2025
b5f4dbb
expand test
soranjh Sep 22, 2025
7f99386
formatting
ddhawan11 Sep 22, 2025
a9c3618
formatting
ddhawan11 Sep 22, 2025
7987748
merge master and fix conflicts
soranjh Sep 22, 2025
d30a469
add extra test
soranjh Sep 22, 2025
cc84168
increased test coverage
ddhawan11 Sep 22, 2025
fa4675d
Update doc/releases/changelog-dev.md
ddhawan11 Sep 22, 2025
55da199
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 22, 2025
9ecdc65
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 22, 2025
082aa39
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 22, 2025
f5233d5
Addressed comments
ddhawan11 Sep 22, 2025
06fbb6a
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 22, 2025
6cbd783
Update pennylane/estimator/ops/qubit/parametric_ops_multi_qubit.py
ddhawan11 Sep 22, 2025
16608e6
Update pennylane/estimator/ops/qubit/parametric_ops_multi_qubit.py
ddhawan11 Sep 22, 2025
3c151b8
Update pennylane/estimator/ops/qubit/parametric_ops_multi_qubit.py
ddhawan11 Sep 22, 2025
43eecfc
Update pennylane/estimator/ops/qubit/parametric_ops_multi_qubit.py
ddhawan11 Sep 22, 2025
c0552a2
Update pennylane/estimator/ops/qubit/parametric_ops_multi_qubit.py
ddhawan11 Sep 22, 2025
831d14c
Update pennylane/estimator/ops/qubit/parametric_ops_multi_qubit.py
ddhawan11 Sep 22, 2025
e319543
Update pennylane/estimator/ops/qubit/qchem_ops.py
ddhawan11 Sep 22, 2025
b969188
Update pennylane/estimator/ops/qubit/qchem_ops.py
ddhawan11 Sep 22, 2025
d44a976
Added example
ddhawan11 Sep 22, 2025
67bab4a
add missing tests
soranjh Sep 22, 2025
9df7e74
Update pennylane/estimator/ops/qubit/parametric_ops_multi_qubit.py
ddhawan11 Sep 22, 2025
8858cca
Update pennylane/estimator/ops/qubit/parametric_ops_multi_qubit.py
ddhawan11 Sep 22, 2025
8045644
add test
soranjh Sep 22, 2025
9dc9a55
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 22, 2025
b12586d
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 22, 2025
d3621f4
Update pennylane/estimator/ops/op_math/symbolic.py
ddhawan11 Sep 22, 2025
49ef3a4
Update pennylane/estimator/ops/qubit/parametric_ops_multi_qubit.py
ddhawan11 Sep 22, 2025
92af8e8
Update pennylane/estimator/ops/qubit/parametric_ops_multi_qubit.py
ddhawan11 Sep 22, 2025
5d307cf
Update pennylane/estimator/ops/qubit/parametric_ops_multi_qubit.py
ddhawan11 Sep 22, 2025
7fd03c2
Update doc/code/qml_estimator.rst
ddhawan11 Sep 22, 2025
57b6317
add more tests
soranjh Sep 22, 2025
56985d0
Merge branch 'add-multi-qubit-parametric' into add-subroutines-to-est…
soranjh Sep 22, 2025
3059223
check
ddhawan11 Sep 22, 2025
d562897
fix docs
ddhawan11 Sep 22, 2025
3105ced
Merge branch 'add-multi-qubit-parametric' into add-subroutines-to-est…
soranjh Sep 22, 2025
41ca4ed
merge master and fix conflict
soranjh Sep 22, 2025
b8c1ed2
Apply suggestions from code review
soranjh Sep 23, 2025
cab51ee
update changelog
soranjh Sep 23, 2025
1ccf6a0
move qubitunitary to new module
soranjh Sep 23, 2025
f3c86ec
change names
soranjh Sep 23, 2025
9ece755
update names
soranjh Sep 23, 2025
00079ef
fix tests
soranjh Sep 23, 2025
6e72018
add usage details to qft
soranjh Sep 24, 2025
450057b
update rst
soranjh Sep 24, 2025
125183f
Merge branch 'master' into add-subroutines-to-estimator
soranjh Sep 24, 2025
ad0aa2f
Apply suggestions from code review
soranjh Sep 24, 2025
9633205
update rst
soranjh Sep 24, 2025
6efa283
fix docs
soranjh Sep 24, 2025
664844c
create templates folder
soranjh Sep 24, 2025
72c6cb5
correct link
soranjh Sep 24, 2025
ebd5e4c
update rst
soranjh Sep 24, 2025
0affc39
use original conf
soranjh Sep 24, 2025
0d25d04
import paths
austingmhuang Sep 25, 2025
9726792
merg confs
austingmhuang Sep 25, 2025
e8dea30
update conf to include templates
soranjh Sep 25, 2025
8948c45
Merge branch 'master' into add-subroutines-to-estimator
soranjh Sep 25, 2025
d105f74
Merge branch 'add-subroutines-to-estimator' of https://github.com/Pen…
soranjh Sep 25, 2025
2215c2b
remove trotter
soranjh Sep 25, 2025
b331537
fix qft format
soranjh Sep 25, 2025
eac658b
fix config link
soranjh Sep 25, 2025
bb5b3ef
apply review comments
soranjh Sep 25, 2025
d39579e
update rst
soranjh Sep 25, 2025
65de59e
change zeroed to restored in qrom
soranjh Sep 25, 2025
b7fa888
Merge branch 'master' into add-subroutines-to-estimator
soranjh Sep 25, 2025
1aeacf3
update changelog
soranjh Sep 25, 2025
c935b1f
correct phase shift
soranjh Sep 26, 2025
19b245e
update format
soranjh Sep 26, 2025
0a4de3e
Merge branch 'master' into add-subroutines-to-estimator
soranjh Sep 26, 2025
986f35b
Merge branch 'master' into add-subroutines-to-estimator
soranjh Sep 26, 2025
8d7f15b
Merge branch 'master' into add-subroutines-to-estimator
soranjh Sep 28, 2025
e9fb1f3
Merge branch 'master' into add-subroutines-to-estimator
soranjh Sep 29, 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
9 changes: 9 additions & 0 deletions doc/code/qml_estimator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,12 @@ Resource Operators:
:classes-only:
:noindex:


Resource Templates:
-------------------

.. automodsumm:: pennylane.estimator.templates
:toctree: api
:no-inherited-members:
:classes-only:
:noindex:
30 changes: 18 additions & 12 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,16 @@
# inheritance_diagram graphviz attributes
inheritance_node_attrs = dict(color="lightskyblue1", style="filled")


# pylint: disable=unused-argument
def add_noindex_to_estimator_stubs(app, docname, source):
"""Dynamically add :noindex: to estimator stubs during the build process."""
if not docname.startswith("code/api/"):
return

content = source[0]
if not re.search(r"\bpennylane\.estimator\.ops\b", content):
# Update the regex to match either ops or templates
if not re.search(r"\bpennylane\.estimator\.(ops|templates)\b", content):
return

def _add_noindex_func(match):
Expand All @@ -366,17 +368,21 @@ def _add_noindex_func(match):

def add_links_to_estimator_table(app, doctree, fromdocname):
"""Replace literal names in automodsumm tables with links to stub HTML files."""
if "qml_estimator" in fromdocname: # Ensures no other tables are modified.
for table in doctree.traverse(nodes.table)[3:]:
for literal in table.traverse(nodes.literal):
name = literal.astext()
url = f"code/api/pennylane.estimator.ops.{name}"
refuri = app.builder.get_relative_uri(fromdocname, url)

refnode = nodes.reference('', refuri=refuri)
refnode += nodes.literal(text=name) # This helps preserve the code style.
literal.parent.replace(literal, refnode)
logger.info(f"[add_noindex_links] Linked pennylane.estimator.ops.{name} to {refuri}")
if "qml_estimator" not in fromdocname:
return
# Define the modules and their corresponding table indices
modules = {3: "ops", 4: "templates"}
for table_idx, module_name in modules.items():
table = doctree.traverse(nodes.table)[table_idx]
for literal in table.traverse(nodes.literal):
name = literal.astext()
url = f"code/api/pennylane.estimator.{module_name}.{name}"
refuri = app.builder.get_relative_uri(fromdocname, url)
refnode = nodes.reference('', refuri=refuri)
refnode += nodes.literal(text=name)
literal.parent.replace(literal, refnode)
logger.info(
f"[add_noindex_links] Linked pennylane.estimator.{module_name}.{name} to {refuri}")


def setup(app):
Expand Down
4 changes: 4 additions & 0 deletions doc/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
* The resource operators for ``Pow``, ``Prod``, ``ChangeOpBasis``, and parametric multi-qubit operators have been added to
`qml.estimator.ops`.
[(#8255)](https://github.com/PennyLaneAI/pennylane/pull/8255)
* The resource templates ``SemiAdder``, ``QFT``, ``AQFT``, ``BasisRotation``, ``Select``,
``QROM``, ``SelectPauliRot``, ``QubitUnitary``, ``ControlledSequence``, ``QPE`` and
``IterativeQPE`` were added to `qml.estimator.ops`.
[(#8300)](https://github.com/PennyLaneAI/pennylane/pull/8300)

* Wires can now be dynamically allocated and deallocated in quantum functions with
:func:`~.allocate` and :func:`~.deallocate`. These features unlock many important applications
Expand Down
16 changes: 16 additions & 0 deletions pennylane/estimator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
MultiRZ,
PauliRot,
SingleExcitation,
QubitUnitary,
)

from .ops.op_math import (
Expand All @@ -68,3 +69,18 @@
Prod,
ChangeOpBasis,
)
from .templates import (
OutOfPlaceSquare,
PhaseGradient,
OutMultiplier,
SemiAdder,
QFT,
AQFT,
BasisRotation,
Select,
QROM,
SelectPauliRot,
ControlledSequence,
QPE,
IterativeQPE,
)
1 change: 1 addition & 0 deletions pennylane/estimator/ops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
PauliRot,
MultiRZ,
SingleExcitation,
QubitUnitary,
)

from .op_math import (
Expand Down
2 changes: 2 additions & 0 deletions pennylane/estimator/ops/qubit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@
from .parametric_ops_multi_qubit import MultiRZ, PauliRot

from .qchem_ops import SingleExcitation

from .matrix_ops import QubitUnitary
169 changes: 169 additions & 0 deletions pennylane/estimator/ops/qubit/matrix_ops.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# Copyright 2025 Xanadu Quantum Technologies Inc.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
r"""Resource operators for QubitUnitary operation."""
import pennylane.estimator as qre
from pennylane.estimator.resource_operator import (
CompressedResourceOp,
GateCount,
ResourceOperator,
resource_rep,
)
from pennylane.estimator.templates import SelectPauliRot
from pennylane.wires import WiresLike

# pylint: disable=arguments-differ


class QubitUnitary(ResourceOperator):
r"""Resource class for the QubitUnitary template.
Args:
num_wires (int): the number of qubits the operation acts upon
precision (Union[float, None], optional): The precision used when preparing the single qubit
rotations used to synthesize the n-qubit unitary.
wires (Sequence[int], None): the wires the operation acts on
Resources:
The resources are defined by combining the two equalities in `Möttönen and Vartiainen
(2005), Fig 14 <https://arxiv.org/pdf/quant-ph/0504100>`_ , we can express an :math:`n`
qubit unitary as four :math:`n - 1` qubit unitaries and three multiplexed rotations
via (:class:`~.pennylane.estimator.templates.subroutines.SelectPauliRot`). Specifically, the cost
is given by:
* 1-qubit unitary, the cost is approximated as a single :code:`RZ` rotation.
* 2-qubit unitary, the cost is approximated as four single qubit rotations and three :code:`CNOT` gates.
* 3-qubit unitary or more, the cost is given according to the reference above, recursively.
.. seealso:: The associated PennyLane operation :class:`~.pennylane.QubitUnitary`.
**Example**
The resources for this operation are computed using:
>>> import pennylane.estimator as qre
>>> qu = qre.QubitUnitary(num_wires=3)
>>> print(qre.estimate(qu, gate_set))
--- Resources: ---
Total qubits: 3
Total gates : 52
Qubit breakdown:
zeroed qubits: 0, any_state qubits: 0, algorithmic qubits: 3
Gate breakdown:
{'RZ': 24, 'CNOT': 24, 'RY': 4}
"""

resource_keys = {"num_wires", "precision"}

def __init__(self, num_wires: int, precision: float | None = None, wires: WiresLike = None):
self.num_wires = num_wires
self.precision = precision
super().__init__(wires=wires)

@property
def resource_params(self) -> dict:
r"""Returns a dictionary containing the minimal information needed to compute the resources.
Returns:
dict: A dictionary containing the resource parameters:
* num_wires (int): the number of qubits the operation acts upon
* precision (Union[float, None], optional): The precision used when preparing the
single qubit rotations used to synthesize the n-qubit unitary.
"""
return {"num_wires": self.num_wires, "precision": self.precision}

@classmethod
def resource_rep(cls, num_wires, precision=None) -> CompressedResourceOp:
r"""Returns a compressed representation containing only the parameters of
the Operator that are needed to compute the resources.
Args:
num_wires (int): the number of qubits the operation acts upon
precision (Union[float, None], optional): The precision used when preparing the single
qubit rotations used to synthesize the n-qubit unitary.
Returns:
:class:`~.pennylane.estimator.resource_operator.CompressedResourceOp`: the operator in a compressed representation
"""
params = {"num_wires": num_wires, "precision": precision}
return CompressedResourceOp(cls, num_wires, params)

@classmethod
def resource_decomp(cls, num_wires, precision=None) -> list[GateCount]:
r"""Returns a list representing the resources of the operator. Each object in the list
represents a gate and the number of times it occurs in the circuit.
Args:
num_wires (int): the number of qubits the operation acts upon
precision (Union[float, None], optional): The precision used when preparing the single
qubit rotations used to synthesize the n-qubit unitary.
Resources:
The resources are defined by combining the two equalities in `Möttönen and Vartiainen
(2005), Fig 14 <https://arxiv.org/pdf/quant-ph/0504100>`_, we can express an :math:`n`-
qubit unitary as four :math:`n - 1`-qubit unitaries and three multiplexed rotations
via (:class:`~.pennylane.estimator.templates.subroutines.SelectPauliRot`). Specifically, the cost
is given by:
* 1-qubit unitary, the cost is approximated as a single :code:`RZ` rotation.
* 2-qubit unitary, the cost is approximated as four single qubit rotations and three :code:`CNOT` gates.
* 3-qubit unitary or more, the cost is given according to the reference above, recursively.
Returns:
list[:class:`~.pennylane.estimator.resource_operator.GateCount`]: A list of GateCount objects, where each object
represents a specific quantum gate and the number of times it appears
in the decomposition.
"""
gate_lst = []

one_qubit_decomp_cost = [GateCount(resource_rep(qre.RZ, {"precision": precision}))]
two_qubit_decomp_cost = [
GateCount(resource_rep(qre.RZ, {"precision": precision}), 4),
GateCount(resource_rep(qre.CNOT), 3),
]

if num_wires == 1:
return one_qubit_decomp_cost

if num_wires == 2:
return two_qubit_decomp_cost

for gc in two_qubit_decomp_cost:
gate_lst.append(4 ** (num_wires - 2) * gc)

for index in range(2, num_wires):
multiplex_z = resource_rep(
SelectPauliRot,
{
"num_ctrl_wires": index,
"rot_axis": "Z",
"precision": precision,
},
)
multiplex_y = resource_rep(
SelectPauliRot,
{
"num_ctrl_wires": index,
"rot_axis": "Y",
"precision": precision,
},
)

gate_lst.append(GateCount(multiplex_z, 2 * 4 ** (num_wires - (1 + index))))
gate_lst.append(GateCount(multiplex_y, 4 ** (num_wires - (1 + index))))

return gate_lst
9 changes: 7 additions & 2 deletions pennylane/estimator/resource_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
r"""This module contains the ResourceConfig class, which tracks the configuration for resource estimation"""

from __future__ import annotations

from collections.abc import Callable
from enum import StrEnum
from typing import TYPE_CHECKING

from pennylane.estimator.ops.qubit import QubitUnitary
from pennylane.estimator.templates import SelectPauliRot

if TYPE_CHECKING:
from pennylane.estimator.resource_operator import ResourceOperator

Expand All @@ -40,7 +42,10 @@ class ResourceConfig:
def __init__(self) -> None:
_DEFAULT_PRECISION = 1e-9
_DEFAULT_BIT_PRECISION = 15
self.resource_op_precisions = {}
self.resource_op_precisions = {
SelectPauliRot: {"precision": _DEFAULT_PRECISION},
QubitUnitary: {"precision": _DEFAULT_PRECISION},
}
self._custom_decomps = {}
self._adj_custom_decomps = {}
self._ctrl_custom_decomps = {}
Expand Down
30 changes: 30 additions & 0 deletions pennylane/estimator/templates/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2025 Xanadu Quantum Technologies Inc.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
r"""This module contains resource templates."""

from .subroutines import (
OutOfPlaceSquare,
PhaseGradient,
OutMultiplier,
SemiAdder,
QFT,
AQFT,
BasisRotation,
Select,
QROM,
SelectPauliRot,
ControlledSequence,
QPE,
IterativeQPE,
)
Loading