From 368eb16aaca095ab1d87a6d58be12cefef0411d7 Mon Sep 17 00:00:00 2001 From: andrijapau Date: Wed, 29 Jan 2025 17:04:25 -0500 Subject: [PATCH] update interface as well in resolve_execution_config --- pennylane/devices/execution_config.py | 4 ++++ pennylane/workflow/construct_execution_config.py | 6 +++--- pennylane/workflow/resolution.py | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pennylane/devices/execution_config.py b/pennylane/devices/execution_config.py index 17c9363b76f..c0cdce89204 100644 --- a/pennylane/devices/execution_config.py +++ b/pennylane/devices/execution_config.py @@ -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 @@ -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() diff --git a/pennylane/workflow/construct_execution_config.py b/pennylane/workflow/construct_execution_config.py index 9182d733f15..0b13700d552 100644 --- a/pennylane/workflow/construct_execution_config.py +++ b/pennylane/workflow/construct_execution_config.py @@ -72,11 +72,11 @@ def circuit(x): gradient_keyword_arguments={}, device_options={'max_workers': None, 'prng_key': None, - 'rng': Generator(PCG64) at 0x17CFBBA00}, - interface=, + 'rng': Generator(PCG64) at 0x15F6BB680}, + interface=, derivative_order=1, mcm_config=MCMConfig(mcm_method=None, postselect_mode=None), - convert_to_numpy=True) + convert_to_numpy=True) """ @functools.wraps(qnode) diff --git a/pennylane/workflow/resolution.py b/pennylane/workflow/resolution.py index d89a03c6e2d..1ec5f656fc0 100644 --- a/pennylane/workflow/resolution.py +++ b/pennylane/workflow/resolution.py @@ -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)