Skip to content

Commit

Permalink
update interface as well in resolve_execution_config
Browse files Browse the repository at this point in the history
  • Loading branch information
andrijapau committed Jan 29, 2025
1 parent f547bc8 commit 368eb16
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions pennylane/devices/execution_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
Contains the :class:`ExecutionConfig` data class.
"""
from dataclasses import dataclass, field
from pprint import pformat
from typing import Optional, Union

from pennylane.math import Interface, get_canonical_interface_name
Expand Down Expand Up @@ -136,5 +137,8 @@ def __post_init__(self):
elif not isinstance(self.mcm_config, MCMConfig):
raise ValueError(f"Got invalid type {type(self.mcm_config)} for 'mcm_config'")

def __str__(self):
return pformat(self)


DefaultExecutionConfig = ExecutionConfig()
6 changes: 3 additions & 3 deletions pennylane/workflow/construct_execution_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ def circuit(x):
gradient_keyword_arguments={},
device_options={'max_workers': None,
'prng_key': None,
'rng': Generator(PCG64) at 0x17CFBBA00},
interface=<Interface.AUTO: 'auto'>,
'rng': Generator(PCG64) at 0x15F6BB680},
interface=<Interface.NUMPY: 'numpy'>,
derivative_order=1,
mcm_config=MCMConfig(mcm_method=None, postselect_mode=None),
convert_to_numpy=True)
convert_to_numpy=True)
"""

@functools.wraps(qnode)
Expand Down
1 change: 1 addition & 0 deletions pennylane/workflow/resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ def _resolve_execution_config(
)
mcm_config = _resolve_mcm_config(execution_config.mcm_config, mcm_interface, finite_shots)

updated_values["interface"] = interface
updated_values["mcm_config"] = mcm_config

execution_config = replace(execution_config, **updated_values)
Expand Down

0 comments on commit 368eb16

Please sign in to comment.