Skip to content

Commit

Permalink
Merge branch 'main' into register_qubit
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-pasquale committed Oct 19, 2023
2 parents 159eed0 + 9abd302 commit df76391
Show file tree
Hide file tree
Showing 46 changed files with 1,416 additions and 299 deletions.
43 changes: 40 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion src/qibocal/auto/operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ def wrapper(*args, **kwds):
return wrapper


DEFAULT_PARENT_PARAMETERS = {
"nshots": None,
"relaxation_time": None,
}
"""Default values of the parameters of `Parameters`"""


class Parameters:
"""Generic action parameters.
Expand All @@ -70,14 +77,22 @@ def load(cls, parameters):
"""Load parameters from runcard.
Possibly looking into previous steps outputs.
Parameters defined in Parameters class are removed from `parameters`
before `cls` is created.
Then `nshots` and `relaxation_time` are assigned to cls.
.. todo::
move the implementation to History, since it is required to resolve
the linked outputs
"""
return cls(**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():
setattr(instantiated_class, parameter, value)
return instantiated_class


class Data:
Expand Down
10 changes: 10 additions & 0 deletions src/qibocal/protocols/characterization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
from .allxy.drag_pulse_tuning import drag_pulse_tuning
from .classification import single_shot_classification
from .coherence.spin_echo import spin_echo
from .coherence.spin_echo_msr import spin_echo_msr
from .coherence.t1 import t1
from .coherence.t1_msr import t1_msr
from .coherence.t1_sequences import t1_sequences
from .coherence.t2 import t2
from .coherence.t2_msr import t2_msr
from .coherence.t2_sequences import t2_sequences
from .coherence.zeno import zeno
from .coherence.zeno_msr import zeno_msr
from .dispersive_shift import dispersive_shift
from .fast_reset.fast_reset import fast_reset
from .flipping import flipping
Expand All @@ -23,6 +27,7 @@
from .rabi.length import rabi_length
from .rabi.length_sequences import rabi_length_sequences
from .ramsey import ramsey
from .ramsey_msr import ramsey_msr
from .ramsey_sequences import ramsey_sequences
from .randomized_benchmarking.standard_rb import standard_rb
from .readout_characterization import readout_characterization
Expand Down Expand Up @@ -53,14 +58,18 @@ class Operation(Enum):
rabi_length = rabi_length
rabi_length_sequences = rabi_length_sequences
ramsey = ramsey
ramsey_msr = ramsey_msr
ramsey_sequences = ramsey_sequences
t1 = t1
t1_msr = t1_msr
t1_sequences = t1_sequences
t2 = t2
t2_msr = t2_msr
t2_sequences = t2_sequences
time_of_flight_readout = time_of_flight_readout
single_shot_classification = single_shot_classification
spin_echo = spin_echo
spin_echo_msr = spin_echo_msr
allxy = allxy
allxy_drag_pulse_tuning = allxy_drag_pulse_tuning
drag_pulse_tuning = drag_pulse_tuning
Expand All @@ -73,6 +82,7 @@ class Operation(Enum):
resonator_frequency = resonator_frequency
fast_reset = fast_reset
zeno = zeno
zeno_msr = zeno_msr
chsh_pulses = chsh_pulses
chsh_circuits = chsh_circuits
readout_mitigation_matrix = readout_mitigation_matrix
Expand Down
5 changes: 0 additions & 5 deletions src/qibocal/protocols/characterization/allxy/allxy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from dataclasses import dataclass, field
from typing import Optional

import numpy as np
import numpy.typing as npt
Expand All @@ -18,10 +17,6 @@ class AllXYParameters(Parameters):

beta_param: float = None
"""Beta parameter for drag pulse."""
nshots: Optional[int] = None
"""Number of shots."""
relaxation_time: Optional[int] = None
"""Relaxation time (ns)."""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ class AllXYDragParameters(Parameters):
"""Final beta parameter for Drag pulse."""
beta_step: float
"""Step beta parameter for Drag pulse."""
nshots: Optional[int] = None
"""Number of shots."""
relaxation_time: Optional[int] = None
"""Relaxation time (ns)."""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from dataclasses import dataclass, field
from typing import Optional

import numpy as np
import numpy.typing as npt
Expand Down Expand Up @@ -29,10 +28,6 @@ class DragPulseTuningParameters(allxy_drag_pulse_tuning.AllXYDragParameters):
"""DRAG pulse beta end sweep parameter."""
beta_step: float
"""DRAG pulse beta sweep step parameter."""
nshots: Optional[int] = None
"""Number of shots."""
relaxation_time: Optional[int] = None
"""Relaxation time (ns)."""


@dataclass
Expand Down
4 changes: 0 additions & 4 deletions src/qibocal/protocols/characterization/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@
class SingleShotClassificationParameters(Parameters):
"""SingleShotClassification runcard inputs."""

nshots: Optional[int] = None
"""Number of shots."""
relaxation_time: Optional[int] = None
"""Relaxation time (ns)."""
classifiers_list: Optional[list[str]] = field(default_factory=lambda: ["qubit_fit"])
"""List of models to classify the qubit states"""
savedir: Optional[str] = " "
Expand Down
Loading

0 comments on commit df76391

Please sign in to comment.