iqm-benchmarks 2.46__py3-none-any.whl → 2.47__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.
@@ -230,7 +230,7 @@ class Benchmark(ABC):
230
230
  if isinstance(backend, str):
231
231
  self.backend = get_iqm_backend(backend)
232
232
  else:
233
- assert isinstance(backend, IQMBackendBase)
233
+ # assert isinstance(backend, IQMBackendBase)
234
234
  self.backend = backend
235
235
 
236
236
  self.shots = self.configuration.shots
@@ -171,12 +171,12 @@ def retrieve_clops_elapsed_times(job_meta: Dict[str, Dict[str, Any]]) -> Dict[st
171
171
  if job_meta[update][batch]["timestamps"] is not None:
172
172
  x = job_meta[update][batch]["timestamps"]
173
173
  job_time_format = "%Y-%m-%dT%H:%M:%S.%f%z" # Is it possible to extract this automatically?
174
- compile_f = datetime.strptime(x["compile_end"], job_time_format)
175
- compile_i = datetime.strptime(x["compile_start"], job_time_format)
174
+ compile_f = datetime.strptime(x["compilation_ended"], job_time_format)
175
+ compile_i = datetime.strptime(x["compilation_started"], job_time_format)
176
176
  # submit_f = datetime.strptime(x["submit_end"], job_time_format)
177
177
  # submit_i = datetime.strptime(x["submit_start"], job_time_format)
178
- execution_f = datetime.strptime(x["execution_end"], job_time_format)
179
- execution_i = datetime.strptime(x["execution_start"], job_time_format)
178
+ execution_f = datetime.strptime(x["execution_ended"], job_time_format)
179
+ execution_i = datetime.strptime(x["execution_started"], job_time_format)
180
180
  job_f = datetime.strptime(x["ready"], job_time_format)
181
181
  job_i = datetime.strptime(x["received"], job_time_format)
182
182
 
@@ -457,7 +457,7 @@ class CLOPSBenchmark(Benchmark):
457
457
 
458
458
  @timeit
459
459
  def generate_circuit_list(
460
- self,
460
+ self,
461
461
  ) -> List[QuantumCircuit]:
462
462
  """Generate a list of parametrized QV quantum circuits, with measurements at the end.
463
463
 
@@ -477,11 +477,11 @@ class CLOPSBenchmark(Benchmark):
477
477
 
478
478
  @timeit
479
479
  def assign_random_parameters_to_all(
480
- self,
481
- dict_parametrized_circs: Dict[Tuple, List[QuantumCircuit]],
482
- optimize_sqg: bool,
480
+ self,
481
+ dict_parametrized_circs: Dict[Tuple, List[QuantumCircuit]],
482
+ optimize_sqg: bool,
483
483
  ) -> Tuple[List[List[float]], Dict[Tuple, List[QuantumCircuit]]]:
484
- """
484
+ """Assigns random parameters to all parametrized circuits.
485
485
 
486
486
  Args:
487
487
  dict_parametrized_circs (Dict[Tuple, List[QuantumCircuit]]): Dictionary with list of int (qubits) as keys and lists of parametrized quantum circuits as values
@@ -491,30 +491,37 @@ class CLOPSBenchmark(Benchmark):
491
491
  - lists of list of float parameter values corresponding to param updates
492
492
  - dictionary with lists of int (qubits) as keys and lists of quantum circuits as values
493
493
  """
494
- # Store parametrized circuits in a separate dictionary
495
- sorted_dict_parametrized: Dict[Tuple, List[QuantumCircuit]] = {k: [] for k in dict_parametrized_circs.keys()}
496
- param_values: List[List[float]] = []
497
- for k in dict_parametrized_circs.keys():
498
- for qc in dict_parametrized_circs[k]:
499
- # Update parameters
500
- parameters = self.generate_random_parameters()
501
-
502
- # Star can't use optimize_sqg as is, yet -> complains about MOVE gate not being IQM native!
503
- if optimize_sqg and "move" not in self.backend.architecture.gates:
494
+ # Pre-check if optimization is needed to avoid repeated condition checks
495
+ can_optimize = optimize_sqg and "move" not in self.backend.architecture.gates
496
+
497
+ # Pre-allocate the result dictionaries
498
+ sorted_dict_parametrized = {k: [] for k in dict_parametrized_circs}
499
+ param_values = []
500
+
501
+ # Generate all parameter sets at once
502
+ total_circuits = sum(len(circuits) for circuits in dict_parametrized_circs.values())
503
+ all_parameters = [self.generate_random_parameters() for _ in range(total_circuits)]
504
+ param_idx = 0
505
+
506
+ for k, circuits in dict_parametrized_circs.items():
507
+ for qc in circuits:
508
+ # Get pre-generated parameters
509
+ parameters = all_parameters[param_idx]
510
+ param_idx += 1
511
+
512
+ # Create parameter dictionary once
513
+ param_dict = dict(zip(qc.parameters, parameters))
514
+
515
+ # Assign parameters and optionally optimize
516
+ if can_optimize:
504
517
  sorted_dict_parametrized[k].append(
505
- optimize_single_qubit_gates( # Optimize SQG seems worth it AFTER assignment
506
- qc.assign_parameters(
507
- dict(zip(qc.parameters, parameters)),
508
- inplace=False, # Leave the template intact for next updates
509
- )
518
+ optimize_single_qubit_gates(
519
+ qc.assign_parameters(param_dict, inplace=False)
510
520
  )
511
521
  )
512
522
  else:
513
523
  sorted_dict_parametrized[k].append(
514
- qc.assign_parameters(
515
- dict(zip(qc.parameters, parameters)),
516
- inplace=False, # Leave the template intact for next updates
517
- )
524
+ qc.assign_parameters(param_dict, inplace=False)
518
525
  )
519
526
 
520
527
  param_values.append(list(parameters))
@@ -537,7 +544,10 @@ class CLOPSBenchmark(Benchmark):
537
544
  """
538
545
  # Assign parameters to all quantum circuits
539
546
  qcvv_logger.info(
540
- f"Update {(update + 1)}/{self.num_updates}\nAssigning random parameters to all {self.num_circuits} circuits"
547
+ f"Update {(update + 1)}/{self.num_updates}"
548
+ )
549
+ qcvv_logger.info(
550
+ f"Assigning random parameters to all {self.num_circuits} circuits"
541
551
  )
542
552
  (all_param_updates, sorted_transpiled_qc_list_parametrized), time_parameter_assign = (
543
553
  self.assign_random_parameters_to_all(sorted_transpiled_qc_list, self.optimize_sqg)
@@ -603,7 +613,7 @@ class CLOPSBenchmark(Benchmark):
603
613
 
604
614
  self.untranspiled_circuits.circuit_groups.append(CircuitGroup(name=self.qubits, circuits=qc_list))
605
615
  for key in sorted_transpiled_qc_list.keys():
606
- self.transpiled_circuits.circuit_groups.append(CircuitGroup(name=f"{self.qubits}_{key}", circuits=qc_list))
616
+ self.transpiled_circuits.circuit_groups.append(CircuitGroup(name=f"{self.qubits}_{key}", circuits=transpiled_qc_list))
607
617
 
608
618
  return sorted_transpiled_qc_list
609
619
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iqm-benchmarks
3
- Version: 2.46
3
+ Version: 2.47
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
@@ -18,8 +18,8 @@ Requires-Dist: mthree<2.7,>=2.6
18
18
  Requires-Dist: networkx<4.0,>=3.3
19
19
  Requires-Dist: rustworkx>=0.16.0
20
20
  Requires-Dist: numpy<2.0,>=1.25.2
21
- Requires-Dist: qiskit<1.3,>=1.2.4
22
- Requires-Dist: iqm-client[qiskit]<30.0,>=29.0
21
+ Requires-Dist: qiskit<=1.4.2,>=1.2.4
22
+ Requires-Dist: iqm-client[qiskit]<30.0,>=29.12
23
23
  Requires-Dist: iqm-station-control-client>=9.3.0
24
24
  Requires-Dist: requests<3.0,>=2.32.3
25
25
  Requires-Dist: scikit-optimize<0.11.0,>=0.10.2
@@ -1,6 +1,6 @@
1
1
  iqm/benchmarks/__init__.py,sha256=-drZ_whue067Tu4I9RxBCqrrzu38Tm5Kqf9jHTftUPk,3070
2
2
  iqm/benchmarks/benchmark.py,sha256=3E7g7RQjCIGIpSI1gOSrI3V9SAVs-XEOMrPgToK_7vw,4972
3
- iqm/benchmarks/benchmark_definition.py,sha256=7sq9_Y0iu1ZJOjG0gAVpm_BK3hbJBa6bdcRKhcVFOJw,11321
3
+ iqm/benchmarks/benchmark_definition.py,sha256=lDu__vowp15udoo1tFl_h0LQA8WHyyHdIRi7UDbwAzg,11323
4
4
  iqm/benchmarks/circuit_containers.py,sha256=anEtZEsodYqOX-34oZRmuKGeEpp_VfgG5045Mz4-4hI,7562
5
5
  iqm/benchmarks/logging_config.py,sha256=U7olP5Kr75AcLJqNODf9VBhJLVqIvA4AYR6J39D5rww,1052
6
6
  iqm/benchmarks/readout_mitigation.py,sha256=Q2SOGWTNgmklOYkNxepAaSaXlxSj0QQyymYY1bOkT8A,11756
@@ -18,7 +18,7 @@ iqm/benchmarks/entanglement/graph_states.py,sha256=saoAw2QF8j7W4nZMOElnjuNylqDAb
18
18
  iqm/benchmarks/optimization/__init__.py,sha256=_ajW_OibYLCtzU5AUv5c2zuuVYn8ZNeZUcUUSIGt51M,747
19
19
  iqm/benchmarks/optimization/qscore.py,sha256=55NdsDsY9hwQLIZZdmf46BhU4C0hxjV5CCNYZnyoMAI,37372
20
20
  iqm/benchmarks/quantum_volume/__init__.py,sha256=i-Q4SpDWELBw7frXnxm1j4wJRcxbIyrS5uEK_v06YHo,951
21
- iqm/benchmarks/quantum_volume/clops.py,sha256=QS9iK-gtop0zix6IBeUumQeG01-0dXsv0jsYSDhgEu0,31071
21
+ iqm/benchmarks/quantum_volume/clops.py,sha256=EUtO-_OYBYvwqb4xY3aubI2gc2Z6cBokRzt_E0608WA,31242
22
22
  iqm/benchmarks/quantum_volume/quantum_volume.py,sha256=pro7Lz-A5pPpT9UZ8wtXKTyhdWmTjQjRHt4BylDR-3U,36553
23
23
  iqm/benchmarks/randomized_benchmarking/__init__.py,sha256=IkKo-7zUChxZZd3my_csQCJfJfZNsV3-JTvdG8uqys4,734
24
24
  iqm/benchmarks/randomized_benchmarking/clifford_1q.pkl,sha256=yrmSJqhv7Lb1yqiqU9-2baqTljJPNmTUPQR-AH6GGfc,7800
@@ -35,7 +35,7 @@ iqm/benchmarks/randomized_benchmarking/interleaved_rb/__init__.py,sha256=sq6MgN_
35
35
  iqm/benchmarks/randomized_benchmarking/interleaved_rb/interleaved_rb.py,sha256=TaR1YFWBhOgm1hmEQzuwLYpp0yl0Xpuo3jAT6YhiXpc,28471
36
36
  iqm/benchmarks/randomized_benchmarking/mirror_rb/__init__.py,sha256=jRKbivWCZ3xdO1k0sx-ygC3s5DUkGSModd975PoAtcg,692
37
37
  iqm/benchmarks/randomized_benchmarking/mirror_rb/mirror_rb.py,sha256=n_5gt9636ZDMsM9hC3Zm5qP2bQr2sy41zxGhOh0XMjI,32932
38
- iqm_benchmarks-2.46.dist-info/licenses/LICENSE,sha256=2Ncb40-hqkTil78RPv3-YiJfKaJ8te9USJgliKqIdSY,11558
38
+ iqm_benchmarks-2.47.dist-info/licenses/LICENSE,sha256=2Ncb40-hqkTil78RPv3-YiJfKaJ8te9USJgliKqIdSY,11558
39
39
  mGST/LICENSE,sha256=TtHNq55cUcbglb7uhVudeBLUh_qPdUoAEvU0BBwFz-k,1098
40
40
  mGST/README.md,sha256=v_5kw253csHF4-RfE-44KqFmBXIsSMRmOtN0AUPrRxE,5050
41
41
  mGST/additional_fns.py,sha256=MV0Pm5ap59IjhT_E3QhsZyM7lXOF1RZ9SD11zoaf43A,31781
@@ -46,7 +46,7 @@ mGST/optimization.py,sha256=x9tJ9wMQ5aONWpNpBMVtK0rwE6DRcOU33htNgrt0tx4,11015
46
46
  mGST/qiskit_interface.py,sha256=uCdn-Q9CXI2f4FQSxGUy8GmmzQhr9NhCOFb2VPj0gTs,10061
47
47
  mGST/reporting/figure_gen.py,sha256=xFPAHx1Trdqz7swn0kRqwc_jbRaNxhG9Nvx0jeitooo,25847
48
48
  mGST/reporting/reporting.py,sha256=Wss1-zFsMEhzrrXKfP-RICau80ezjDIzcN555KhSehc,34160
49
- iqm_benchmarks-2.46.dist-info/METADATA,sha256=si3yJgRHE9BhCYE9di9FKDsw_dIXUUm39MmvoggV_1c,10905
50
- iqm_benchmarks-2.46.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
51
- iqm_benchmarks-2.46.dist-info/top_level.txt,sha256=3G23Z-1LGf-IOzTCUl6QwWqiQ3USz25Zt90Ihq192to,9
52
- iqm_benchmarks-2.46.dist-info/RECORD,,
49
+ iqm_benchmarks-2.47.dist-info/METADATA,sha256=AVWPMAEqPVKPTi4oULvqy_yqYYNwG9fvkrf4lcE4qqg,10909
50
+ iqm_benchmarks-2.47.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
51
+ iqm_benchmarks-2.47.dist-info/top_level.txt,sha256=3G23Z-1LGf-IOzTCUl6QwWqiQ3USz25Zt90Ihq192to,9
52
+ iqm_benchmarks-2.47.dist-info/RECORD,,