iqm.benchmarks.benchmark_definition.add_counts_to_dataset

iqm.benchmarks.benchmark_definition.add_counts_to_dataset#

iqm.benchmarks.benchmark_definition.add_counts_to_dataset(counts: List[Dict[str, int]], identifier: str, dataset: Dataset)#

Adds the counts from a cortex job result to the given dataset. If counts with the same identifier are already present in the old dataset, then both counts are added together.

Parameters:
  • counts (List[Dict[str, int]]) – A list of dictionaries with counts of bitstrings.

  • identifier (str) – A string to identify the current data, for instance the qubit layout.

  • dataset (xr.Dataset) – Dataset to add results to.

Returns:

xarray.Dataset

A merged dataset where the new counts are added the input dataset

Return type:

dataset_merged