Skip to content

Commit

Permalink
feat: Split bin counts, to reuse in acquisition
Browse files Browse the repository at this point in the history
  • Loading branch information
alecandido committed Dec 12, 2024
1 parent a41f970 commit ac8d8d3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/qibolab/_core/execution_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,24 @@ class ExecutionParameters(Model):
top of platform defaults.
"""

def results_shape(
self, sweepers: list[ParallelSweepers], samples: Optional[int] = None
) -> tuple[int, ...]:
"""Compute the expected shape for collected data."""

def bins(self, sweepers: list[ParallelSweepers]) -> tuple[int, ...]:
assert self.nshots is not None
shots = (
(self.nshots,) if self.averaging_mode is AveragingMode.SINGLESHOT else ()
)
sweeps = tuple(
min(len(sweep.values) for sweep in parsweeps) for parsweeps in sweepers
)
return shots + sweeps

def results_shape(
self, sweepers: list[ParallelSweepers], samples: Optional[int] = None
) -> tuple[int, ...]:
"""Compute the expected shape for collected data."""

inner = {
AcquisitionType.DISCRIMINATION: (),
AcquisitionType.INTEGRATION: (2,),
AcquisitionType.RAW: (samples, 2),
}[self.acquisition_type]
return shots + sweeps + inner
return self.bins(sweepers) + inner

0 comments on commit ac8d8d3

Please sign in to comment.