Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 doc/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@
* `default.qubit` will default to the tree-traversal MCM method when `mcm_method="device"`.
[(#7885)](https://github.com/PennyLaneAI/pennylane/pull/7885)

* The default implementation of `Device.setup_execution_config` now choses `"device"` as the default mcm method if it is available as specified by the device TOML file.
[(#7968)](https://github.com/PennyLaneAI/pennylane/pull/7968)

<h4>Resource-efficient decompositions 🔎</h4>

* With :func:`~.decomposition.enable_graph()`, dynamically allocated wires are now supported in decomposition rules. This provides a smoother overall experience when decomposing operators in a way that requires auxiliary/work wires.
Expand Down
8 changes: 3 additions & 5 deletions pennylane/devices/device_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,12 +1042,10 @@ def _default_mcm_method(capabilities: DeviceCapabilities, shots_present: bool) -
supports_one_shot = "one-shot" in capabilities.supported_mcm_methods
has_device_support = "device" in capabilities.supported_mcm_methods

# In finite shots mode, the one-shot method is the default even if there is device support.
# This is to ensure consistency with old behaviour. Although I'm not too sure about this.
if supports_one_shot and shots_present:
return "one-shot"

if has_device_support:
return "device"

if supports_one_shot and shots_present:
return "one-shot"

return "deferred"
2 changes: 1 addition & 1 deletion tests/devices/test_device_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def execute(self, circuits, execution_config=DefaultExecutionConfig):
(EXAMPLE_TOML_FILE, None, "deferred"),
(EXAMPLE_TOML_FILE_ONE_SHOT, 10, "one-shot"),
(EXAMPLE_TOML_FILE_ONE_SHOT, None, "deferred"),
(EXAMPLE_TOML_FILE_ALL_SUPPORT, 10, "one-shot"),
(EXAMPLE_TOML_FILE_ALL_SUPPORT, 10, "device"),
(EXAMPLE_TOML_FILE_ALL_SUPPORT, None, "device"),
],
indirect=("create_temporary_toml_file",),
Expand Down