iqm-benchmarks 2.30__py3-none-any.whl → 2.32__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)
@@ -162,21 +162,7 @@ def plot_layout_fidelity_graph(
162
162
  for qb in {qb for layout in qubit_layouts for qb in layout}:
163
163
  node_colors[qb] = "orange"
164
164
 
165
- # Ensuring weights are in correct order for the plot
166
- edge_list = graph.edge_list()
167
- weights_dict = {}
168
- edge_pos = set()
169
-
170
- # Create a mapping between edge positions as defined in rustworkx and their weights
171
- for e, w in zip(edge_list, weights):
172
- pos_tuple = (tuple(pos[e[0]]), tuple(pos[e[1]]))
173
- weights_dict[pos_tuple] = w
174
- edge_pos.add(pos_tuple)
175
-
176
- # Get corresponding weights in the same order
177
- weights_ordered = np.array([weights_dict[edge] for edge in list(edge_pos)])
178
-
179
- plt.subplots(figsize=(6, 6))
165
+ plt.subplots(figsize=(1.5 * np.sqrt(len(nodes)), 1.5 * np.sqrt(len(nodes))))
180
166
 
181
167
  # Draw the graph
182
168
  visualization.mpl_draw(
@@ -185,7 +171,7 @@ def plot_layout_fidelity_graph(
185
171
  node_color=node_colors,
186
172
  pos=pos,
187
173
  labels=lambda node: node,
188
- width=7 * weights_ordered / np.max(weights_ordered),
174
+ width=7 * weights / np.max(weights),
189
175
  ) # type: ignore[call-arg]
190
176
 
191
177
  # Add edge labels using matplotlib's annotate
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iqm-benchmarks
3
- Version: 2.30
3
+ Version: 2.32
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
@@ -5,11 +5,11 @@ iqm/benchmarks/circuit_containers.py,sha256=anEtZEsodYqOX-34oZRmuKGeEpp_VfgG5045
5
5
  iqm/benchmarks/logging_config.py,sha256=U7olP5Kr75AcLJqNODf9VBhJLVqIvA4AYR6J39D5rww,1052
6
6
  iqm/benchmarks/readout_mitigation.py,sha256=Q2SOGWTNgmklOYkNxepAaSaXlxSj0QQyymYY1bOkT8A,11756
7
7
  iqm/benchmarks/utils.py,sha256=2aEwFhZAHBmqLjSMtnqjuWcXCyMX3vpUfF-vqoeBIHw,38517
8
- iqm/benchmarks/utils_plots.py,sha256=gNeGf5bnZjvKGGSglCFLonbG3oOd_z30mCx66__cbEY,8035
8
+ iqm/benchmarks/utils_plots.py,sha256=5Fx4mmsxiHAv5mhZYQA1T0oNxoWMTnrPm1egZgkXUfc,7546
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
@@ -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.30.dist-info/licenses/LICENSE,sha256=2Ncb40-hqkTil78RPv3-YiJfKaJ8te9USJgliKqIdSY,11558
32
+ iqm_benchmarks-2.32.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.30.dist-info/METADATA,sha256=GqWud1_3cmWLoX17dQSHSp4SfZNFsPHTO0C0ptkeuT4,10710
44
- iqm_benchmarks-2.30.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
45
- iqm_benchmarks-2.30.dist-info/top_level.txt,sha256=3G23Z-1LGf-IOzTCUl6QwWqiQ3USz25Zt90Ihq192to,9
46
- iqm_benchmarks-2.30.dist-info/RECORD,,
43
+ iqm_benchmarks-2.32.dist-info/METADATA,sha256=3GQfUfAq5kpV8-6g_g-Wbkf6OjS6OpQBOrPe1Uq3DzI,10710
44
+ iqm_benchmarks-2.32.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
45
+ iqm_benchmarks-2.32.dist-info/top_level.txt,sha256=3G23Z-1LGf-IOzTCUl6QwWqiQ3USz25Zt90Ihq192to,9
46
+ iqm_benchmarks-2.32.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")