qiskit 1.3.1__cp39-abi3-win32.whl → 1.3.3__cp39-abi3-win32.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.
Files changed (88) hide show
  1. qiskit/VERSION.txt +1 -1
  2. qiskit/_accelerate.pyd +0 -0
  3. qiskit/circuit/__init__.py +7 -2
  4. qiskit/circuit/controlledgate.py +2 -0
  5. qiskit/circuit/delay.py +5 -0
  6. qiskit/circuit/library/__init__.py +1 -0
  7. qiskit/circuit/library/arithmetic/piecewise_chebyshev.py +1 -0
  8. qiskit/circuit/library/basis_change/qft.py +3 -0
  9. qiskit/circuit/library/boolean_logic/inner_product.py +2 -0
  10. qiskit/circuit/library/boolean_logic/quantum_and.py +4 -0
  11. qiskit/circuit/library/boolean_logic/quantum_or.py +4 -0
  12. qiskit/circuit/library/boolean_logic/quantum_xor.py +2 -0
  13. qiskit/circuit/library/fourier_checking.py +2 -0
  14. qiskit/circuit/library/generalized_gates/gms.py +1 -0
  15. qiskit/circuit/library/generalized_gates/gr.py +4 -0
  16. qiskit/circuit/library/generalized_gates/mcmt.py +1 -0
  17. qiskit/circuit/library/generalized_gates/permutation.py +5 -1
  18. qiskit/circuit/library/generalized_gates/unitary.py +1 -1
  19. qiskit/circuit/library/graph_state.py +2 -0
  20. qiskit/circuit/library/grover_operator.py +7 -3
  21. qiskit/circuit/library/hidden_linear_function.py +2 -0
  22. qiskit/circuit/library/iqp.py +5 -0
  23. qiskit/circuit/library/n_local/efficient_su2.py +7 -2
  24. qiskit/circuit/library/n_local/evolved_operator_ansatz.py +3 -0
  25. qiskit/circuit/library/n_local/excitation_preserving.py +14 -8
  26. qiskit/circuit/library/n_local/n_local.py +10 -5
  27. qiskit/circuit/library/n_local/pauli_two_design.py +5 -2
  28. qiskit/circuit/library/n_local/qaoa_ansatz.py +1 -0
  29. qiskit/circuit/library/n_local/real_amplitudes.py +10 -4
  30. qiskit/circuit/library/overlap.py +1 -0
  31. qiskit/circuit/library/phase_estimation.py +2 -0
  32. qiskit/circuit/library/quantum_volume.py +3 -0
  33. qiskit/circuit/library/standard_gates/rz.py +7 -7
  34. qiskit/circuit/library/standard_gates/xx_minus_yy.py +0 -30
  35. qiskit/circuit/operation.py +1 -0
  36. qiskit/circuit/parameter.py +1 -0
  37. qiskit/circuit/parameterexpression.py +1 -1
  38. qiskit/circuit/parametervector.py +25 -5
  39. qiskit/circuit/quantumcircuit.py +17 -20
  40. qiskit/circuit/random/utils.py +2 -0
  41. qiskit/compiler/transpiler.py +1 -1
  42. qiskit/converters/dag_to_circuit.py +1 -0
  43. qiskit/primitives/statevector_estimator.py +1 -0
  44. qiskit/providers/fake_provider/__init__.py +1 -0
  45. qiskit/pulse/builder.py +8 -0
  46. qiskit/pulse/library/symbolic_pulses.py +1 -0
  47. qiskit/qasm2/export.py +2 -2
  48. qiskit/qasm3/__init__.py +1 -0
  49. qiskit/qasm3/exporter.py +6 -3
  50. qiskit/quantum_info/operators/channel/transformations.py +15 -0
  51. qiskit/quantum_info/operators/symplectic/pauli_list.py +8 -8
  52. qiskit/quantum_info/operators/symplectic/sparse_pauli_op.py +10 -1
  53. qiskit/quantum_info/states/statevector.py +1 -0
  54. qiskit/synthesis/arithmetic/multipliers/hrs_cumulative_multiplier.py +1 -0
  55. qiskit/synthesis/arithmetic/multipliers/rg_qft_multiplier.py +1 -0
  56. qiskit/synthesis/evolution/product_formula.py +0 -6
  57. qiskit/synthesis/evolution/suzuki_trotter.py +22 -5
  58. qiskit/transpiler/__init__.py +780 -529
  59. qiskit/transpiler/layout.py +9 -6
  60. qiskit/transpiler/passes/layout/sabre_layout.py +13 -0
  61. qiskit/transpiler/passes/optimization/remove_identity_equiv.py +2 -3
  62. qiskit/transpiler/passes/routing/star_prerouting.py +1 -0
  63. qiskit/transpiler/passes/scheduling/dynamical_decoupling.py +1 -0
  64. qiskit/transpiler/passes/scheduling/padding/dynamical_decoupling.py +1 -0
  65. qiskit/transpiler/passes/scheduling/scheduling/alap.py +1 -1
  66. qiskit/transpiler/passes/scheduling/scheduling/asap.py +1 -1
  67. qiskit/transpiler/passes/synthesis/hls_plugins.py +48 -9
  68. qiskit/transpiler/passes/utils/filter_op_nodes.py +2 -1
  69. qiskit/transpiler/passes/utils/remove_barriers.py +1 -0
  70. qiskit/transpiler/preset_passmanagers/__init__.py +31 -11
  71. qiskit/transpiler/preset_passmanagers/builtin_plugins.py +19 -22
  72. qiskit/transpiler/preset_passmanagers/plugin.py +33 -42
  73. qiskit/transpiler/target.py +1 -1
  74. qiskit/visualization/__init__.py +6 -0
  75. qiskit/visualization/circuit/circuit_visualization.py +1 -0
  76. qiskit/visualization/circuit/text.py +3 -2
  77. qiskit/visualization/counts_visualization.py +2 -0
  78. qiskit/visualization/dag_visualization.py +1 -0
  79. qiskit/visualization/gate_map.py +7 -3
  80. qiskit/visualization/pulse_v2/interface.py +4 -1
  81. qiskit/visualization/state_visualization.py +13 -2
  82. qiskit/visualization/timeline/interface.py +6 -3
  83. {qiskit-1.3.1.dist-info → qiskit-1.3.3.dist-info}/METADATA +20 -23
  84. {qiskit-1.3.1.dist-info → qiskit-1.3.3.dist-info}/RECORD +88 -88
  85. {qiskit-1.3.1.dist-info → qiskit-1.3.3.dist-info}/WHEEL +1 -1
  86. {qiskit-1.3.1.dist-info → qiskit-1.3.3.dist-info}/LICENSE.txt +0 -0
  87. {qiskit-1.3.1.dist-info → qiskit-1.3.3.dist-info}/entry_points.txt +0 -0
  88. {qiskit-1.3.1.dist-info → qiskit-1.3.3.dist-info}/top_level.txt +0 -0
@@ -445,16 +445,17 @@ class TranspileLayout:
445
445
 
446
446
  The :mod:`~qiskit.transpiler` is unitary-preserving up to the "initial layout"
447
447
  and "final layout" permutations. The initial layout permutation is caused by
448
- setting and applying the initial layout during the :ref:`layout_stage`.
448
+ setting and applying the initial layout during the :ref:`transpiler-preset-stage-layout`.
449
449
  The final layout permutation is caused by :class:`~.SwapGate` insertion during
450
- the :ref:`routing_stage`. This class provides an interface to reason about these
451
- permutations using a variety of helper methods.
450
+ the :ref:`transpiler-preset-stage-routing`. This class provides an interface to reason about
451
+ these permutations using a variety of helper methods.
452
452
 
453
453
  During the layout stage, the transpiler can potentially remap the order of the
454
454
  qubits in the circuit as it fits the circuit to the target backend. For example,
455
455
  let the input circuit be:
456
456
 
457
457
  .. plot::
458
+ :alt: Circuit diagram output by the previous code.
458
459
  :include-source:
459
460
 
460
461
  from qiskit.circuit import QuantumCircuit, QuantumRegister
@@ -470,6 +471,7 @@ class TranspileLayout:
470
471
  Suppose that during the layout stage the transpiler reorders the qubits to be:
471
472
 
472
473
  .. plot::
474
+ :alt: Circuit diagram output by the previous code.
473
475
  :include-source:
474
476
 
475
477
  from qiskit import QuantumCircuit
@@ -498,6 +500,7 @@ class TranspileLayout:
498
500
  becomes:
499
501
 
500
502
  .. plot::
503
+ :alt: Circuit diagram output by the previous code.
501
504
  :include-source:
502
505
 
503
506
  from qiskit import QuantumCircuit
@@ -521,7 +524,7 @@ class TranspileLayout:
521
524
  state from the transpiler. They are defined as:
522
525
 
523
526
  * :attr:`initial_layout` - This attribute is used to model the
524
- permutation caused by the :ref:`layout_stage`. It is a
527
+ permutation caused by the :ref:`transpiler-preset-stage-layout`. It is a
525
528
  :class:`~.Layout` object that maps the input :class:`~.QuantumCircuit`\s
526
529
  :class:`~.circuit.Qubit` objects to the position in the output
527
530
  :class:`.QuantumCircuit.qubits` list.
@@ -533,12 +536,12 @@ class TranspileLayout:
533
536
  is needed when computing the permutation of the :class:`Operator` of
534
537
  the circuit (and used by :meth:`.Operator.from_circuit`).
535
538
  * :attr:`final_layout` - This attribute is used to model the
536
- permutation caused by the :ref:`routing_stage`. It is a
539
+ permutation caused by the :ref:`transpiler-preset-stage-routing`. It is a
537
540
  :class:`~.Layout` object that maps the output circuit's qubits from
538
541
  :class:`.QuantumCircuit.qubits` in the output circuit to their final
539
542
  positions after routing. Importantly, this only represents the
540
543
  permutation caused by inserting :class:`~.SwapGate`\s into
541
- the :class:`~.QuantumCircuit` during the :ref:`routing_stage`.
544
+ the :class:`~.QuantumCircuit` during the :ref:`transpiler-preset-stage-routing`.
542
545
  It is **not** a mapping from the original input circuit's position
543
546
  to the final position at the end of the transpiled circuit.
544
547
  If you need this, you can use the :meth:`.final_index_layout` to generate this.
@@ -328,6 +328,19 @@ class SabreLayout(TransformationPass):
328
328
  for initial, final in enumerate(component.final_permutation)
329
329
  }
330
330
  )
331
+
332
+ # The coupling map may have been split into more components than the DAG. In this case,
333
+ # there will be some physical qubits unaccounted for in our `final_layout`. Strictly the
334
+ # `if` check is unnecessary, but we can avoid the loop for most circuits and backends.
335
+ if len(final_layout) != len(physical_qubits):
336
+ used_qubits = {
337
+ qubit for component in components for qubit in component.coupling_map.graph.nodes()
338
+ }
339
+ for index, qubit in enumerate(physical_qubits):
340
+ if index in used_qubits:
341
+ continue
342
+ final_layout[qubit] = index
343
+
331
344
  if self.property_set["final_layout"] is None:
332
345
  self.property_set["final_layout"] = final_layout
333
346
  else:
@@ -23,9 +23,8 @@ from qiskit._accelerate.remove_identity_equiv import remove_identity_equiv
23
23
  class RemoveIdentityEquivalent(TransformationPass):
24
24
  r"""Remove gates with negligible effects.
25
25
 
26
- Removes gates whose effect is close to an identity operation, up to the specified
27
- tolerance. Zero qubit gates such as :class:`.GlobalPhaseGate` are not considered
28
- by this pass.
26
+ Removes gates whose effect is close to an identity operation up to a global phase
27
+ and up to the specified tolerance. Parameterized gates are not considered by this pass.
29
28
 
30
29
  For a cutoff fidelity :math:`f`, this pass removes gates whose average
31
30
  gate fidelity with respect to the identity is below :math:`f`. Concretely,
@@ -89,6 +89,7 @@ class StarPreRouting(TransformationPass):
89
89
  For example:
90
90
 
91
91
  .. plot::
92
+ :alt: Circuit diagram output by the previous code.
92
93
  :include-source:
93
94
 
94
95
  from qiskit.circuit import QuantumCircuit
@@ -47,6 +47,7 @@ class DynamicalDecoupling(TransformationPass):
47
47
  (including global phase).
48
48
 
49
49
  .. plot::
50
+ :alt: Output from the previous code.
50
51
  :include-source:
51
52
 
52
53
  import numpy as np
@@ -53,6 +53,7 @@ class PadDynamicalDecoupling(BasePadding):
53
53
  (including global phase).
54
54
 
55
55
  .. plot::
56
+ :alt: Output from the previous code.
56
57
  :include-source:
57
58
 
58
59
  import numpy as np
@@ -20,7 +20,7 @@ from qiskit.transpiler.passes.scheduling.scheduling.base_scheduler import BaseSc
20
20
  class ALAPScheduleAnalysis(BaseScheduler):
21
21
  """ALAP Scheduling pass, which schedules the **stop** time of instructions as late as possible.
22
22
 
23
- See the :ref:`scheduling_stage` section in the :mod:`qiskit.transpiler`
23
+ See the :ref:`transpiler-scheduling-description` section in the :mod:`qiskit.transpiler`
24
24
  module documentation for the detailed behavior of the control flow
25
25
  operation, i.e. ``c_if``.
26
26
  """
@@ -20,7 +20,7 @@ from qiskit.transpiler.passes.scheduling.scheduling.base_scheduler import BaseSc
20
20
  class ASAPScheduleAnalysis(BaseScheduler):
21
21
  """ASAP Scheduling pass, which schedules the start time of instructions as early as possible.
22
22
 
23
- See the :ref:`scheduling_stage` section in the :mod:`qiskit.transpiler`
23
+ See the :ref:`transpiler-scheduling-description` section in the :mod:`qiskit.transpiler`
24
24
  module documentation for the detailed behavior of the control flow
25
25
  operation, i.e. ``c_if``.
26
26
  """
@@ -420,12 +420,13 @@ from qiskit.circuit.library import (
420
420
  C3XGate,
421
421
  C4XGate,
422
422
  PauliEvolutionGate,
423
+ PermutationGate,
424
+ MCMTGate,
423
425
  ModularAdderGate,
424
426
  HalfAdderGate,
425
427
  FullAdderGate,
426
428
  MultiplierGate,
427
429
  )
428
- from qiskit.transpiler.exceptions import TranspilerError
429
430
  from qiskit.transpiler.coupling import CouplingMap
430
431
 
431
432
  from qiskit.synthesis.clifford import (
@@ -467,6 +468,7 @@ from qiskit.synthesis.arithmetic import (
467
468
  multiplier_qft_r17,
468
469
  multiplier_cumulative_h18,
469
470
  )
471
+ from qiskit.quantum_info.operators import Clifford
470
472
  from qiskit.transpiler.passes.routing.algorithms import ApproximateTokenSwapper
471
473
  from .plugin import HighLevelSynthesisPlugin
472
474
 
@@ -484,6 +486,9 @@ class DefaultSynthesisClifford(HighLevelSynthesisPlugin):
484
486
 
485
487
  def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
486
488
  """Run synthesis for the given Clifford."""
489
+ if not isinstance(high_level_object, Clifford):
490
+ return None
491
+
487
492
  decomposition = synth_clifford_full(high_level_object)
488
493
  return decomposition
489
494
 
@@ -497,6 +502,9 @@ class AGSynthesisClifford(HighLevelSynthesisPlugin):
497
502
 
498
503
  def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
499
504
  """Run synthesis for the given Clifford."""
505
+ if not isinstance(high_level_object, Clifford):
506
+ return None
507
+
500
508
  decomposition = synth_clifford_ag(high_level_object)
501
509
  return decomposition
502
510
 
@@ -513,10 +521,14 @@ class BMSynthesisClifford(HighLevelSynthesisPlugin):
513
521
 
514
522
  def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
515
523
  """Run synthesis for the given Clifford."""
524
+ if not isinstance(high_level_object, Clifford):
525
+ return None
526
+
516
527
  if high_level_object.num_qubits <= 3:
517
528
  decomposition = synth_clifford_bm(high_level_object)
518
529
  else:
519
530
  decomposition = None
531
+
520
532
  return decomposition
521
533
 
522
534
 
@@ -530,6 +542,9 @@ class GreedySynthesisClifford(HighLevelSynthesisPlugin):
530
542
 
531
543
  def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
532
544
  """Run synthesis for the given Clifford."""
545
+ if not isinstance(high_level_object, Clifford):
546
+ return None
547
+
533
548
  decomposition = synth_clifford_greedy(high_level_object)
534
549
  return decomposition
535
550
 
@@ -544,6 +559,9 @@ class LayerSynthesisClifford(HighLevelSynthesisPlugin):
544
559
 
545
560
  def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
546
561
  """Run synthesis for the given Clifford."""
562
+ if not isinstance(high_level_object, Clifford):
563
+ return None
564
+
547
565
  decomposition = synth_clifford_layers(high_level_object)
548
566
  return decomposition
549
567
 
@@ -559,6 +577,9 @@ class LayerLnnSynthesisClifford(HighLevelSynthesisPlugin):
559
577
 
560
578
  def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
561
579
  """Run synthesis for the given Clifford."""
580
+ if not isinstance(high_level_object, Clifford):
581
+ return None
582
+
562
583
  decomposition = synth_clifford_depth_lnn(high_level_object)
563
584
  return decomposition
564
585
 
@@ -572,6 +593,9 @@ class DefaultSynthesisLinearFunction(HighLevelSynthesisPlugin):
572
593
 
573
594
  def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
574
595
  """Run synthesis for the given LinearFunction."""
596
+ if not isinstance(high_level_object, LinearFunction):
597
+ return None
598
+
575
599
  decomposition = synth_cnot_count_full_pmh(high_level_object.linear)
576
600
  return decomposition
577
601
 
@@ -595,11 +619,8 @@ class KMSSynthesisLinearFunction(HighLevelSynthesisPlugin):
595
619
 
596
620
  def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
597
621
  """Run synthesis for the given LinearFunction."""
598
-
599
622
  if not isinstance(high_level_object, LinearFunction):
600
- raise TranspilerError(
601
- "PMHSynthesisLinearFunction only accepts objects of type LinearFunction"
602
- )
623
+ return None
603
624
 
604
625
  use_inverted = options.get("use_inverted", False)
605
626
  use_transposed = options.get("use_transposed", False)
@@ -646,11 +667,8 @@ class PMHSynthesisLinearFunction(HighLevelSynthesisPlugin):
646
667
 
647
668
  def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
648
669
  """Run synthesis for the given LinearFunction."""
649
-
650
670
  if not isinstance(high_level_object, LinearFunction):
651
- raise TranspilerError(
652
- "PMHSynthesisLinearFunction only accepts objects of type LinearFunction"
653
- )
671
+ return None
654
672
 
655
673
  section_size = options.get("section_size", 2)
656
674
  use_inverted = options.get("use_inverted", False)
@@ -682,6 +700,9 @@ class KMSSynthesisPermutation(HighLevelSynthesisPlugin):
682
700
 
683
701
  def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
684
702
  """Run synthesis for the given Permutation."""
703
+ if not isinstance(high_level_object, PermutationGate):
704
+ return None
705
+
685
706
  decomposition = synth_permutation_depth_lnn_kms(high_level_object.pattern)
686
707
  return decomposition
687
708
 
@@ -695,6 +716,9 @@ class BasicSynthesisPermutation(HighLevelSynthesisPlugin):
695
716
 
696
717
  def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
697
718
  """Run synthesis for the given Permutation."""
719
+ if not isinstance(high_level_object, PermutationGate):
720
+ return None
721
+
698
722
  decomposition = synth_permutation_basic(high_level_object.pattern)
699
723
  return decomposition
700
724
 
@@ -708,6 +732,9 @@ class ACGSynthesisPermutation(HighLevelSynthesisPlugin):
708
732
 
709
733
  def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
710
734
  """Run synthesis for the given Permutation."""
735
+ if not isinstance(high_level_object, PermutationGate):
736
+ return None
737
+
711
738
  decomposition = synth_permutation_acg(high_level_object.pattern)
712
739
  return decomposition
713
740
 
@@ -858,6 +885,9 @@ class TokenSwapperSynthesisPermutation(HighLevelSynthesisPlugin):
858
885
  def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
859
886
  """Run synthesis for the given Permutation."""
860
887
 
888
+ if not isinstance(high_level_object, PermutationGate):
889
+ return None
890
+
861
891
  trials = options.get("trials", 5)
862
892
  seed = options.get("seed", 0)
863
893
  parallel_threshold = options.get("parallel_threshold", 50)
@@ -1156,6 +1186,9 @@ class MCMTSynthesisDefault(HighLevelSynthesisPlugin):
1156
1186
 
1157
1187
  def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
1158
1188
  # first try to use the V-chain synthesis if enough auxiliary qubits are available
1189
+ if not isinstance(high_level_object, MCMTGate):
1190
+ return None
1191
+
1159
1192
  if (
1160
1193
  decomposition := MCMTSynthesisVChain().run(
1161
1194
  high_level_object, coupling_map, target, qubits, **options
@@ -1170,6 +1203,9 @@ class MCMTSynthesisNoAux(HighLevelSynthesisPlugin):
1170
1203
  """A V-chain based synthesis for ``MCMTGate``."""
1171
1204
 
1172
1205
  def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
1206
+ if not isinstance(high_level_object, MCMTGate):
1207
+ return None
1208
+
1173
1209
  base_gate = high_level_object.base_gate
1174
1210
  ctrl_state = options.get("ctrl_state", None)
1175
1211
 
@@ -1195,6 +1231,9 @@ class MCMTSynthesisVChain(HighLevelSynthesisPlugin):
1195
1231
  """A V-chain based synthesis for ``MCMTGate``."""
1196
1232
 
1197
1233
  def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
1234
+ if not isinstance(high_level_object, MCMTGate):
1235
+ return None
1236
+
1198
1237
  if options.get("num_clean_ancillas", 0) < high_level_object.num_ctrl_qubits - 1:
1199
1238
  return None # insufficient number of auxiliary qubits
1200
1239
 
@@ -35,9 +35,10 @@ class FilterOpNodes(TransformationPass):
35
35
 
36
36
  Example:
37
37
 
38
- Filter out operations that are labelled ``"foo"``
38
+ Filter out operations that are labeled ``"foo"``
39
39
 
40
40
  .. plot::
41
+ :alt: Circuit diagram output by the previous code.
41
42
  :include-source:
42
43
 
43
44
  from qiskit import QuantumCircuit
@@ -25,6 +25,7 @@ class RemoveBarriers(TransformationPass):
25
25
  Example:
26
26
 
27
27
  .. plot::
28
+ :alt: Circuit diagram output by the previous code.
28
29
  :include-source:
29
30
 
30
31
  from qiskit import QuantumCircuit
@@ -23,30 +23,32 @@ for the transpiler. The preset pass managers are instances of
23
23
  transformations as part of Qiskit's compiler inside the
24
24
  :func:`~.transpile` function at the different optimization levels, but
25
25
  can also be used in a standalone manner.
26
- The functionality here is divided into two parts, the first includes the
27
- functions used generate the entire pass manager which is used by
28
- :func:`~.transpile` (:ref:`preset_pass_manager_generators`) and the
29
- second includes functions which are used to build (either entirely or in
30
- part) the stages which the preset pass managers are composed of
26
+ The functionality here is divided into two parts. The first includes the
27
+ functions used to generate the entire pass manager, which is used by
28
+ :func:`~.transpile` (:ref:`preset_pass_manager_generators`), and the
29
+ second includes functions that are used to build (either entirely or in
30
+ part) the stages that comprise the preset pass managers
31
31
  (:ref:`stage_generators`).
32
32
 
33
33
  .. _preset_pass_manager_generators:
34
34
 
35
- Preset Pass Manager Generation
36
- ------------------------------
35
+ Low-level preset pass manager generation
36
+ ----------------------------------------
37
37
 
38
- .. autofunction:: generate_preset_pass_manager
39
38
  .. autofunction:: level_0_pass_manager
40
39
  .. autofunction:: level_1_pass_manager
41
40
  .. autofunction:: level_2_pass_manager
42
41
  .. autofunction:: level_3_pass_manager
43
42
 
43
+ ..
44
+ `generate_preset_pass_manager` is not documented here because it's documented to be at the root
45
+ of `qiskit.transpiler`.
46
+
44
47
  .. _stage_generators:
45
48
 
46
- Stage Generator Functions
49
+ Stage generator functions
47
50
  -------------------------
48
51
 
49
- .. currentmodule:: qiskit.transpiler.preset_passmanagers.common
50
52
  .. autofunction:: generate_control_flow_options_check
51
53
  .. autofunction:: generate_error_on_control_flow
52
54
  .. autofunction:: generate_unroll_3q
@@ -55,8 +57,18 @@ Stage Generator Functions
55
57
  .. autofunction:: generate_pre_op_passmanager
56
58
  .. autofunction:: generate_translation_passmanager
57
59
  .. autofunction:: generate_scheduling
58
- .. currentmodule:: qiskit.transpiler.preset_passmanagers
59
60
  """
61
+
62
+ from .common import (
63
+ generate_control_flow_options_check,
64
+ generate_error_on_control_flow,
65
+ generate_unroll_3q,
66
+ generate_embed_passmanager,
67
+ generate_routing_passmanager,
68
+ generate_pre_op_passmanager,
69
+ generate_translation_passmanager,
70
+ generate_scheduling,
71
+ )
60
72
  from .generate_preset_pass_manager import generate_preset_pass_manager
61
73
  from .level0 import level_0_pass_manager
62
74
  from .level1 import level_1_pass_manager
@@ -70,4 +82,12 @@ __all__ = [
70
82
  "level_2_pass_manager",
71
83
  "level_3_pass_manager",
72
84
  "generate_preset_pass_manager",
85
+ "generate_control_flow_options_check",
86
+ "generate_error_on_control_flow",
87
+ "generate_unroll_3q",
88
+ "generate_embed_passmanager",
89
+ "generate_routing_passmanager",
90
+ "generate_pre_op_passmanager",
91
+ "generate_translation_passmanager",
92
+ "generate_scheduling",
73
93
  ]
@@ -238,7 +238,6 @@ class BasicSwapPassManager(PassManagerStagePlugin):
238
238
 
239
239
  def pass_manager(self, pass_manager_config, optimization_level=None) -> PassManager:
240
240
  """Build routing stage PassManager."""
241
- seed_transpiler = pass_manager_config.seed_transpiler
242
241
  target = pass_manager_config.target
243
242
  coupling_map = pass_manager_config.coupling_map
244
243
  backend_properties = pass_manager_config.backend_properties
@@ -257,7 +256,7 @@ class BasicSwapPassManager(PassManagerStagePlugin):
257
256
  routing_pass,
258
257
  target,
259
258
  coupling_map=coupling_map,
260
- seed_transpiler=seed_transpiler,
259
+ seed_transpiler=-1,
261
260
  use_barrier_before_measurement=True,
262
261
  )
263
262
  if optimization_level == 1:
@@ -268,7 +267,7 @@ class BasicSwapPassManager(PassManagerStagePlugin):
268
267
  vf2_call_limit=vf2_call_limit,
269
268
  vf2_max_trials=vf2_max_trials,
270
269
  backend_properties=backend_properties,
271
- seed_transpiler=seed_transpiler,
270
+ seed_transpiler=-1,
272
271
  check_trivial=True,
273
272
  use_barrier_before_measurement=True,
274
273
  )
@@ -280,7 +279,7 @@ class BasicSwapPassManager(PassManagerStagePlugin):
280
279
  vf2_call_limit=vf2_call_limit,
281
280
  vf2_max_trials=vf2_max_trials,
282
281
  backend_properties=backend_properties,
283
- seed_transpiler=seed_transpiler,
282
+ seed_transpiler=-1,
284
283
  use_barrier_before_measurement=True,
285
284
  )
286
285
  if optimization_level == 3:
@@ -291,7 +290,7 @@ class BasicSwapPassManager(PassManagerStagePlugin):
291
290
  vf2_call_limit=vf2_call_limit,
292
291
  vf2_max_trials=vf2_max_trials,
293
292
  backend_properties=backend_properties,
294
- seed_transpiler=seed_transpiler,
293
+ seed_transpiler=-1,
295
294
  use_barrier_before_measurement=True,
296
295
  )
297
296
  raise TranspilerError(f"Invalid optimization level specified: {optimization_level}")
@@ -324,7 +323,7 @@ class StochasticSwapPassManager(PassManagerStagePlugin):
324
323
  routing_pass,
325
324
  target,
326
325
  coupling_map=coupling_map,
327
- seed_transpiler=seed_transpiler,
326
+ seed_transpiler=-1,
328
327
  use_barrier_before_measurement=True,
329
328
  )
330
329
  if optimization_level == 1:
@@ -335,7 +334,7 @@ class StochasticSwapPassManager(PassManagerStagePlugin):
335
334
  vf2_call_limit=vf2_call_limit,
336
335
  vf2_max_trials=vf2_max_trials,
337
336
  backend_properties=backend_properties,
338
- seed_transpiler=seed_transpiler,
337
+ seed_transpiler=-1,
339
338
  check_trivial=True,
340
339
  use_barrier_before_measurement=True,
341
340
  )
@@ -347,7 +346,7 @@ class StochasticSwapPassManager(PassManagerStagePlugin):
347
346
  vf2_call_limit=vf2_call_limit,
348
347
  vf2_max_trials=vf2_max_trials,
349
348
  backend_properties=backend_properties,
350
- seed_transpiler=seed_transpiler,
349
+ seed_transpiler=-1,
351
350
  use_barrier_before_measurement=True,
352
351
  )
353
352
  raise TranspilerError(f"Invalid optimization level specified: {optimization_level}")
@@ -358,7 +357,6 @@ class LookaheadSwapPassManager(PassManagerStagePlugin):
358
357
 
359
358
  def pass_manager(self, pass_manager_config, optimization_level=None) -> PassManager:
360
359
  """Build routing stage PassManager."""
361
- seed_transpiler = pass_manager_config.seed_transpiler
362
360
  target = pass_manager_config.target
363
361
  coupling_map = pass_manager_config.coupling_map
364
362
  coupling_map_routing = target
@@ -376,7 +374,7 @@ class LookaheadSwapPassManager(PassManagerStagePlugin):
376
374
  routing_pass,
377
375
  target,
378
376
  coupling_map=coupling_map,
379
- seed_transpiler=seed_transpiler,
377
+ seed_transpiler=-1,
380
378
  use_barrier_before_measurement=True,
381
379
  )
382
380
  if optimization_level == 1:
@@ -388,7 +386,7 @@ class LookaheadSwapPassManager(PassManagerStagePlugin):
388
386
  vf2_call_limit=vf2_call_limit,
389
387
  vf2_max_trials=vf2_max_trials,
390
388
  backend_properties=backend_properties,
391
- seed_transpiler=seed_transpiler,
389
+ seed_transpiler=-1,
392
390
  check_trivial=True,
393
391
  use_barrier_before_measurement=True,
394
392
  )
@@ -401,7 +399,7 @@ class LookaheadSwapPassManager(PassManagerStagePlugin):
401
399
  vf2_call_limit=vf2_call_limit,
402
400
  vf2_max_trials=vf2_max_trials,
403
401
  backend_properties=backend_properties,
404
- seed_transpiler=seed_transpiler,
402
+ seed_transpiler=-1,
405
403
  use_barrier_before_measurement=True,
406
404
  )
407
405
  if optimization_level == 3:
@@ -413,7 +411,7 @@ class LookaheadSwapPassManager(PassManagerStagePlugin):
413
411
  vf2_call_limit=vf2_call_limit,
414
412
  vf2_max_trials=vf2_max_trials,
415
413
  backend_properties=backend_properties,
416
- seed_transpiler=seed_transpiler,
414
+ seed_transpiler=-1,
417
415
  use_barrier_before_measurement=True,
418
416
  )
419
417
  raise TranspilerError(f"Invalid optimization level specified: {optimization_level}")
@@ -448,7 +446,7 @@ class SabreSwapPassManager(PassManagerStagePlugin):
448
446
  routing_pass,
449
447
  target,
450
448
  coupling_map=coupling_map,
451
- seed_transpiler=seed_transpiler,
449
+ seed_transpiler=-1,
452
450
  use_barrier_before_measurement=True,
453
451
  )
454
452
  if optimization_level == 1:
@@ -466,7 +464,7 @@ class SabreSwapPassManager(PassManagerStagePlugin):
466
464
  vf2_call_limit=vf2_call_limit,
467
465
  vf2_max_trials=vf2_max_trials,
468
466
  backend_properties=backend_properties,
469
- seed_transpiler=seed_transpiler,
467
+ seed_transpiler=-1,
470
468
  check_trivial=True,
471
469
  use_barrier_before_measurement=True,
472
470
  )
@@ -486,7 +484,7 @@ class SabreSwapPassManager(PassManagerStagePlugin):
486
484
  vf2_call_limit=vf2_call_limit,
487
485
  vf2_max_trials=vf2_max_trials,
488
486
  backend_properties=backend_properties,
489
- seed_transpiler=seed_transpiler,
487
+ seed_transpiler=-1,
490
488
  use_barrier_before_measurement=True,
491
489
  )
492
490
  if optimization_level == 3:
@@ -504,7 +502,7 @@ class SabreSwapPassManager(PassManagerStagePlugin):
504
502
  vf2_call_limit=vf2_call_limit,
505
503
  vf2_max_trials=vf2_max_trials,
506
504
  backend_properties=backend_properties,
507
- seed_transpiler=seed_transpiler,
505
+ seed_transpiler=-1,
508
506
  use_barrier_before_measurement=True,
509
507
  )
510
508
  raise TranspilerError(f"Invalid optimization level specified: {optimization_level}")
@@ -515,7 +513,6 @@ class NoneRoutingPassManager(PassManagerStagePlugin):
515
513
 
516
514
  def pass_manager(self, pass_manager_config, optimization_level=None) -> PassManager:
517
515
  """Build routing stage PassManager."""
518
- seed_transpiler = pass_manager_config.seed_transpiler
519
516
  target = pass_manager_config.target
520
517
  coupling_map = pass_manager_config.coupling_map
521
518
  routing_pass = Error(
@@ -527,7 +524,7 @@ class NoneRoutingPassManager(PassManagerStagePlugin):
527
524
  routing_pass,
528
525
  target,
529
526
  coupling_map=coupling_map,
530
- seed_transpiler=seed_transpiler,
527
+ seed_transpiler=-1,
531
528
  use_barrier_before_measurement=True,
532
529
  )
533
530
 
@@ -793,7 +790,7 @@ class DefaultLayoutPassManager(PassManagerStagePlugin):
793
790
  )
794
791
  choose_layout_1 = VF2Layout(
795
792
  coupling_map=pass_manager_config.coupling_map,
796
- seed=pass_manager_config.seed_transpiler,
793
+ seed=-1,
797
794
  call_limit=int(5e4), # Set call limit to ~100ms with rustworkx 0.10.2
798
795
  properties=pass_manager_config.backend_properties,
799
796
  target=pass_manager_config.target,
@@ -826,7 +823,7 @@ class DefaultLayoutPassManager(PassManagerStagePlugin):
826
823
  elif optimization_level == 2:
827
824
  choose_layout_0 = VF2Layout(
828
825
  coupling_map=pass_manager_config.coupling_map,
829
- seed=pass_manager_config.seed_transpiler,
826
+ seed=-1,
830
827
  call_limit=int(5e6), # Set call limit to ~10s with rustworkx 0.10.2
831
828
  properties=pass_manager_config.backend_properties,
832
829
  target=pass_manager_config.target,
@@ -861,7 +858,7 @@ class DefaultLayoutPassManager(PassManagerStagePlugin):
861
858
  elif optimization_level == 3:
862
859
  choose_layout_0 = VF2Layout(
863
860
  coupling_map=pass_manager_config.coupling_map,
864
- seed=pass_manager_config.seed_transpiler,
861
+ seed=-1,
865
862
  call_limit=int(3e7), # Set call limit to ~60s with rustworkx 0.10.2
866
863
  properties=pass_manager_config.backend_properties,
867
864
  target=pass_manager_config.target,