diff --git a/src/qibocal/auto/operation.py b/src/qibocal/auto/operation.py index 81945f14a..00ef0529f 100644 --- a/src/qibocal/auto/operation.py +++ b/src/qibocal/auto/operation.py @@ -1,6 +1,7 @@ import inspect import json import time +from copy import deepcopy from dataclasses import asdict, dataclass from functools import wraps from typing import Callable, Generic, NewType, Optional, TypeVar, Union @@ -73,7 +74,7 @@ class Parameters: """Wait time for the qubit to decohere back to the `gnd` state""" @classmethod - def load(cls, parameters): + def load(cls, input_parameters): """Load parameters from runcard. Possibly looking into previous steps outputs. @@ -87,10 +88,12 @@ def load(cls, parameters): the linked outputs """ - for parameter, value in DEFAULT_PARENT_PARAMETERS.items(): - DEFAULT_PARENT_PARAMETERS[parameter] = parameters.pop(parameter, value) + default_parent_parameters = deepcopy(DEFAULT_PARENT_PARAMETERS) + parameters = deepcopy(input_parameters) + for parameter, value in default_parent_parameters.items(): + default_parent_parameters[parameter] = parameters.pop(parameter, value) instantiated_class = cls(**parameters) - for parameter, value in DEFAULT_PARENT_PARAMETERS.items(): + for parameter, value in default_parent_parameters.items(): setattr(instantiated_class, parameter, value) return instantiated_class diff --git a/src/qibocal/auto/task.py b/src/qibocal/auto/task.py index ce82fad36..c4a700182 100644 --- a/src/qibocal/auto/task.py +++ b/src/qibocal/auto/task.py @@ -135,6 +135,12 @@ def run( task_qubits = self._allocate_local_qubits(qubits, platform) try: + if self.parameters.nshots is None: + self.action.parameters["nshots"] = platform.settings.nshots + if self.parameters.relaxation_time is None: + self.action.parameters[ + "relaxation_time" + ] = platform.settings.relaxation_time operation: Routine = self.operation parameters = self.parameters except RuntimeError: diff --git a/tests/runcards/protocols.yml b/tests/runcards/protocols.yml index f100f6c4a..891518cac 100644 --- a/tests/runcards/protocols.yml +++ b/tests/runcards/protocols.yml @@ -214,6 +214,15 @@ actions: pulse_length: 30 nshots: 1024 + - id: rabi without nshots + priority: 0 + operation: rabi_amplitude + parameters: + min_amp_factor: 0.0 + max_amp_factor: 4.0 + step_amp_factor: 0.1 + pulse_length: 30 + - id: rabi msr priority: 0 operation: rabi_amplitude_msr