iqm-benchmarks 2.10__py3-none-any.whl → 2.11__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of iqm-benchmarks might be problematic. Click here for more details.

@@ -128,6 +128,12 @@ def clifford_rb_analysis(run: BenchmarkRunResult) -> BenchmarkAnalysisResult:
128
128
  "avg_gate_fidelity": {"value": fidelity.value, "uncertainty": fidelity.stderr},
129
129
  }
130
130
 
131
+ if len(qubits) == 1:
132
+ fidelity_native = rb_fit_results.params["fidelity_per_native_sqg"]
133
+ processed_results.update(
134
+ {"avg_native_gate_fidelity": {"value": fidelity_native.value, "uncertainty": fidelity_native.stderr}}
135
+ )
136
+
131
137
  dataset.attrs[qubits_idx].update(
132
138
  {
133
139
  "decay_rate": {"value": popt["decay_rate"].value, "uncertainty": popt["decay_rate"].stderr},
@@ -75,6 +75,11 @@ def interleaved_rb_analysis(run: BenchmarkRunResult) -> BenchmarkAnalysisResult:
75
75
 
76
76
  interleaved_gate = dataset.attrs["interleaved_gate"]
77
77
  interleaved_gate_parameters = dataset.attrs["interleaved_gate_params"]
78
+ if interleaved_gate_parameters is None:
79
+ interleaved_gate_string = f"{interleaved_gate}"
80
+ else:
81
+ params_string = str(tuple(f"{x:.2f}" for x in interleaved_gate_parameters))
82
+ interleaved_gate_string = f"{interleaved_gate}{params_string}"
78
83
 
79
84
  simultaneous_fit = dataset.attrs["simultaneous_fit"]
80
85
 
@@ -138,6 +143,7 @@ def interleaved_rb_analysis(run: BenchmarkRunResult) -> BenchmarkAnalysisResult:
138
143
  [list_of_fidelities_clifford, list_of_fidelities_interleaved],
139
144
  "interleaved",
140
145
  simultaneous_fit,
146
+ interleaved_gate_string,
141
147
  )
142
148
  rb_fit_results = lmfit_minimizer(fit_parameters, fit_data, sequence_lengths, exponential_rb)
143
149
 
@@ -170,10 +176,31 @@ def interleaved_rb_analysis(run: BenchmarkRunResult) -> BenchmarkAnalysisResult:
170
176
  "avg_gate_fidelity": {"value": fidelity.value, "uncertainty": fidelity.stderr},
171
177
  }
172
178
 
179
+ if len(qubits) == 1 and rb_type == "clifford":
180
+ fidelity_native = rb_fit_results.params["fidelity_per_native_sqg"]
181
+ processed_results[rb_type].update(
182
+ {
183
+ "avg_gate_fidelity_native": {
184
+ "value": fidelity_native.value,
185
+ "uncertainty": fidelity_native.stderr,
186
+ }
187
+ }
188
+ )
189
+ elif len(qubits) == 2 and rb_type == "clifford" and interleaved_gate_string == "CZGate":
190
+ fidelity_native_sqg = rb_fit_results.params["fidelity_per_native_sqg"]
191
+ processed_results[rb_type].update(
192
+ {
193
+ "avg_gate_fidelity_native_sqg": {
194
+ "value": fidelity_native_sqg.value,
195
+ "uncertainty": fidelity_native_sqg.stderr,
196
+ }
197
+ }
198
+ )
199
+
173
200
  observations.extend(
174
201
  [
175
202
  BenchmarkObservation(
176
- name=f"{key}_{rb_type}",
203
+ name=f"{key}_{rb_type}" if "native" not in key else f"{key}",
177
204
  identifier=BenchmarkObservationIdentifier(qubits),
178
205
  value=values["value"],
179
206
  uncertainty=values["uncertainty"],
@@ -206,12 +233,6 @@ def interleaved_rb_analysis(run: BenchmarkRunResult) -> BenchmarkAnalysisResult:
206
233
  obs_dict.update({qubits_idx: processed_results})
207
234
 
208
235
  # Generate decay plots
209
- if interleaved_gate_parameters is None:
210
- interleaved_gate_string = f"{interleaved_gate}"
211
- else:
212
- params_string = str(tuple(f"{x:.2f}" for x in interleaved_gate_parameters))
213
- interleaved_gate_string = f"{interleaved_gate}{params_string}"
214
-
215
236
  fig_name, fig = plot_rb_decay(
216
237
  "irb",
217
238
  [qubits],
@@ -89,6 +89,7 @@ def fit_decay_lmfit(
89
89
  data: List[List[float]] | List[List[List[float]]],
90
90
  rb_identifier: str,
91
91
  simultaneous_fit_vars: Optional[List[str]] = None,
92
+ interleaved_gate_str: Optional[str] = None,
92
93
  ) -> Tuple[np.ndarray, Parameters]:
93
94
  """Perform a fitting routine for 0th-order (Ap^m+B) RB using lmfit
94
95
 
@@ -98,6 +99,7 @@ def fit_decay_lmfit(
98
99
  data (List[List[float]] | List[List[List[float]]]): the data to be fitted
99
100
  rb_identifier (str): the RB identifier, either "stdrb", "irb" or "mrb"
100
101
  simultaneous_fit_vars (List[str], optional): the list of variables used to fit simultaneously
102
+ interleaved_gate_str (Optional[str]): the name of the interleaved gate in IRB
101
103
  Returns:
102
104
  A tuple of fitting data (list of lists of average fidelities or polarizations) and MRB fit parameters
103
105
  """
@@ -125,6 +127,12 @@ def fit_decay_lmfit(
125
127
  )
126
128
  params.add(f"p_rb", expr=f"1-depolarization_probability_{1}")
127
129
  params.add(f"fidelity_per_clifford", expr=f"p_rb + (1 - p_rb) / (2**{n_qubits})")
130
+ if n_qubits == 1:
131
+ # The construction of the 1Q and 2Q Clifford gate dictionaries in "generate_2qubit_cliffords.ipynb"
132
+ # is based on the reference below; thus the expected amount of 1.875 native gates per Clifford
133
+ # Native gate set being {I, X(pi/2), X(pi), X(-pi/2), Y(pi/2), Y(pi), Y(-pi)} with X(a)=r(a,0), Y(a)=r(a,pi/2)
134
+ # Ref: Barends et al., Nature 508, 500-503 (2014); Eq.(S3) of arXiv:1402.4848 [quant-ph]
135
+ params.add("fidelity_per_native_sqg", expr=f"1 - (1 - (p_rb + (1 - p_rb) / (2**{n_qubits})))/1.875")
128
136
  else:
129
137
  params = create_multi_dataset_params(
130
138
  func, fit_data, initial_guesses=None, constraints=constraints, simultaneously_fit_vars=None
@@ -140,10 +148,24 @@ def fit_decay_lmfit(
140
148
  constraints=None,
141
149
  simultaneously_fit_vars=simultaneous_fit_vars,
142
150
  )
143
- params.add(f"p_rb", expr=f"1-depolarization_probability_{1}")
144
- params.add(f"fidelity_per_clifford", expr=f"p_rb + (1 - p_rb) / (2**{n_qubits})")
145
- params.add(f"p_irb", expr=f"1-depolarization_probability_{2}")
146
- params.add(f"interleaved_fidelity", expr=f"p_irb / p_rb + (1 - p_irb / p_rb) / (2**{n_qubits})")
151
+ params.add(f"p_rb", expr=f"1.0 - depolarization_probability_{1}")
152
+ params.add(f"fidelity_per_clifford", expr=f"p_rb + (1.0 - p_rb) / (2.0**{n_qubits})")
153
+ params.add(f"p_irb", expr=f"1.0 - depolarization_probability_{2}")
154
+ params.add(f"interleaved_fidelity", expr=f"p_irb / p_rb + (1.0 - p_irb / p_rb) / (2.0**{n_qubits})")
155
+ if n_qubits == 1:
156
+ # The construction of the 1Q and 2Q Clifford gate dictionaries in "generate_2qubit_cliffords.ipynb"
157
+ # is based on the reference below; thus the expected amount of 1.875 native gates per Clifford
158
+ # Native gate set being {I, X(pi/2), X(pi), X(-pi/2), Y(pi/2), Y(pi), Y(-pi)} with X(a)=r(a,0), Y(a)=r(a,pi/2)
159
+ # Ref: Barends et al., Nature 508, 500-503 (2014); Eq.(S3) of arXiv:1402.4848 [quant-ph]
160
+ # For IRB it may be used as proxy to how well (or bad) the assumption of uniform fidelity in native sqg gates holds.
161
+ params.add("fidelity_per_native_sqg", expr=f"1.0 - (1.0 - fidelity_per_clifford)/1.875")
162
+ elif n_qubits == 2 and interleaved_gate_str == "CZGate":
163
+ # Here similarly, we may use Eq.(S8 - S11) of arXiv:1402.4848 [quant-ph]
164
+ params.add(f"fidelity_clifford_and_interleaved", expr=f"p_irb + (1.0 - p_irb) / (2.0 ** {n_qubits})")
165
+ params.add(
166
+ "fidelity_per_native_sqg",
167
+ expr=f"(1.0 / 33.0) * (4.0 * fidelity_clifford_and_interleaved - 10.0 * interleaved_fidelity + 39.0)",
168
+ )
147
169
 
148
170
  return fit_data, params
149
171
 
@@ -578,6 +600,8 @@ def plot_rb_decay(
578
600
  stddevs_from_mean = {}
579
601
  fidelity_value = {}
580
602
  fidelity_stderr = {}
603
+ fidelity_native1q_value = {}
604
+ fidelity_native1q_stderr = {}
581
605
  decay_rate = {}
582
606
  offset = {}
583
607
  amplitude = {}
@@ -618,6 +642,14 @@ def plot_rb_decay(
618
642
  str(q): dataset.attrs[q_idx]["avg_fidelities_stderr"]
619
643
  for q_idx, q in enumerate(qubits_array, qubits_index)
620
644
  }
645
+ fidelity_native1q_value[identifier] = {
646
+ str(q): observations[q_idx]["avg_native_gate_fidelity"]["value"] if len(q) == 1 else np.nan
647
+ for q_idx, q in enumerate(qubits_array, qubits_index)
648
+ }
649
+ fidelity_native1q_stderr[identifier] = {
650
+ str(q): observations[q_idx]["avg_native_gate_fidelity"]["uncertainty"] if len(q) == 1 else np.nan
651
+ for q_idx, q in enumerate(qubits_array, qubits_index)
652
+ }
621
653
  # These are common to both MRB and standard Clifford
622
654
  fidelity_value[identifier] = {
623
655
  str(q): observations[q_idx]["avg_gate_fidelity"]["value"]
@@ -636,7 +668,7 @@ def plot_rb_decay(
636
668
  amplitude[identifier] = {
637
669
  str(q): dataset.attrs[q_idx]["fit_amplitude"]["value"] for q_idx, q in enumerate(qubits_array, qubits_index)
638
670
  }
639
- else: # id MRB
671
+ else: # id IRB
640
672
  rb_type_keys = list(observations[0].keys())
641
673
  colors = [cmap(i) for i in np.linspace(start=1, stop=0, num=len(rb_type_keys)).tolist()]
642
674
  for rb_type in rb_type_keys:
@@ -791,12 +823,12 @@ def plot_rb_decay(
791
823
  if identifier == "mrb":
792
824
  plot_label = fr"$\overline{{F}}_{{MRB}} (n={len(qubits)})$ = {100.0 * fidelity_value[key][str(qubits)]:.2f} +/- {100.0 * fidelity_stderr[key][str(qubits)]:.2f} (%)"
793
825
  elif key == "interleaved":
794
- plot_label = fr"$\overline{{F}}_{{{interleaved_gate}}} ({qubits})$ = {100.0 * fidelity_value[key][str(qubits)]:.2f} +/- {100.0 * fidelity_stderr[key][str(qubits)]:.2f} (%)"
795
- else:
796
- print(fidelity_value)
797
- print(qubits)
798
- print(key)
799
- plot_label = fr"$\overline{{F}}_{{CRB}}$ = {100.0 * fidelity_value[key][str(qubits)]:.2f} +/- {100.0 * fidelity_stderr[key][str(qubits)]:.2f} (%)"
826
+ plot_label = fr"$\overline{{F}}_{{{interleaved_gate}}}$ = {100.0 * fidelity_value[key][str(qubits)]:.2f} +/- {100.0 * fidelity_stderr[key][str(qubits)]:.2f} (%)"
827
+ else: # if id is "clifford"
828
+ if len(qubits) == 1 and identifier != "irb":
829
+ plot_label = fr"$\overline{{F}}_{{native\_sqg}} \simeq$ {100.0 * fidelity_native1q_value[key][str(qubits)]:.2f} +/- {100.0 * fidelity_native1q_stderr[key][str(qubits)]:.2f} (%)"
830
+ else:
831
+ plot_label = fr"$\overline{{F}}_{{CRB}}$ = {100.0 * fidelity_value[key][str(qubits)]:.2f} +/- {100.0 * fidelity_stderr[key][str(qubits)]:.2f} (%)"
800
832
 
801
833
  ax.plot(
802
834
  x_linspace,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: iqm-benchmarks
3
- Version: 2.10
3
+ Version: 2.11
4
4
  Summary: A package for implementation of Quantum Characterization, Verification and Validation (QCVV) techniques on IQM's hardware at gate level abstraction
5
5
  Author-email: IQM Finland Oy <developers@meetiqm.com>, Aniket Rath <aniket.rath@meetiqm.com>, Jami Rönkkö <jami@meetiqm.com>, Pedro Figueroa Romero <pedro.romero@meetiqm.com>, Vicente Pina Canelles <vicente.pina@meetiqm.com>, Raphael Brieger <raphael.brieger@meetiqm.com>, Stefan Seegerer <stefan.seegerer@meetiqm.com>, Miikka Koistinen <miikka@meetiqm.com>
6
6
  Project-URL: Homepage, https://github.com/iqm-finland/iqm-benchmarks
@@ -19,11 +19,11 @@ iqm/benchmarks/randomized_benchmarking/__init__.py,sha256=IkKo-7zUChxZZd3my_csQC
19
19
  iqm/benchmarks/randomized_benchmarking/clifford_1q.pkl,sha256=vvSd0pRWxtzyirohO9yf_58mjevkc2-pbuWIEb-4gaw,46928
20
20
  iqm/benchmarks/randomized_benchmarking/clifford_2q.pkl,sha256=ZipqU3crPhz2T35qGFgB4GvMyoi_7pnu8NqW5ZP8NXg,90707258
21
21
  iqm/benchmarks/randomized_benchmarking/multi_lmfit.py,sha256=Se1ygR4mXn_2_P82Ch31KBnCmY-g_A9NKzE9Ir8nEvw,3247
22
- iqm/benchmarks/randomized_benchmarking/randomized_benchmarking_common.py,sha256=7vp2BEXSYz3Q7u_42qPKlQtdWPAI-a90tmtlhThWLjg,38809
22
+ iqm/benchmarks/randomized_benchmarking/randomized_benchmarking_common.py,sha256=xMiQyikGEVj3zoFQfVMS50K15MszArc0kiBWvZ7gWL8,41492
23
23
  iqm/benchmarks/randomized_benchmarking/clifford_rb/__init__.py,sha256=bTDA156LAl7OLGcMec--1nzDrV1XpPRVq3CquTmucgE,677
24
- iqm/benchmarks/randomized_benchmarking/clifford_rb/clifford_rb.py,sha256=q8bHcrVr8EjTuLeOdg3RoeoLaZhmieCd09IvH-tSvYs,18038
24
+ iqm/benchmarks/randomized_benchmarking/clifford_rb/clifford_rb.py,sha256=v8GDsEC3JscZVJXc6ZqfJaaSb1LocdFTSeOcwHxp50Y,18317
25
25
  iqm/benchmarks/randomized_benchmarking/interleaved_rb/__init__.py,sha256=sq6MgN_hwlpkOj10vyCU4e6eKSX-oLcF2L9na6W2Gt4,681
26
- iqm/benchmarks/randomized_benchmarking/interleaved_rb/interleaved_rb.py,sha256=PlHn1J8VPaJF5csNH8jxcifz_MdisOEPU54kU-FYoLY,26920
26
+ iqm/benchmarks/randomized_benchmarking/interleaved_rb/interleaved_rb.py,sha256=4hBjIXxqy18WKC8hgpCU6T6Vv2cvJu4AImj7QQDqI1k,27956
27
27
  iqm/benchmarks/randomized_benchmarking/mirror_rb/__init__.py,sha256=ZekEqI_89nXzGO1vjM-b5Uwwicy59M4fYHXfA-f0MIg,674
28
28
  iqm/benchmarks/randomized_benchmarking/mirror_rb/mirror_rb.py,sha256=pOEnEtuJ0rMnTq5nZ1obsQ6LOIVlgFcgNGc8CULWz6E,33987
29
29
  mGST/LICENSE,sha256=TtHNq55cUcbglb7uhVudeBLUh_qPdUoAEvU0BBwFz-k,1098
@@ -36,8 +36,8 @@ mGST/optimization.py,sha256=YHwkzIkYvsZOPjclR-BCQWh24jeqjuXp0BB0WX5Lwow,10559
36
36
  mGST/qiskit_interface.py,sha256=L4H-4SdhP_bjSFFvpQoF1E7EyGbIJ_CI_y4a7_YEwmU,10102
37
37
  mGST/reporting/figure_gen.py,sha256=6Xd8vwfy09hLY1YbJY6TRevuMsQSU4MsWqemly3ZO0I,12970
38
38
  mGST/reporting/reporting.py,sha256=We1cccz9BKbITYcSlZHdmBGdjMWAa1xNZe5tKP-yh_E,26004
39
- iqm_benchmarks-2.10.dist-info/LICENSE,sha256=2Ncb40-hqkTil78RPv3-YiJfKaJ8te9USJgliKqIdSY,11558
40
- iqm_benchmarks-2.10.dist-info/METADATA,sha256=C5JusUPjsH27GKfP6gT5Y1unrN2SiSh2eD0nVI2-ih4,10171
41
- iqm_benchmarks-2.10.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
42
- iqm_benchmarks-2.10.dist-info/top_level.txt,sha256=3G23Z-1LGf-IOzTCUl6QwWqiQ3USz25Zt90Ihq192to,9
43
- iqm_benchmarks-2.10.dist-info/RECORD,,
39
+ iqm_benchmarks-2.11.dist-info/LICENSE,sha256=2Ncb40-hqkTil78RPv3-YiJfKaJ8te9USJgliKqIdSY,11558
40
+ iqm_benchmarks-2.11.dist-info/METADATA,sha256=vijW3YgqFM3XIVA7uHSImcjeRR5Sr2b9a75a_zetmrQ,10171
41
+ iqm_benchmarks-2.11.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
42
+ iqm_benchmarks-2.11.dist-info/top_level.txt,sha256=3G23Z-1LGf-IOzTCUl6QwWqiQ3USz25Zt90Ihq192to,9
43
+ iqm_benchmarks-2.11.dist-info/RECORD,,