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

Fix stopping condition thresholds #609

Merged
merged 7 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
3 changes: 3 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@

### Bug fixes

* Ensure the stopping condition decompositions are respected for larger templated QFT and Grover operators.
[(#609)](https://github.com/PennyLaneAI/pennylane-lightning/pull/609)

* Move concurrency group specifications from reusable Docker build workflow to the root workflows.
[(#604)](https://github.com/PennyLaneAI/pennylane-lightning/pull/604)

Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.35.0-dev11"
__version__ = "0.35.0-dev12"
8 changes: 4 additions & 4 deletions pennylane_lightning/core/lightning_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ def stopping_condition(self):
and observable) and returns ``True`` if supported by the device."""

def accepts_obj(obj):
if obj.name == "QFT" and len(obj.wires) < 10:
return True
if obj.name == "GroverOperator" and len(obj.wires) < 13:
return True
if obj.name == "QFT":
return len(obj.wires) < 10
if obj.name == "GroverOperator":
return len(obj.wires) < 13
return (not isinstance(obj, qml.tape.QuantumTape)) and getattr(
self, "supports_operation", lambda name: False
)(obj.name)
Expand Down
Loading