iqm-benchmarks 2.29__py3-none-any.whl → 2.31__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.

@@ -316,9 +316,7 @@ def generate_unit_rank_gate_results(
316
316
  bootstrap_pauli_coeffs = np.zeros((len(X_array), dataset.attrs["num_gates"], dataset.attrs["pdim"] ** 2))
317
317
  for i, X_ in enumerate(X_array):
318
318
  X_std, _, _ = compatibility.pp2std(X_, E_array[i], rho_array[i])
319
- U_opt_ = reporting.phase_opt(
320
- np.array([change_basis(X_std[j], "pp", "std") for j in range(dataset.attrs["num_gates"])]), K_target
321
- )
319
+ U_opt_ = reporting.phase_opt(X_std, K_target)
322
320
  pauli_coeffs_ = reporting.compute_sparsest_Pauli_Hamiltonian(U_opt_)
323
321
  bootstrap_pauli_coeffs[i, :, :] = pauli_coeffs_
324
322
  pauli_coeffs_low, pauli_coeffs_high = np.nanpercentile(bootstrap_pauli_coeffs, [2.5, 97.5], axis=0)
@@ -66,8 +66,8 @@ def plot_times(clops_data: xr.Dataset, observations: Dict[int, Dict[str, Dict[st
66
66
  """
67
67
  # Define the keys for different categories of times
68
68
  job_keys = ["submit_total", "compile_total", "execution_total"]
69
- user_keys = ["user_submit_total", "user_retrieve_total", "assign_parameters_total"]
70
69
  total_keys = ["job_total"]
70
+ user_keys = ["user_retrieve_total", "user_submit_total", "assign_parameters_total", "time_transpile"]
71
71
 
72
72
  # Define variables for dataset values
73
73
  qubits = clops_data.attrs["qubits"]
@@ -95,14 +95,10 @@ def plot_times(clops_data: xr.Dataset, observations: Dict[int, Dict[str, Dict[st
95
95
 
96
96
  fig_name = f"{num_qubits}_qubits_{tuple(qubits)}"
97
97
 
98
- # Plot total CLOPS time
99
- x_t = ax1.bar(4 * sep, clops_time, barsize, zorder=0, label="clops time", color=(colors[-1], alpha), edgecolor="k")
100
- ax1.bar_label(x_t, fmt=f"clops time: {clops_time:.2f}", fontsize=fontsize)
101
-
102
98
  # Plot user keys
103
99
  for i, (key, cumulative_value) in enumerate(zip(user_keys, np.cumsum([all_data[k] for k in user_keys]))):
104
100
  x = ax1.bar(
105
- 3 * sep,
101
+ 4 * sep,
106
102
  cumulative_value,
107
103
  barsize,
108
104
  zorder=1 - i / 10,
@@ -112,6 +108,10 @@ def plot_times(clops_data: xr.Dataset, observations: Dict[int, Dict[str, Dict[st
112
108
  )
113
109
  ax1.bar_label(x, fmt=f"{key.replace('_total', ' ').replace('_', ' ')}: {all_data[key]:.2f}", fontsize=fontsize)
114
110
 
111
+ # Plot total CLOPS time
112
+ x_t = ax1.bar(3 * sep, clops_time, barsize, zorder=0, color=(colors[-1], alpha), edgecolor="k")
113
+ ax1.bar_label(x_t, fmt=f"CLOPS time: {clops_time:.2f}", fontsize=fontsize)
114
+
115
115
  # Plot total keys
116
116
  for i, (key, cumulative_value) in enumerate(zip(total_keys, np.cumsum([all_data[k] for k in total_keys]))):
117
117
  x = ax1.bar(
@@ -139,13 +139,13 @@ def plot_times(clops_data: xr.Dataset, observations: Dict[int, Dict[str, Dict[st
139
139
  ax2.spines["bottom"].set_visible(False)
140
140
 
141
141
  # Set axis labels and limits
142
- ax1.set_ylabel("Total CLOPS time (seconds)")
143
- ax2.set_ylabel("Total CLOPS time (%)")
144
- ax1.set_ylim(-0.2, clops_time + 1)
142
+ ax1.set_ylabel("Total CLOPS experiment time (seconds)")
143
+ ax2.set_ylabel("Total CLOPS experiment time (%)")
144
+ ax1.set_ylim(-0.2, clops_time + all_data["assign_parameters_total"] + all_data["time_transpile"] + 1)
145
145
  ax2.set_ylim(-0.2, 100)
146
146
 
147
147
  # Set x-ticks and labels
148
- time_types = ["Remote (components)", "Remote (total)", "Wall-time (components)", "Wall-time (total)"]
148
+ time_types = ["Remote (components)", "Remote (total)", "Wall-time (CLOPS)", "Wall-time (all components)"]
149
149
  ax1.set_xticks([i * sep + 1 for i in range(4)], time_types, fontsize=fontsize)
150
150
 
151
151
  # Set plot title
@@ -671,7 +671,7 @@ class CLOPSBenchmark(Benchmark):
671
671
 
672
672
  dataset.attrs.update(
673
673
  {
674
- "clops_time": end_clops_timer - start_clops_timer,
674
+ "clops_time": end_clops_timer - start_clops_timer - sum(all_times_parameter_assign.values()),
675
675
  "all_times_parameter_assign": all_times_parameter_assign,
676
676
  "all_times_submit": all_times_submit,
677
677
  "all_times_retrieve": all_times_retrieve,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iqm-benchmarks
3
- Version: 2.29
3
+ Version: 2.31
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>, Adrian Auer <adrian.auer@meetiqm.com>, Raphael Brieger <raphael.brieger@meetiqm.com>, Alessio Calzona <alessio.calzona@meetiqm.com>, Pedro Figueroa Romero <pedro.romero@meetiqm.com>, Amin Hosseinkhani <amin.hosseinkhani@meetiqm.com>, Miikka Koistinen <miikka@meetiqm.com>, Nadia Milazzo <nadia.milazzo@meetiqm.com>, Vicente Pina Canelles <vicente.pina@meetiqm.com>, Aniket Rath <aniket.rath@meetiqm.com>, Jami Rönkkö <jami@meetiqm.com>, Stefan Seegerer <stefan.seegerer@meetiqm.com>
6
6
  Project-URL: Homepage, https://github.com/iqm-finland/iqm-benchmarks
@@ -9,14 +9,14 @@ iqm/benchmarks/utils_plots.py,sha256=gNeGf5bnZjvKGGSglCFLonbG3oOd_z30mCx66__cbEY
9
9
  iqm/benchmarks/utils_shadows.py,sha256=e77PV_uaAO5m_woox9lAzompKAvFeDJ-0AKJrNJ7NFg,9728
10
10
  iqm/benchmarks/compressive_gst/__init__.py,sha256=LneifgYXtcwo2jcXo7GdUEHL6_peipukShhkrdaTRCA,929
11
11
  iqm/benchmarks/compressive_gst/compressive_gst.py,sha256=2kiRttog4jR-vtMHu847GTFe5qL_i_uYr_4WMGqt9Ww,25653
12
- iqm/benchmarks/compressive_gst/gst_analysis.py,sha256=jA1MaXIyPBwxbN36mTjn_jKaRO5-NdoG0YV-RaujU3s,36450
12
+ iqm/benchmarks/compressive_gst/gst_analysis.py,sha256=y4Yk9v1N9DP91MieXTMIASzjoFlg2pCzkm4LhvEYi0k,36335
13
13
  iqm/benchmarks/entanglement/__init__.py,sha256=sHVVToRWRCz0LSntk1rQaoSNNeyZLPoiTjUKWZWrk1E,778
14
14
  iqm/benchmarks/entanglement/ghz.py,sha256=RGA6ynJFsfaCJv0nKccsiIzPk2G-iHHvIeW8LVu30HY,41249
15
15
  iqm/benchmarks/entanglement/graph_states.py,sha256=7IlPocwHbi_K_KQqTSVEaDfB7wLH9loTawqDnnaDYek,62528
16
16
  iqm/benchmarks/optimization/__init__.py,sha256=_ajW_OibYLCtzU5AUv5c2zuuVYn8ZNeZUcUUSIGt51M,747
17
17
  iqm/benchmarks/optimization/qscore.py,sha256=KOw8fjXeMwCjYvKukpX7IiAqRQrVTkrnIgKjNCPVWdw,38130
18
18
  iqm/benchmarks/quantum_volume/__init__.py,sha256=i-Q4SpDWELBw7frXnxm1j4wJRcxbIyrS5uEK_v06YHo,951
19
- iqm/benchmarks/quantum_volume/clops.py,sha256=fD_eh10qHv_W-_mCA-PjPDIxNJ5sqD7yDkK1UjRsAAo,31474
19
+ iqm/benchmarks/quantum_volume/clops.py,sha256=9_4xljndh4iUcyPRPvYaslpeye1XPH2u5O1FMfhr9Mk,31608
20
20
  iqm/benchmarks/quantum_volume/quantum_volume.py,sha256=pro7Lz-A5pPpT9UZ8wtXKTyhdWmTjQjRHt4BylDR-3U,36553
21
21
  iqm/benchmarks/randomized_benchmarking/__init__.py,sha256=IkKo-7zUChxZZd3my_csQCJfJfZNsV3-JTvdG8uqys4,734
22
22
  iqm/benchmarks/randomized_benchmarking/clifford_1q.pkl,sha256=yrmSJqhv7Lb1yqiqU9-2baqTljJPNmTUPQR-AH6GGfc,7800
@@ -29,18 +29,18 @@ iqm/benchmarks/randomized_benchmarking/interleaved_rb/__init__.py,sha256=sq6MgN_
29
29
  iqm/benchmarks/randomized_benchmarking/interleaved_rb/interleaved_rb.py,sha256=TaR1YFWBhOgm1hmEQzuwLYpp0yl0Xpuo3jAT6YhiXpc,28471
30
30
  iqm/benchmarks/randomized_benchmarking/mirror_rb/__init__.py,sha256=ZekEqI_89nXzGO1vjM-b5Uwwicy59M4fYHXfA-f0MIg,674
31
31
  iqm/benchmarks/randomized_benchmarking/mirror_rb/mirror_rb.py,sha256=_xdp8XLPcZyuqy7Xz8-K8H7zjgRo9ZxFiDgCXE72gaE,34997
32
- iqm_benchmarks-2.29.dist-info/licenses/LICENSE,sha256=2Ncb40-hqkTil78RPv3-YiJfKaJ8te9USJgliKqIdSY,11558
32
+ iqm_benchmarks-2.31.dist-info/licenses/LICENSE,sha256=2Ncb40-hqkTil78RPv3-YiJfKaJ8te9USJgliKqIdSY,11558
33
33
  mGST/LICENSE,sha256=TtHNq55cUcbglb7uhVudeBLUh_qPdUoAEvU0BBwFz-k,1098
34
34
  mGST/README.md,sha256=v_5kw253csHF4-RfE-44KqFmBXIsSMRmOtN0AUPrRxE,5050
35
35
  mGST/additional_fns.py,sha256=_SEJ10FRNM7_CroysT8hCLZTfpm6ZhEIDCY5zPTnhjo,31390
36
- mGST/algorithm.py,sha256=QnxLJtxZysggLUtbZE-c2MWaFclZB2XUVJhvrmUvjVs,26315
36
+ mGST/algorithm.py,sha256=mXcDG9_0j3hVjxLyc585dsj_yvydfrWNlCrcnUOQHPw,26625
37
37
  mGST/compatibility.py,sha256=00DsPnNfOtrQcDTvxBDs-0aMhmuXmOIIxl_Ohy-Emkg,8920
38
38
  mGST/low_level_jit.py,sha256=uE1D3v01FbPpsbP92C4220OQalzOfxgL1Ku89BNkxLY,27377
39
39
  mGST/optimization.py,sha256=YHwkzIkYvsZOPjclR-BCQWh24jeqjuXp0BB0WX5Lwow,10559
40
40
  mGST/qiskit_interface.py,sha256=ajx6Zn5FnrX_T7tMP8xnBLyG4c2ddFRm0Fu2_3r1t30,10118
41
41
  mGST/reporting/figure_gen.py,sha256=6Xd8vwfy09hLY1YbJY6TRevuMsQSU4MsWqemly3ZO0I,12970
42
42
  mGST/reporting/reporting.py,sha256=B8NWfpZrrSmyH7lwZxd0EbZMYLsAGK1YsHRB4D5qXH4,26002
43
- iqm_benchmarks-2.29.dist-info/METADATA,sha256=SY72V4WZ3XtM8E7x5jYmTn-7lScCOjbwd1he-TFOzuo,10710
44
- iqm_benchmarks-2.29.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
45
- iqm_benchmarks-2.29.dist-info/top_level.txt,sha256=3G23Z-1LGf-IOzTCUl6QwWqiQ3USz25Zt90Ihq192to,9
46
- iqm_benchmarks-2.29.dist-info/RECORD,,
43
+ iqm_benchmarks-2.31.dist-info/METADATA,sha256=q-6NOPnr9dvN0ZQ1clPFZ4nFhgd38se5bR8tC_MxsdA,10710
44
+ iqm_benchmarks-2.31.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
45
+ iqm_benchmarks-2.31.dist-info/top_level.txt,sha256=3G23Z-1LGf-IOzTCUl6QwWqiQ3USz25Zt90Ihq192to,9
46
+ iqm_benchmarks-2.31.dist-info/RECORD,,
mGST/algorithm.py CHANGED
@@ -688,30 +688,30 @@ def run_mGST(
688
688
  K, E = (init[0], init[1])
689
689
  # offset small negative eigenvalues for stability
690
690
  rho = init[2] + 1e-14 * np.eye(pdim).reshape(-1)
691
- max_inits = 0
691
+ A = np.array([la.cholesky(E[k].reshape(pdim, pdim) + 1e-14 * np.eye(pdim)).T.conj() for k in range(n_povm)])
692
+ B = la.cholesky(rho.reshape(pdim, pdim))
693
+ X = np.einsum("ijkl,ijnm -> iknlm", K, K.conj()).reshape((d, r, r))
694
+ res_list = [objf(X, E, rho, J, y)]
692
695
  else:
693
- K, _, E, rho = random_gs(d, r, rK, n_povm)
694
-
695
- A = np.array([la.cholesky(E[k].reshape(pdim, pdim) + 1e-14 * np.eye(pdim)).T.conj() for k in range(n_povm)])
696
- B = la.cholesky(rho.reshape(pdim, pdim))
697
- X = np.einsum("ijkl,ijnm -> iknlm", K, K.conj()).reshape((d, r, r))
698
- res_list = [objf(X, E, rho, J, y)]
699
-
700
- for i in range(max_inits):
701
- with logging_redirect_tqdm(loggers=[qcvv_logger]):
702
- for _ in trange(max_iter):
703
- yb, Jb = batch(y, J, bsize)
704
- K, X, E, rho, A, B = optimize(yb, Jb, d, r, rK, n_povm, method, K, rho, A, B, fixed_elements)
705
- res_list.append(objf(X, E, rho, J, y))
706
- if res_list[-1] < delta:
707
- qcvv_logger.info(f"Batch optimization successful, improving estimate over full data....")
708
- success = True
709
- break
710
- if testing:
711
- plot_objf(res_list, delta, f"Objective function for batch optimization")
712
- if success:
713
- break
714
- qcvv_logger.info(f"Run ", i, f"failed, trying new initialization...")
696
+ for i in range(max_inits):
697
+ K, X, E, rho = random_gs(d, r, rK, n_povm)
698
+ A = np.array([la.cholesky(E[k].reshape(pdim, pdim) + 1e-14 * np.eye(pdim)).T.conj() for k in range(n_povm)])
699
+ B = la.cholesky(rho.reshape(pdim, pdim))
700
+ res_list = [objf(X, E, rho, J, y)]
701
+ with logging_redirect_tqdm(loggers=[qcvv_logger]):
702
+ for _ in trange(max_iter):
703
+ yb, Jb = batch(y, J, bsize)
704
+ K, X, E, rho, A, B = optimize(yb, Jb, d, r, rK, n_povm, method, K, rho, A, B, fixed_elements)
705
+ res_list.append(objf(X, E, rho, J, y))
706
+ if res_list[-1] < delta:
707
+ qcvv_logger.info(f"Batch optimization successful, improving estimate over full data....")
708
+ success = True
709
+ break
710
+ if testing:
711
+ plot_objf(res_list, delta, f"Objective function for batch optimization")
712
+ if success:
713
+ break
714
+ qcvv_logger.info(f"Run {i+1}/{max_inits} failed, trying new initialization...")
715
715
 
716
716
  if not success and max_inits > 0:
717
717
  qcvv_logger.info(f"Success threshold not reached, attempting optimization over full data set...")
@@ -719,7 +719,7 @@ def run_mGST(
719
719
  for _ in trange(final_iter):
720
720
  K, X, E, rho, A, B = optimize(y, J, d, r, rK, n_povm, method, K, rho, A, B, fixed_elements)
721
721
  res_list.append(objf(X, E, rho, J, y))
722
- if np.abs(res_list[-2] - res_list[-1]) < delta * target_rel_prec:
722
+ if len(res_list) >= 2 and np.abs(res_list[-2] - res_list[-1]) < delta * target_rel_prec:
723
723
  break
724
724
  if testing:
725
725
  plot_objf(res_list, delta, f"Objective function over batches and full data")