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

@@ -24,6 +24,7 @@ from time import strftime
24
24
  from typing import List, Optional, OrderedDict, Union
25
25
 
26
26
  from iqm.benchmarks.benchmark import BenchmarkBase, BenchmarkConfigurationBase
27
+ from iqm.benchmarks.logging_config import qcvv_logger
27
28
  from iqm.benchmarks.utils import get_iqm_backend
28
29
  from iqm.qiskit_iqm.iqm_backend import IQMBackendBase
29
30
 
@@ -52,15 +53,14 @@ class BenchmarkExperiment:
52
53
  """
53
54
  self.timestamp = strftime("%Y%m%d-%H%M%S")
54
55
 
55
- self.device_id = device_id if device_id is not None else backend
56
-
57
56
  if isinstance(backend, str):
58
57
  self.backend = get_iqm_backend(backend)
59
-
60
58
  else:
61
59
  assert isinstance(backend, IQMBackendBase)
62
60
  self.backend = backend
63
61
 
62
+ self.device_id = device_id if device_id is not None else self.backend.name
63
+
64
64
  benchmarks: OrderedDict[str, BenchmarkBase] = OrderedDict(
65
65
  (config.benchmark.name(), config.benchmark(self.backend, config)) for config in benchmark_configurations
66
66
  )
@@ -74,7 +74,7 @@ class BenchmarkExperiment:
74
74
  """Run the Benchmark experiment, and store the configuration, raw data, results and figures."""
75
75
 
76
76
  for name, benchmark in self.benchmarks.items():
77
- print("\nNow executing " + name)
77
+ qcvv_logger.info("\nNow executing " + name)
78
78
  # Create the directory for results
79
79
  results_dir = f"Outputs/{self.device_id}/{self.timestamp}/{name}/"
80
80
  Path(results_dir).mkdir(parents=True, exist_ok=True)
@@ -17,8 +17,9 @@ Q-score benchmark
17
17
  """
18
18
 
19
19
  import itertools
20
+ import logging
20
21
  from time import strftime
21
- from typing import Callable, Dict, List, Optional, Tuple, Type
22
+ from typing import Callable, Dict, List, Literal, Optional, Tuple, Type
22
23
 
23
24
  from matplotlib.figure import Figure
24
25
  import matplotlib.pyplot as plt
@@ -209,6 +210,7 @@ class QScoreBenchmark(BenchmarkBase):
209
210
 
210
211
  else:
211
212
  coupling_map = self.backend.coupling_map.reduce(qubit_set)
213
+ qcvv_logger.setLevel(logging.WARNING)
212
214
  transpiled_qc_list, _ = perform_backend_transpilation(
213
215
  [qc],
214
216
  backend=self.backend,
@@ -230,6 +232,7 @@ class QScoreBenchmark(BenchmarkBase):
230
232
  )
231
233
 
232
234
  counts = retrieve_all_counts(jobs)[0][0]
235
+ qcvv_logger.setLevel(logging.INFO)
233
236
 
234
237
  return self.compute_expectation_value(counts, graph)
235
238
 
@@ -595,7 +598,7 @@ class QScoreBenchmark(BenchmarkBase):
595
598
 
596
599
  for i in range(self.num_instances):
597
600
  graph = nx.generators.erdos_renyi_graph(num_nodes, 0.5, seed=seed)
598
- print(f"graph: {graph}")
601
+ qcvv_logger.debug(f"graph: {graph}")
599
602
  self.graph_physical = graph.copy()
600
603
  self.virtual_nodes = []
601
604
  if self.use_virtual_node:
@@ -619,14 +622,14 @@ class QScoreBenchmark(BenchmarkBase):
619
622
  if graph.number_of_edges() == 0:
620
623
  cut_sizes.append(0)
621
624
  seed += 1
622
- qcvv_logger.info(f"Graph {i+1}/{self.num_instances} had no edges: cut size = 0.")
625
+ qcvv_logger.debug(f"Graph {i+1}/{self.num_instances} had no edges: cut size = 0.")
623
626
  continue
624
627
 
625
628
  # Choose the qubit layout
626
629
  qubit_set = []
627
630
  if self.choose_qubits_routine.lower() == "naive":
628
631
  qubit_set = self.choose_qubits_naive(num_nodes)
629
- elif self.choose_qubits_routine.lower() == "custom" or self.choose_qubits_routine.lower() == "mapomatic":
632
+ elif self.choose_qubits_routine.lower() == "custom":
630
633
  qubit_set = self.choose_qubits_custom(num_nodes)
631
634
  else:
632
635
  raise ValueError('choose_qubits_routine must either be "naive" or "custom".')
@@ -634,7 +637,7 @@ class QScoreBenchmark(BenchmarkBase):
634
637
  # Solve the maximum cut size with QAOA
635
638
  cut_sizes.append(self.run_QAOA(graph, qubit_set))
636
639
  seed += 1
637
- qcvv_logger.info(f"Solved the MaxCut on graph {i+1}/{self.num_instances}.")
640
+ qcvv_logger.debug(f"Solved the MaxCut on graph {i+1}/{self.num_instances}.")
638
641
 
639
642
  average_cut_size = np.mean(cut_sizes) - num_nodes * (num_nodes - 1) / 8
640
643
  average_best_cut_size = 0.178 * pow(num_nodes, 3 / 2)
@@ -677,7 +680,7 @@ class QScoreBenchmark(BenchmarkBase):
677
680
  list_of_cut_sizes = []
678
681
 
679
682
  for num_nodes in range(self.min_num_nodes, max_num_nodes + 1):
680
- qcvv_logger.info(f"Executing on {self.num_instances} random graphs with {num_nodes} nodes.")
683
+ qcvv_logger.debug(f"Executing on {self.num_instances} random graphs with {num_nodes} nodes.")
681
684
  is_successful, approximation_ratio, cut_sizes = self.execute_single_benchmark(num_nodes)[0:3]
682
685
  approximation_ratios.append(approximation_ratio)
683
686
 
@@ -711,7 +714,7 @@ class QScoreConfiguration(BenchmarkConfigurationBase):
711
714
  max_num_nodes: Optional[int] = None
712
715
  use_virtual_node: bool = True
713
716
  use_classically_optimized_angles: bool = True
714
- choose_qubits_routine: str = "naive"
717
+ choose_qubits_routine: Literal["naive", "custom"] = "naive"
715
718
  min_num_qubits: int = 2 # If choose_qubits_routine is "naive"
716
719
  custom_qubits_array: Optional[list[list[int]]] = None
717
720
  qiskit_optim_level: int = 3
@@ -550,7 +550,7 @@ def plot_rb_decay(
550
550
  shade_stdev (bool, optional): Whether standard deviations are shaded or not. Defaults to False
551
551
  shade_meanerror (bool, optional): Whether to shade standard deviations. Defaults to False
552
552
  logscale (bool, optional): Whether x-axis uses logscale. Defaults to True
553
- interleaved_gate (Optional[str]):
553
+ interleaved_gate (Optional[str]): The label or the interleaved gate. Defaults to None
554
554
  mrb_2q_density (Optional[float], optional): Density of MRB 2Q gates. Defaults to None.
555
555
  mrb_2q_ensemble (Optional[Dict[str, float]], optional): MRB ensemble of 2Q gates. Defaults to None.
556
556
 
@@ -771,7 +771,7 @@ def plot_rb_decay(
771
771
  if identifier == "mrb":
772
772
  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} (%)"
773
773
  elif key == "interleaved":
774
- plot_label = fr"$\overline{{F}}_{{interleaved_gate}} ({qubits})$ = {100.0 * fidelity_value[key][str(qubits)]:.2f} +/- {100.0 * fidelity_stderr[key][str(qubits)]:.2f} (%)"
774
+ plot_label = fr"$\overline{{F}}_{{{interleaved_gate}}} ({qubits})$ = {100.0 * fidelity_value[key][str(qubits)]:.2f} +/- {100.0 * fidelity_stderr[key][str(qubits)]:.2f} (%)"
775
775
  else:
776
776
  print(fidelity_value)
777
777
  print(qubits)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iqm-benchmarks
3
- Version: 1.11
3
+ Version: 1.12
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>
6
6
  Project-URL: Homepage, https://github.com/iqm-finland/iqm-benchmarks
@@ -1,7 +1,7 @@
1
1
  iqm/benchmarks/__init__.py,sha256=7EOYlsJriQHKAlb3tHpPY4bh4wLbsssZg4NV0XW0WBU,2128
2
2
  iqm/benchmarks/benchmark.py,sha256=SGhBcSxLPUu-cVXAjG4Db2TRobFCRBYoE1NtTDK1lJg,4432
3
3
  iqm/benchmarks/benchmark_definition.py,sha256=aRpOmeR5LOg64K6konSmko87UZ7r3uN98nkiCIOz1EU,10311
4
- iqm/benchmarks/benchmark_experiment.py,sha256=0BFNn04jyD1Yj-pIKnuZjCD00v3pU5EnwkRzJUBc0n4,6540
4
+ iqm/benchmarks/benchmark_experiment.py,sha256=ynbsQS92v6soIgkDEdm3ygNO7f82-dhg7qB1l8jvSFM,6614
5
5
  iqm/benchmarks/logging_config.py,sha256=U7olP5Kr75AcLJqNODf9VBhJLVqIvA4AYR6J39D5rww,1052
6
6
  iqm/benchmarks/readout_mitigation.py,sha256=ugdWwdSpNoCNoqQTRBdSjzMsb9WxFQzKgGFpJmUHChE,12287
7
7
  iqm/benchmarks/utils.py,sha256=OoHDBwlr_O9PK90vwidBEFtxJa5CrOSc2suYEPpXLKE,20238
@@ -11,7 +11,7 @@ iqm/benchmarks/compressive_gst/gst_analysis.py,sha256=qaF9zDIadPGe9I0l_SC3EfnODZ
11
11
  iqm/benchmarks/entanglement/__init__.py,sha256=9T7prOwqMmFWdb4t6ETAHZXKK5o6FvU2DvVb6WhNi-U,682
12
12
  iqm/benchmarks/entanglement/ghz.py,sha256=7Vz15n5D_qEfFaRPkSbEgAbM8aQXBMT0dkRVMIPg7jA,38470
13
13
  iqm/benchmarks/optimization/__init__.py,sha256=_ajW_OibYLCtzU5AUv5c2zuuVYn8ZNeZUcUUSIGt51M,747
14
- iqm/benchmarks/optimization/qscore.py,sha256=_s5_w5QTlaeDcHX1BmAevVctHOTVobee1eGkFx7DTEs,27942
14
+ iqm/benchmarks/optimization/qscore.py,sha256=0S6OemnIPmFUamnEPT_lY86Zk_c0a9M2CLYeRJ4Se5c,28056
15
15
  iqm/benchmarks/quantum_volume/__init__.py,sha256=i-Q4SpDWELBw7frXnxm1j4wJRcxbIyrS5uEK_v06YHo,951
16
16
  iqm/benchmarks/quantum_volume/clops.py,sha256=PvxnKYSBwJgLOuDcCKB4H_IBzQiLw4RqXAOzquiEPxU,31439
17
17
  iqm/benchmarks/quantum_volume/quantum_volume.py,sha256=sy1MDz4U_6JCwc0W85GjC2VHvxUO4fdvHekd2oV4tww,36979
@@ -19,7 +19,7 @@ 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=62T01SYfyIwArLhVmmgQllk78RKH3jhdWKOX2gnLMzU,37892
22
+ iqm/benchmarks/randomized_benchmarking/randomized_benchmarking_common.py,sha256=cH-SeOFqsGD6iqTcHTjCMJ-z89mfDjYT_QPsHwJFmU4,37946
23
23
  iqm/benchmarks/randomized_benchmarking/clifford_rb/__init__.py,sha256=bTDA156LAl7OLGcMec--1nzDrV1XpPRVq3CquTmucgE,677
24
24
  iqm/benchmarks/randomized_benchmarking/clifford_rb/clifford_rb.py,sha256=uo6cPhoQQ9qAGeZFZG23jxaR88_qKdiqtlBrG_mAGWg,17470
25
25
  iqm/benchmarks/randomized_benchmarking/interleaved_rb/__init__.py,sha256=sq6MgN_hwlpkOj10vyCU4e6eKSX-oLcF2L9na6W2Gt4,681
@@ -36,8 +36,8 @@ mGST/optimization.py,sha256=YHwkzIkYvsZOPjclR-BCQWh24jeqjuXp0BB0WX5Lwow,10559
36
36
  mGST/qiskit_interface.py,sha256=2XuJ4WFViLsHCTpEZncwsLbRr-cELEYhegTpRPzCcuI,10080
37
37
  mGST/reporting/figure_gen.py,sha256=6Xd8vwfy09hLY1YbJY6TRevuMsQSU4MsWqemly3ZO0I,12970
38
38
  mGST/reporting/reporting.py,sha256=-XBy3OCJIMOsA8cApwKjhVKBwnjSAoxm-voHNbRWytM,25803
39
- iqm_benchmarks-1.11.dist-info/LICENSE,sha256=2Ncb40-hqkTil78RPv3-YiJfKaJ8te9USJgliKqIdSY,11558
40
- iqm_benchmarks-1.11.dist-info/METADATA,sha256=dDdF6Dk_RVT-lzXzdWorltqvIezLl_OJCLrNSTfDstU,9074
41
- iqm_benchmarks-1.11.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
42
- iqm_benchmarks-1.11.dist-info/top_level.txt,sha256=3G23Z-1LGf-IOzTCUl6QwWqiQ3USz25Zt90Ihq192to,9
43
- iqm_benchmarks-1.11.dist-info/RECORD,,
39
+ iqm_benchmarks-1.12.dist-info/LICENSE,sha256=2Ncb40-hqkTil78RPv3-YiJfKaJ8te9USJgliKqIdSY,11558
40
+ iqm_benchmarks-1.12.dist-info/METADATA,sha256=zg9mbf09daWGyt2JxN4uc7V8rQQtmewp2QzgkPOBRKE,9074
41
+ iqm_benchmarks-1.12.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
42
+ iqm_benchmarks-1.12.dist-info/top_level.txt,sha256=3G23Z-1LGf-IOzTCUl6QwWqiQ3USz25Zt90Ihq192to,9
43
+ iqm_benchmarks-1.12.dist-info/RECORD,,