iqm.benchmarks.compressive_gst.mgst.additional_fns.outcome_probs_from_files#
- iqm.benchmarks.compressive_gst.mgst.additional_fns.outcome_probs_from_files(folder_name: str, basis_dict: dict[str, int], n_povm: int, N: int) tuple[ndarray, int]#
Searches a specified folder for .txt files containing circuit outcomes and combines the results.
Each text file needs to have line in the following format: 1: 1,0,1,0,1,1,0,0,0 2: 1,1,1,1,0,1,1,1,1 Here the first number specifies the circuit and basis outcome of each shot is written to the right.
- Parameters:
folder_name (str) – The relative or absolute name of the data folder
basis_dict (dict[str, int]) – Translation between label for each shot in the .txt files and the numbering of the POVM element. Example (two qubits): {“00”: 0, “01”: 1, “10”: 2, “11”: 3,}
n_povm (int) – The number of POVM elements in the data set
N (int) – The number of circuits in the data set
- Returns:
- 2D array of measurement outcomes for all measured sequences; Each column contains the outcome probabilities
for a fixed sequence
avg_counts: The average number of shots per circuit after combining data sets
- Return type:
y