qiskit 2.0.3__cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.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.
- qiskit/VERSION.txt +1 -0
- qiskit/__init__.py +141 -0
- qiskit/_accelerate.abi3.so +0 -0
- qiskit/_numpy_compat.py +73 -0
- qiskit/circuit/__init__.py +1343 -0
- qiskit/circuit/_add_control.py +312 -0
- qiskit/circuit/_classical_resource_map.py +150 -0
- qiskit/circuit/_standard_gates_commutations.py +3849 -0
- qiskit/circuit/_utils.py +167 -0
- qiskit/circuit/annotated_operation.py +279 -0
- qiskit/circuit/barrier.py +46 -0
- qiskit/circuit/classical/__init__.py +41 -0
- qiskit/circuit/classical/expr/__init__.py +266 -0
- qiskit/circuit/classical/expr/constructors.py +764 -0
- qiskit/circuit/classical/expr/expr.py +498 -0
- qiskit/circuit/classical/expr/visitors.py +375 -0
- qiskit/circuit/classical/types/__init__.py +113 -0
- qiskit/circuit/classical/types/ordering.py +229 -0
- qiskit/circuit/classical/types/types.py +153 -0
- qiskit/circuit/commutation_checker.py +133 -0
- qiskit/circuit/commutation_library.py +20 -0
- qiskit/circuit/controlflow/__init__.py +59 -0
- qiskit/circuit/controlflow/_builder_utils.py +211 -0
- qiskit/circuit/controlflow/box.py +163 -0
- qiskit/circuit/controlflow/break_loop.py +56 -0
- qiskit/circuit/controlflow/builder.py +791 -0
- qiskit/circuit/controlflow/continue_loop.py +56 -0
- qiskit/circuit/controlflow/control_flow.py +94 -0
- qiskit/circuit/controlflow/for_loop.py +218 -0
- qiskit/circuit/controlflow/if_else.py +498 -0
- qiskit/circuit/controlflow/switch_case.py +411 -0
- qiskit/circuit/controlflow/while_loop.py +166 -0
- qiskit/circuit/controlledgate.py +274 -0
- qiskit/circuit/delay.py +157 -0
- qiskit/circuit/duration.py +80 -0
- qiskit/circuit/equivalence.py +94 -0
- qiskit/circuit/equivalence_library.py +18 -0
- qiskit/circuit/exceptions.py +19 -0
- qiskit/circuit/gate.py +261 -0
- qiskit/circuit/instruction.py +564 -0
- qiskit/circuit/instructionset.py +132 -0
- qiskit/circuit/library/__init__.py +984 -0
- qiskit/circuit/library/arithmetic/__init__.py +40 -0
- qiskit/circuit/library/arithmetic/adders/__init__.py +18 -0
- qiskit/circuit/library/arithmetic/adders/adder.py +235 -0
- qiskit/circuit/library/arithmetic/adders/cdkm_ripple_carry_adder.py +123 -0
- qiskit/circuit/library/arithmetic/adders/draper_qft_adder.py +129 -0
- qiskit/circuit/library/arithmetic/adders/vbe_ripple_carry_adder.py +95 -0
- qiskit/circuit/library/arithmetic/exact_reciprocal.py +131 -0
- qiskit/circuit/library/arithmetic/functional_pauli_rotations.py +114 -0
- qiskit/circuit/library/arithmetic/integer_comparator.py +200 -0
- qiskit/circuit/library/arithmetic/linear_amplitude_function.py +363 -0
- qiskit/circuit/library/arithmetic/linear_pauli_rotations.py +243 -0
- qiskit/circuit/library/arithmetic/multipliers/__init__.py +17 -0
- qiskit/circuit/library/arithmetic/multipliers/hrs_cumulative_multiplier.py +145 -0
- qiskit/circuit/library/arithmetic/multipliers/multiplier.py +201 -0
- qiskit/circuit/library/arithmetic/multipliers/rg_qft_multiplier.py +108 -0
- qiskit/circuit/library/arithmetic/piecewise_chebyshev.py +502 -0
- qiskit/circuit/library/arithmetic/piecewise_linear_pauli_rotations.py +387 -0
- qiskit/circuit/library/arithmetic/piecewise_polynomial_pauli_rotations.py +493 -0
- qiskit/circuit/library/arithmetic/polynomial_pauli_rotations.py +389 -0
- qiskit/circuit/library/arithmetic/quadratic_form.py +364 -0
- qiskit/circuit/library/arithmetic/weighted_adder.py +409 -0
- qiskit/circuit/library/basis_change/__init__.py +15 -0
- qiskit/circuit/library/basis_change/qft.py +316 -0
- qiskit/circuit/library/bit_flip_oracle.py +130 -0
- qiskit/circuit/library/blueprintcircuit.py +316 -0
- qiskit/circuit/library/boolean_logic/__init__.py +18 -0
- qiskit/circuit/library/boolean_logic/inner_product.py +157 -0
- qiskit/circuit/library/boolean_logic/quantum_and.py +204 -0
- qiskit/circuit/library/boolean_logic/quantum_or.py +206 -0
- qiskit/circuit/library/boolean_logic/quantum_xor.py +167 -0
- qiskit/circuit/library/data_preparation/__init__.py +57 -0
- qiskit/circuit/library/data_preparation/_z_feature_map.py +115 -0
- qiskit/circuit/library/data_preparation/_zz_feature_map.py +150 -0
- qiskit/circuit/library/data_preparation/initializer.py +107 -0
- qiskit/circuit/library/data_preparation/pauli_feature_map.py +656 -0
- qiskit/circuit/library/data_preparation/state_preparation.py +336 -0
- qiskit/circuit/library/fourier_checking.py +160 -0
- qiskit/circuit/library/generalized_gates/__init__.py +30 -0
- qiskit/circuit/library/generalized_gates/diagonal.py +159 -0
- qiskit/circuit/library/generalized_gates/gms.py +175 -0
- qiskit/circuit/library/generalized_gates/gr.py +219 -0
- qiskit/circuit/library/generalized_gates/isometry.py +370 -0
- qiskit/circuit/library/generalized_gates/linear_function.py +318 -0
- qiskit/circuit/library/generalized_gates/mcg_up_to_diagonal.py +143 -0
- qiskit/circuit/library/generalized_gates/mcmt.py +316 -0
- qiskit/circuit/library/generalized_gates/pauli.py +84 -0
- qiskit/circuit/library/generalized_gates/permutation.py +198 -0
- qiskit/circuit/library/generalized_gates/rv.py +96 -0
- qiskit/circuit/library/generalized_gates/uc.py +303 -0
- qiskit/circuit/library/generalized_gates/uc_pauli_rot.py +164 -0
- qiskit/circuit/library/generalized_gates/ucrx.py +32 -0
- qiskit/circuit/library/generalized_gates/ucry.py +32 -0
- qiskit/circuit/library/generalized_gates/ucrz.py +32 -0
- qiskit/circuit/library/generalized_gates/unitary.py +217 -0
- qiskit/circuit/library/graph_state.py +172 -0
- qiskit/circuit/library/grover_operator.py +583 -0
- qiskit/circuit/library/hamiltonian_gate.py +142 -0
- qiskit/circuit/library/hidden_linear_function.py +163 -0
- qiskit/circuit/library/iqp.py +180 -0
- qiskit/circuit/library/n_local/__init__.py +45 -0
- qiskit/circuit/library/n_local/efficient_su2.py +282 -0
- qiskit/circuit/library/n_local/evolved_operator_ansatz.py +520 -0
- qiskit/circuit/library/n_local/excitation_preserving.py +303 -0
- qiskit/circuit/library/n_local/n_local.py +1477 -0
- qiskit/circuit/library/n_local/pauli_two_design.py +246 -0
- qiskit/circuit/library/n_local/qaoa_ansatz.py +367 -0
- qiskit/circuit/library/n_local/real_amplitudes.py +312 -0
- qiskit/circuit/library/n_local/two_local.py +289 -0
- qiskit/circuit/library/overlap.py +183 -0
- qiskit/circuit/library/pauli_evolution.py +201 -0
- qiskit/circuit/library/phase_estimation.py +177 -0
- qiskit/circuit/library/phase_oracle.py +239 -0
- qiskit/circuit/library/quantum_volume.py +180 -0
- qiskit/circuit/library/standard_gates/__init__.py +141 -0
- qiskit/circuit/library/standard_gates/dcx.py +77 -0
- qiskit/circuit/library/standard_gates/ecr.py +129 -0
- qiskit/circuit/library/standard_gates/equivalence_library.py +1800 -0
- qiskit/circuit/library/standard_gates/global_phase.py +84 -0
- qiskit/circuit/library/standard_gates/h.py +253 -0
- qiskit/circuit/library/standard_gates/i.py +76 -0
- qiskit/circuit/library/standard_gates/iswap.py +133 -0
- qiskit/circuit/library/standard_gates/p.py +422 -0
- qiskit/circuit/library/standard_gates/r.py +114 -0
- qiskit/circuit/library/standard_gates/rx.py +293 -0
- qiskit/circuit/library/standard_gates/rxx.py +180 -0
- qiskit/circuit/library/standard_gates/ry.py +286 -0
- qiskit/circuit/library/standard_gates/ryy.py +180 -0
- qiskit/circuit/library/standard_gates/rz.py +307 -0
- qiskit/circuit/library/standard_gates/rzx.py +226 -0
- qiskit/circuit/library/standard_gates/rzz.py +193 -0
- qiskit/circuit/library/standard_gates/s.py +419 -0
- qiskit/circuit/library/standard_gates/swap.py +281 -0
- qiskit/circuit/library/standard_gates/sx.py +310 -0
- qiskit/circuit/library/standard_gates/t.py +178 -0
- qiskit/circuit/library/standard_gates/u.py +395 -0
- qiskit/circuit/library/standard_gates/u1.py +490 -0
- qiskit/circuit/library/standard_gates/u2.py +145 -0
- qiskit/circuit/library/standard_gates/u3.py +428 -0
- qiskit/circuit/library/standard_gates/x.py +1481 -0
- qiskit/circuit/library/standard_gates/xx_minus_yy.py +202 -0
- qiskit/circuit/library/standard_gates/xx_plus_yy.py +236 -0
- qiskit/circuit/library/standard_gates/y.py +257 -0
- qiskit/circuit/library/standard_gates/z.py +338 -0
- qiskit/circuit/library/templates/__init__.py +92 -0
- qiskit/circuit/library/templates/clifford/__init__.py +33 -0
- qiskit/circuit/library/templates/clifford/clifford_2_1.py +34 -0
- qiskit/circuit/library/templates/clifford/clifford_2_2.py +35 -0
- qiskit/circuit/library/templates/clifford/clifford_2_3.py +34 -0
- qiskit/circuit/library/templates/clifford/clifford_2_4.py +34 -0
- qiskit/circuit/library/templates/clifford/clifford_3_1.py +35 -0
- qiskit/circuit/library/templates/clifford/clifford_4_1.py +38 -0
- qiskit/circuit/library/templates/clifford/clifford_4_2.py +37 -0
- qiskit/circuit/library/templates/clifford/clifford_4_3.py +38 -0
- qiskit/circuit/library/templates/clifford/clifford_4_4.py +37 -0
- qiskit/circuit/library/templates/clifford/clifford_5_1.py +40 -0
- qiskit/circuit/library/templates/clifford/clifford_6_1.py +40 -0
- qiskit/circuit/library/templates/clifford/clifford_6_2.py +40 -0
- qiskit/circuit/library/templates/clifford/clifford_6_3.py +40 -0
- qiskit/circuit/library/templates/clifford/clifford_6_4.py +38 -0
- qiskit/circuit/library/templates/clifford/clifford_6_5.py +40 -0
- qiskit/circuit/library/templates/clifford/clifford_8_1.py +42 -0
- qiskit/circuit/library/templates/clifford/clifford_8_2.py +42 -0
- qiskit/circuit/library/templates/clifford/clifford_8_3.py +41 -0
- qiskit/circuit/library/templates/nct/__init__.py +67 -0
- qiskit/circuit/library/templates/nct/template_nct_2a_1.py +34 -0
- qiskit/circuit/library/templates/nct/template_nct_2a_2.py +35 -0
- qiskit/circuit/library/templates/nct/template_nct_2a_3.py +37 -0
- qiskit/circuit/library/templates/nct/template_nct_4a_1.py +43 -0
- qiskit/circuit/library/templates/nct/template_nct_4a_2.py +41 -0
- qiskit/circuit/library/templates/nct/template_nct_4a_3.py +39 -0
- qiskit/circuit/library/templates/nct/template_nct_4b_1.py +41 -0
- qiskit/circuit/library/templates/nct/template_nct_4b_2.py +39 -0
- qiskit/circuit/library/templates/nct/template_nct_5a_1.py +40 -0
- qiskit/circuit/library/templates/nct/template_nct_5a_2.py +40 -0
- qiskit/circuit/library/templates/nct/template_nct_5a_3.py +40 -0
- qiskit/circuit/library/templates/nct/template_nct_5a_4.py +39 -0
- qiskit/circuit/library/templates/nct/template_nct_6a_1.py +40 -0
- qiskit/circuit/library/templates/nct/template_nct_6a_2.py +41 -0
- qiskit/circuit/library/templates/nct/template_nct_6a_3.py +41 -0
- qiskit/circuit/library/templates/nct/template_nct_6a_4.py +41 -0
- qiskit/circuit/library/templates/nct/template_nct_6b_1.py +41 -0
- qiskit/circuit/library/templates/nct/template_nct_6b_2.py +41 -0
- qiskit/circuit/library/templates/nct/template_nct_6c_1.py +41 -0
- qiskit/circuit/library/templates/nct/template_nct_7a_1.py +43 -0
- qiskit/circuit/library/templates/nct/template_nct_7b_1.py +43 -0
- qiskit/circuit/library/templates/nct/template_nct_7c_1.py +43 -0
- qiskit/circuit/library/templates/nct/template_nct_7d_1.py +43 -0
- qiskit/circuit/library/templates/nct/template_nct_7e_1.py +43 -0
- qiskit/circuit/library/templates/nct/template_nct_9a_1.py +45 -0
- qiskit/circuit/library/templates/nct/template_nct_9c_1.py +43 -0
- qiskit/circuit/library/templates/nct/template_nct_9c_10.py +44 -0
- qiskit/circuit/library/templates/nct/template_nct_9c_11.py +44 -0
- qiskit/circuit/library/templates/nct/template_nct_9c_12.py +44 -0
- qiskit/circuit/library/templates/nct/template_nct_9c_2.py +44 -0
- qiskit/circuit/library/templates/nct/template_nct_9c_3.py +44 -0
- qiskit/circuit/library/templates/nct/template_nct_9c_4.py +44 -0
- qiskit/circuit/library/templates/nct/template_nct_9c_5.py +44 -0
- qiskit/circuit/library/templates/nct/template_nct_9c_6.py +44 -0
- qiskit/circuit/library/templates/nct/template_nct_9c_7.py +44 -0
- qiskit/circuit/library/templates/nct/template_nct_9c_8.py +44 -0
- qiskit/circuit/library/templates/nct/template_nct_9c_9.py +44 -0
- qiskit/circuit/library/templates/nct/template_nct_9d_1.py +43 -0
- qiskit/circuit/library/templates/nct/template_nct_9d_10.py +44 -0
- qiskit/circuit/library/templates/nct/template_nct_9d_2.py +44 -0
- qiskit/circuit/library/templates/nct/template_nct_9d_3.py +44 -0
- qiskit/circuit/library/templates/nct/template_nct_9d_4.py +44 -0
- qiskit/circuit/library/templates/nct/template_nct_9d_5.py +44 -0
- qiskit/circuit/library/templates/nct/template_nct_9d_6.py +44 -0
- qiskit/circuit/library/templates/nct/template_nct_9d_7.py +44 -0
- qiskit/circuit/library/templates/nct/template_nct_9d_8.py +44 -0
- qiskit/circuit/library/templates/nct/template_nct_9d_9.py +44 -0
- qiskit/circuit/library/templates/rzx/__init__.py +25 -0
- qiskit/circuit/library/templates/rzx/rzx_cy.py +47 -0
- qiskit/circuit/library/templates/rzx/rzx_xz.py +54 -0
- qiskit/circuit/library/templates/rzx/rzx_yz.py +45 -0
- qiskit/circuit/library/templates/rzx/rzx_zz1.py +69 -0
- qiskit/circuit/library/templates/rzx/rzx_zz2.py +59 -0
- qiskit/circuit/library/templates/rzx/rzx_zz3.py +59 -0
- qiskit/circuit/measure.py +53 -0
- qiskit/circuit/operation.py +68 -0
- qiskit/circuit/parameter.py +179 -0
- qiskit/circuit/parameterexpression.py +703 -0
- qiskit/circuit/parametertable.py +119 -0
- qiskit/circuit/parametervector.py +140 -0
- qiskit/circuit/quantumcircuit.py +7540 -0
- qiskit/circuit/quantumcircuitdata.py +136 -0
- qiskit/circuit/random/__init__.py +15 -0
- qiskit/circuit/random/utils.py +366 -0
- qiskit/circuit/reset.py +37 -0
- qiskit/circuit/singleton.py +600 -0
- qiskit/circuit/store.py +89 -0
- qiskit/circuit/tools/__init__.py +16 -0
- qiskit/circuit/tools/pi_check.py +193 -0
- qiskit/circuit/twirling.py +145 -0
- qiskit/compiler/__init__.py +27 -0
- qiskit/compiler/transpiler.py +375 -0
- qiskit/converters/__init__.py +74 -0
- qiskit/converters/circuit_to_dag.py +80 -0
- qiskit/converters/circuit_to_dagdependency.py +49 -0
- qiskit/converters/circuit_to_dagdependency_v2.py +46 -0
- qiskit/converters/circuit_to_gate.py +107 -0
- qiskit/converters/circuit_to_instruction.py +142 -0
- qiskit/converters/dag_to_circuit.py +79 -0
- qiskit/converters/dag_to_dagdependency.py +54 -0
- qiskit/converters/dag_to_dagdependency_v2.py +43 -0
- qiskit/converters/dagdependency_to_circuit.py +40 -0
- qiskit/converters/dagdependency_to_dag.py +48 -0
- qiskit/dagcircuit/__init__.py +55 -0
- qiskit/dagcircuit/collect_blocks.py +407 -0
- qiskit/dagcircuit/dagcircuit.py +24 -0
- qiskit/dagcircuit/dagdependency.py +612 -0
- qiskit/dagcircuit/dagdependency_v2.py +566 -0
- qiskit/dagcircuit/dagdepnode.py +160 -0
- qiskit/dagcircuit/dagnode.py +188 -0
- qiskit/dagcircuit/exceptions.py +42 -0
- qiskit/exceptions.py +153 -0
- qiskit/passmanager/__init__.py +258 -0
- qiskit/passmanager/base_tasks.py +230 -0
- qiskit/passmanager/compilation_status.py +74 -0
- qiskit/passmanager/exceptions.py +19 -0
- qiskit/passmanager/flow_controllers.py +116 -0
- qiskit/passmanager/passmanager.py +353 -0
- qiskit/primitives/__init__.py +490 -0
- qiskit/primitives/backend_estimator_v2.py +530 -0
- qiskit/primitives/backend_sampler_v2.py +339 -0
- qiskit/primitives/base/__init__.py +20 -0
- qiskit/primitives/base/base_estimator.py +247 -0
- qiskit/primitives/base/base_primitive_job.py +78 -0
- qiskit/primitives/base/base_primitive_v1.py +45 -0
- qiskit/primitives/base/base_result_v1.py +65 -0
- qiskit/primitives/base/base_sampler.py +196 -0
- qiskit/primitives/base/estimator_result_v1.py +46 -0
- qiskit/primitives/base/sampler_result_v1.py +45 -0
- qiskit/primitives/base/validation_v1.py +250 -0
- qiskit/primitives/containers/__init__.py +26 -0
- qiskit/primitives/containers/bindings_array.py +391 -0
- qiskit/primitives/containers/bit_array.py +764 -0
- qiskit/primitives/containers/data_bin.py +175 -0
- qiskit/primitives/containers/estimator_pub.py +222 -0
- qiskit/primitives/containers/object_array.py +94 -0
- qiskit/primitives/containers/observables_array.py +296 -0
- qiskit/primitives/containers/primitive_result.py +53 -0
- qiskit/primitives/containers/pub_result.py +51 -0
- qiskit/primitives/containers/sampler_pub.py +193 -0
- qiskit/primitives/containers/sampler_pub_result.py +74 -0
- qiskit/primitives/containers/shape.py +129 -0
- qiskit/primitives/primitive_job.py +81 -0
- qiskit/primitives/statevector_estimator.py +175 -0
- qiskit/primitives/statevector_sampler.py +290 -0
- qiskit/primitives/utils.py +72 -0
- qiskit/providers/__init__.py +677 -0
- qiskit/providers/backend.py +364 -0
- qiskit/providers/basic_provider/__init__.py +47 -0
- qiskit/providers/basic_provider/basic_provider.py +121 -0
- qiskit/providers/basic_provider/basic_provider_job.py +65 -0
- qiskit/providers/basic_provider/basic_provider_tools.py +218 -0
- qiskit/providers/basic_provider/basic_simulator.py +693 -0
- qiskit/providers/basic_provider/exceptions.py +30 -0
- qiskit/providers/exceptions.py +33 -0
- qiskit/providers/fake_provider/__init__.py +69 -0
- qiskit/providers/fake_provider/generic_backend_v2.py +374 -0
- qiskit/providers/fake_provider/utils/__init__.py +15 -0
- qiskit/providers/job.py +147 -0
- qiskit/providers/jobstatus.py +30 -0
- qiskit/providers/options.py +273 -0
- qiskit/providers/providerutils.py +110 -0
- qiskit/qasm/libs/dummy/stdgates.inc +75 -0
- qiskit/qasm/libs/qelib1.inc +266 -0
- qiskit/qasm/libs/stdgates.inc +82 -0
- qiskit/qasm2/__init__.py +669 -0
- qiskit/qasm2/exceptions.py +27 -0
- qiskit/qasm2/export.py +364 -0
- qiskit/qasm2/parse.py +438 -0
- qiskit/qasm3/__init__.py +372 -0
- qiskit/qasm3/ast.py +782 -0
- qiskit/qasm3/exceptions.py +27 -0
- qiskit/qasm3/experimental.py +70 -0
- qiskit/qasm3/exporter.py +1340 -0
- qiskit/qasm3/printer.py +608 -0
- qiskit/qpy/__init__.py +1965 -0
- qiskit/qpy/binary_io/__init__.py +35 -0
- qiskit/qpy/binary_io/circuits.py +1455 -0
- qiskit/qpy/binary_io/parse_sympy_repr.py +121 -0
- qiskit/qpy/binary_io/schedules.py +308 -0
- qiskit/qpy/binary_io/value.py +1165 -0
- qiskit/qpy/common.py +353 -0
- qiskit/qpy/exceptions.py +53 -0
- qiskit/qpy/formats.py +442 -0
- qiskit/qpy/interface.py +344 -0
- qiskit/qpy/type_keys.py +409 -0
- qiskit/quantum_info/__init__.py +162 -0
- qiskit/quantum_info/analysis/__init__.py +17 -0
- qiskit/quantum_info/analysis/average.py +47 -0
- qiskit/quantum_info/analysis/distance.py +104 -0
- qiskit/quantum_info/analysis/make_observable.py +44 -0
- qiskit/quantum_info/analysis/z2_symmetries.py +484 -0
- qiskit/quantum_info/operators/__init__.py +28 -0
- qiskit/quantum_info/operators/base_operator.py +145 -0
- qiskit/quantum_info/operators/channel/__init__.py +29 -0
- qiskit/quantum_info/operators/channel/chi.py +191 -0
- qiskit/quantum_info/operators/channel/choi.py +218 -0
- qiskit/quantum_info/operators/channel/kraus.py +337 -0
- qiskit/quantum_info/operators/channel/ptm.py +204 -0
- qiskit/quantum_info/operators/channel/quantum_channel.py +348 -0
- qiskit/quantum_info/operators/channel/stinespring.py +296 -0
- qiskit/quantum_info/operators/channel/superop.py +373 -0
- qiskit/quantum_info/operators/channel/transformations.py +490 -0
- qiskit/quantum_info/operators/custom_iterator.py +48 -0
- qiskit/quantum_info/operators/dihedral/__init__.py +18 -0
- qiskit/quantum_info/operators/dihedral/dihedral.py +511 -0
- qiskit/quantum_info/operators/dihedral/dihedral_circuits.py +216 -0
- qiskit/quantum_info/operators/dihedral/polynomial.py +313 -0
- qiskit/quantum_info/operators/dihedral/random.py +64 -0
- qiskit/quantum_info/operators/linear_op.py +25 -0
- qiskit/quantum_info/operators/measures.py +418 -0
- qiskit/quantum_info/operators/mixins/__init__.py +52 -0
- qiskit/quantum_info/operators/mixins/adjoint.py +52 -0
- qiskit/quantum_info/operators/mixins/group.py +171 -0
- qiskit/quantum_info/operators/mixins/linear.py +84 -0
- qiskit/quantum_info/operators/mixins/multiply.py +62 -0
- qiskit/quantum_info/operators/mixins/tolerances.py +72 -0
- qiskit/quantum_info/operators/op_shape.py +525 -0
- qiskit/quantum_info/operators/operator.py +869 -0
- qiskit/quantum_info/operators/operator_utils.py +76 -0
- qiskit/quantum_info/operators/predicates.py +183 -0
- qiskit/quantum_info/operators/random.py +154 -0
- qiskit/quantum_info/operators/scalar_op.py +254 -0
- qiskit/quantum_info/operators/symplectic/__init__.py +23 -0
- qiskit/quantum_info/operators/symplectic/base_pauli.py +719 -0
- qiskit/quantum_info/operators/symplectic/clifford.py +1032 -0
- qiskit/quantum_info/operators/symplectic/clifford_circuits.py +558 -0
- qiskit/quantum_info/operators/symplectic/pauli.py +755 -0
- qiskit/quantum_info/operators/symplectic/pauli_list.py +1242 -0
- qiskit/quantum_info/operators/symplectic/pauli_utils.py +40 -0
- qiskit/quantum_info/operators/symplectic/random.py +117 -0
- qiskit/quantum_info/operators/symplectic/sparse_pauli_op.py +1239 -0
- qiskit/quantum_info/operators/utils/__init__.py +20 -0
- qiskit/quantum_info/operators/utils/anti_commutator.py +36 -0
- qiskit/quantum_info/operators/utils/commutator.py +36 -0
- qiskit/quantum_info/operators/utils/double_commutator.py +76 -0
- qiskit/quantum_info/quaternion.py +156 -0
- qiskit/quantum_info/random.py +26 -0
- qiskit/quantum_info/states/__init__.py +28 -0
- qiskit/quantum_info/states/densitymatrix.py +857 -0
- qiskit/quantum_info/states/measures.py +288 -0
- qiskit/quantum_info/states/quantum_state.py +503 -0
- qiskit/quantum_info/states/random.py +157 -0
- qiskit/quantum_info/states/stabilizerstate.py +805 -0
- qiskit/quantum_info/states/statevector.py +977 -0
- qiskit/quantum_info/states/utils.py +247 -0
- qiskit/result/__init__.py +61 -0
- qiskit/result/counts.py +189 -0
- qiskit/result/distributions/__init__.py +17 -0
- qiskit/result/distributions/probability.py +100 -0
- qiskit/result/distributions/quasi.py +154 -0
- qiskit/result/exceptions.py +40 -0
- qiskit/result/models.py +241 -0
- qiskit/result/postprocess.py +239 -0
- qiskit/result/result.py +385 -0
- qiskit/result/sampled_expval.py +74 -0
- qiskit/result/utils.py +294 -0
- qiskit/synthesis/__init__.py +240 -0
- qiskit/synthesis/arithmetic/__init__.py +18 -0
- qiskit/synthesis/arithmetic/adders/__init__.py +17 -0
- qiskit/synthesis/arithmetic/adders/cdkm_ripple_carry_adder.py +154 -0
- qiskit/synthesis/arithmetic/adders/draper_qft_adder.py +103 -0
- qiskit/synthesis/arithmetic/adders/vbe_ripple_carry_adder.py +161 -0
- qiskit/synthesis/arithmetic/comparators/__init__.py +16 -0
- qiskit/synthesis/arithmetic/comparators/compare_2s.py +112 -0
- qiskit/synthesis/arithmetic/comparators/compare_greedy.py +66 -0
- qiskit/synthesis/arithmetic/multipliers/__init__.py +16 -0
- qiskit/synthesis/arithmetic/multipliers/hrs_cumulative_multiplier.py +103 -0
- qiskit/synthesis/arithmetic/multipliers/rg_qft_multiplier.py +100 -0
- qiskit/synthesis/arithmetic/weighted_sum.py +155 -0
- qiskit/synthesis/boolean/__init__.py +13 -0
- qiskit/synthesis/boolean/boolean_expression.py +231 -0
- qiskit/synthesis/boolean/boolean_expression_synth.py +124 -0
- qiskit/synthesis/boolean/boolean_expression_visitor.py +96 -0
- qiskit/synthesis/clifford/__init__.py +19 -0
- qiskit/synthesis/clifford/clifford_decompose_ag.py +178 -0
- qiskit/synthesis/clifford/clifford_decompose_bm.py +46 -0
- qiskit/synthesis/clifford/clifford_decompose_full.py +64 -0
- qiskit/synthesis/clifford/clifford_decompose_greedy.py +58 -0
- qiskit/synthesis/clifford/clifford_decompose_layers.py +447 -0
- qiskit/synthesis/cnotdihedral/__init__.py +17 -0
- qiskit/synthesis/cnotdihedral/cnotdihedral_decompose_full.py +52 -0
- qiskit/synthesis/cnotdihedral/cnotdihedral_decompose_general.py +141 -0
- qiskit/synthesis/cnotdihedral/cnotdihedral_decompose_two_qubits.py +266 -0
- qiskit/synthesis/discrete_basis/__init__.py +16 -0
- qiskit/synthesis/discrete_basis/commutator_decompose.py +265 -0
- qiskit/synthesis/discrete_basis/gate_sequence.py +421 -0
- qiskit/synthesis/discrete_basis/generate_basis_approximations.py +165 -0
- qiskit/synthesis/discrete_basis/solovay_kitaev.py +240 -0
- qiskit/synthesis/evolution/__init__.py +21 -0
- qiskit/synthesis/evolution/evolution_synthesis.py +48 -0
- qiskit/synthesis/evolution/lie_trotter.py +120 -0
- qiskit/synthesis/evolution/matrix_synthesis.py +47 -0
- qiskit/synthesis/evolution/pauli_network.py +80 -0
- qiskit/synthesis/evolution/product_formula.py +313 -0
- qiskit/synthesis/evolution/qdrift.py +130 -0
- qiskit/synthesis/evolution/suzuki_trotter.py +224 -0
- qiskit/synthesis/linear/__init__.py +26 -0
- qiskit/synthesis/linear/cnot_synth.py +69 -0
- qiskit/synthesis/linear/linear_circuits_utils.py +128 -0
- qiskit/synthesis/linear/linear_depth_lnn.py +61 -0
- qiskit/synthesis/linear/linear_matrix_utils.py +27 -0
- qiskit/synthesis/linear_phase/__init__.py +17 -0
- qiskit/synthesis/linear_phase/cnot_phase_synth.py +206 -0
- qiskit/synthesis/linear_phase/cx_cz_depth_lnn.py +61 -0
- qiskit/synthesis/linear_phase/cz_depth_lnn.py +58 -0
- qiskit/synthesis/multi_controlled/__init__.py +25 -0
- qiskit/synthesis/multi_controlled/mcmt_vchain.py +52 -0
- qiskit/synthesis/multi_controlled/mcx_synthesis.py +359 -0
- qiskit/synthesis/multi_controlled/multi_control_rotation_gates.py +206 -0
- qiskit/synthesis/one_qubit/__init__.py +15 -0
- qiskit/synthesis/one_qubit/one_qubit_decompose.py +288 -0
- qiskit/synthesis/permutation/__init__.py +18 -0
- qiskit/synthesis/permutation/permutation_full.py +78 -0
- qiskit/synthesis/permutation/permutation_lnn.py +54 -0
- qiskit/synthesis/permutation/permutation_reverse_lnn.py +93 -0
- qiskit/synthesis/permutation/permutation_utils.py +16 -0
- qiskit/synthesis/qft/__init__.py +16 -0
- qiskit/synthesis/qft/qft_decompose_full.py +97 -0
- qiskit/synthesis/qft/qft_decompose_lnn.py +79 -0
- qiskit/synthesis/stabilizer/__init__.py +16 -0
- qiskit/synthesis/stabilizer/stabilizer_circuit.py +149 -0
- qiskit/synthesis/stabilizer/stabilizer_decompose.py +194 -0
- qiskit/synthesis/two_qubit/__init__.py +20 -0
- qiskit/synthesis/two_qubit/local_invariance.py +63 -0
- qiskit/synthesis/two_qubit/two_qubit_decompose.py +583 -0
- qiskit/synthesis/two_qubit/xx_decompose/__init__.py +19 -0
- qiskit/synthesis/two_qubit/xx_decompose/circuits.py +300 -0
- qiskit/synthesis/two_qubit/xx_decompose/decomposer.py +324 -0
- qiskit/synthesis/two_qubit/xx_decompose/embodiments.py +163 -0
- qiskit/synthesis/two_qubit/xx_decompose/paths.py +412 -0
- qiskit/synthesis/two_qubit/xx_decompose/polytopes.py +262 -0
- qiskit/synthesis/two_qubit/xx_decompose/utilities.py +40 -0
- qiskit/synthesis/two_qubit/xx_decompose/weyl.py +133 -0
- qiskit/synthesis/unitary/__init__.py +13 -0
- qiskit/synthesis/unitary/aqc/__init__.py +177 -0
- qiskit/synthesis/unitary/aqc/approximate.py +116 -0
- qiskit/synthesis/unitary/aqc/aqc.py +175 -0
- qiskit/synthesis/unitary/aqc/cnot_structures.py +300 -0
- qiskit/synthesis/unitary/aqc/cnot_unit_circuit.py +103 -0
- qiskit/synthesis/unitary/aqc/cnot_unit_objective.py +299 -0
- qiskit/synthesis/unitary/aqc/elementary_operations.py +108 -0
- qiskit/synthesis/unitary/aqc/fast_gradient/__init__.py +164 -0
- qiskit/synthesis/unitary/aqc/fast_gradient/fast_grad_utils.py +237 -0
- qiskit/synthesis/unitary/aqc/fast_gradient/fast_gradient.py +226 -0
- qiskit/synthesis/unitary/aqc/fast_gradient/layer.py +370 -0
- qiskit/synthesis/unitary/aqc/fast_gradient/pmatrix.py +312 -0
- qiskit/synthesis/unitary/qsd.py +288 -0
- qiskit/transpiler/__init__.py +1345 -0
- qiskit/transpiler/basepasses.py +190 -0
- qiskit/transpiler/coupling.py +500 -0
- qiskit/transpiler/exceptions.py +59 -0
- qiskit/transpiler/instruction_durations.py +281 -0
- qiskit/transpiler/layout.py +740 -0
- qiskit/transpiler/passes/__init__.py +276 -0
- qiskit/transpiler/passes/analysis/__init__.py +23 -0
- qiskit/transpiler/passes/analysis/count_ops.py +30 -0
- qiskit/transpiler/passes/analysis/count_ops_longest_path.py +26 -0
- qiskit/transpiler/passes/analysis/dag_longest_path.py +24 -0
- qiskit/transpiler/passes/analysis/depth.py +33 -0
- qiskit/transpiler/passes/analysis/num_qubits.py +26 -0
- qiskit/transpiler/passes/analysis/num_tensor_factors.py +26 -0
- qiskit/transpiler/passes/analysis/resource_estimation.py +41 -0
- qiskit/transpiler/passes/analysis/size.py +36 -0
- qiskit/transpiler/passes/analysis/width.py +27 -0
- qiskit/transpiler/passes/basis/__init__.py +19 -0
- qiskit/transpiler/passes/basis/basis_translator.py +138 -0
- qiskit/transpiler/passes/basis/decompose.py +137 -0
- qiskit/transpiler/passes/basis/translate_parameterized.py +175 -0
- qiskit/transpiler/passes/basis/unroll_3q_or_more.py +84 -0
- qiskit/transpiler/passes/basis/unroll_custom_definitions.py +110 -0
- qiskit/transpiler/passes/layout/__init__.py +26 -0
- qiskit/transpiler/passes/layout/_csp_custom_solver.py +65 -0
- qiskit/transpiler/passes/layout/apply_layout.py +128 -0
- qiskit/transpiler/passes/layout/csp_layout.py +132 -0
- qiskit/transpiler/passes/layout/dense_layout.py +177 -0
- qiskit/transpiler/passes/layout/disjoint_utils.py +219 -0
- qiskit/transpiler/passes/layout/enlarge_with_ancilla.py +49 -0
- qiskit/transpiler/passes/layout/full_ancilla_allocation.py +116 -0
- qiskit/transpiler/passes/layout/layout_2q_distance.py +77 -0
- qiskit/transpiler/passes/layout/sabre_layout.py +506 -0
- qiskit/transpiler/passes/layout/sabre_pre_layout.py +225 -0
- qiskit/transpiler/passes/layout/set_layout.py +69 -0
- qiskit/transpiler/passes/layout/trivial_layout.py +66 -0
- qiskit/transpiler/passes/layout/vf2_layout.py +256 -0
- qiskit/transpiler/passes/layout/vf2_post_layout.py +376 -0
- qiskit/transpiler/passes/layout/vf2_utils.py +235 -0
- qiskit/transpiler/passes/optimization/__init__.py +42 -0
- qiskit/transpiler/passes/optimization/_gate_extension.py +80 -0
- qiskit/transpiler/passes/optimization/collect_1q_runs.py +31 -0
- qiskit/transpiler/passes/optimization/collect_2q_blocks.py +35 -0
- qiskit/transpiler/passes/optimization/collect_and_collapse.py +117 -0
- qiskit/transpiler/passes/optimization/collect_cliffords.py +109 -0
- qiskit/transpiler/passes/optimization/collect_linear_functions.py +85 -0
- qiskit/transpiler/passes/optimization/collect_multiqubit_blocks.py +242 -0
- qiskit/transpiler/passes/optimization/commutation_analysis.py +44 -0
- qiskit/transpiler/passes/optimization/commutative_cancellation.py +82 -0
- qiskit/transpiler/passes/optimization/commutative_inverse_cancellation.py +140 -0
- qiskit/transpiler/passes/optimization/consolidate_blocks.py +176 -0
- qiskit/transpiler/passes/optimization/contract_idle_wires_in_control_flow.py +104 -0
- qiskit/transpiler/passes/optimization/elide_permutations.py +91 -0
- qiskit/transpiler/passes/optimization/hoare_opt.py +420 -0
- qiskit/transpiler/passes/optimization/inverse_cancellation.py +95 -0
- qiskit/transpiler/passes/optimization/light_cone.py +135 -0
- qiskit/transpiler/passes/optimization/optimize_1q_commutation.py +267 -0
- qiskit/transpiler/passes/optimization/optimize_1q_decomposition.py +250 -0
- qiskit/transpiler/passes/optimization/optimize_1q_gates.py +384 -0
- qiskit/transpiler/passes/optimization/optimize_annotated.py +449 -0
- qiskit/transpiler/passes/optimization/optimize_cliffords.py +89 -0
- qiskit/transpiler/passes/optimization/optimize_swap_before_measure.py +71 -0
- qiskit/transpiler/passes/optimization/remove_diagonal_gates_before_measure.py +41 -0
- qiskit/transpiler/passes/optimization/remove_final_reset.py +37 -0
- qiskit/transpiler/passes/optimization/remove_identity_equiv.py +70 -0
- qiskit/transpiler/passes/optimization/remove_reset_in_zero_state.py +37 -0
- qiskit/transpiler/passes/optimization/reset_after_measure_simplification.py +50 -0
- qiskit/transpiler/passes/optimization/split_2q_unitaries.py +63 -0
- qiskit/transpiler/passes/optimization/template_matching/__init__.py +19 -0
- qiskit/transpiler/passes/optimization/template_matching/backward_match.py +749 -0
- qiskit/transpiler/passes/optimization/template_matching/forward_match.py +452 -0
- qiskit/transpiler/passes/optimization/template_matching/maximal_matches.py +77 -0
- qiskit/transpiler/passes/optimization/template_matching/template_matching.py +370 -0
- qiskit/transpiler/passes/optimization/template_matching/template_substitution.py +639 -0
- qiskit/transpiler/passes/optimization/template_optimization.py +158 -0
- qiskit/transpiler/passes/routing/__init__.py +21 -0
- qiskit/transpiler/passes/routing/algorithms/__init__.py +33 -0
- qiskit/transpiler/passes/routing/algorithms/token_swapper.py +105 -0
- qiskit/transpiler/passes/routing/algorithms/types.py +46 -0
- qiskit/transpiler/passes/routing/algorithms/util.py +103 -0
- qiskit/transpiler/passes/routing/basic_swap.py +166 -0
- qiskit/transpiler/passes/routing/commuting_2q_gate_routing/__init__.py +25 -0
- qiskit/transpiler/passes/routing/commuting_2q_gate_routing/commuting_2q_block.py +60 -0
- qiskit/transpiler/passes/routing/commuting_2q_gate_routing/commuting_2q_gate_router.py +397 -0
- qiskit/transpiler/passes/routing/commuting_2q_gate_routing/pauli_2q_evolution_commutation.py +145 -0
- qiskit/transpiler/passes/routing/commuting_2q_gate_routing/swap_strategy.py +306 -0
- qiskit/transpiler/passes/routing/layout_transformation.py +119 -0
- qiskit/transpiler/passes/routing/lookahead_swap.py +390 -0
- qiskit/transpiler/passes/routing/sabre_swap.py +463 -0
- qiskit/transpiler/passes/routing/star_prerouting.py +408 -0
- qiskit/transpiler/passes/routing/utils.py +35 -0
- qiskit/transpiler/passes/scheduling/__init__.py +21 -0
- qiskit/transpiler/passes/scheduling/alignments/__init__.py +79 -0
- qiskit/transpiler/passes/scheduling/alignments/check_durations.py +70 -0
- qiskit/transpiler/passes/scheduling/alignments/reschedule.py +251 -0
- qiskit/transpiler/passes/scheduling/padding/__init__.py +16 -0
- qiskit/transpiler/passes/scheduling/padding/base_padding.py +284 -0
- qiskit/transpiler/passes/scheduling/padding/dynamical_decoupling.py +415 -0
- qiskit/transpiler/passes/scheduling/padding/pad_delay.py +90 -0
- qiskit/transpiler/passes/scheduling/scheduling/__init__.py +17 -0
- qiskit/transpiler/passes/scheduling/scheduling/alap.py +93 -0
- qiskit/transpiler/passes/scheduling/scheduling/asap.py +100 -0
- qiskit/transpiler/passes/scheduling/scheduling/base_scheduler.py +88 -0
- qiskit/transpiler/passes/scheduling/scheduling/set_io_latency.py +64 -0
- qiskit/transpiler/passes/scheduling/time_unit_conversion.py +237 -0
- qiskit/transpiler/passes/synthesis/__init__.py +20 -0
- qiskit/transpiler/passes/synthesis/aqc_plugin.py +153 -0
- qiskit/transpiler/passes/synthesis/default_unitary_synth_plugin.py +653 -0
- qiskit/transpiler/passes/synthesis/high_level_synthesis.py +429 -0
- qiskit/transpiler/passes/synthesis/hls_plugins.py +1963 -0
- qiskit/transpiler/passes/synthesis/linear_functions_synthesis.py +41 -0
- qiskit/transpiler/passes/synthesis/plugin.py +738 -0
- qiskit/transpiler/passes/synthesis/solovay_kitaev_synthesis.py +313 -0
- qiskit/transpiler/passes/synthesis/unitary_synthesis.py +425 -0
- qiskit/transpiler/passes/utils/__init__.py +32 -0
- qiskit/transpiler/passes/utils/barrier_before_final_measurements.py +41 -0
- qiskit/transpiler/passes/utils/check_gate_direction.py +60 -0
- qiskit/transpiler/passes/utils/check_map.py +78 -0
- qiskit/transpiler/passes/utils/contains_instruction.py +45 -0
- qiskit/transpiler/passes/utils/control_flow.py +61 -0
- qiskit/transpiler/passes/utils/dag_fixed_point.py +36 -0
- qiskit/transpiler/passes/utils/error.py +69 -0
- qiskit/transpiler/passes/utils/filter_op_nodes.py +66 -0
- qiskit/transpiler/passes/utils/fixed_point.py +48 -0
- qiskit/transpiler/passes/utils/gate_direction.py +93 -0
- qiskit/transpiler/passes/utils/gates_basis.py +51 -0
- qiskit/transpiler/passes/utils/merge_adjacent_barriers.py +163 -0
- qiskit/transpiler/passes/utils/minimum_point.py +118 -0
- qiskit/transpiler/passes/utils/remove_barriers.py +50 -0
- qiskit/transpiler/passes/utils/remove_final_measurements.py +121 -0
- qiskit/transpiler/passes/utils/unroll_forloops.py +81 -0
- qiskit/transpiler/passmanager.py +503 -0
- qiskit/transpiler/passmanager_config.py +151 -0
- qiskit/transpiler/preset_passmanagers/__init__.py +93 -0
- qiskit/transpiler/preset_passmanagers/builtin_plugins.py +993 -0
- qiskit/transpiler/preset_passmanagers/common.py +672 -0
- qiskit/transpiler/preset_passmanagers/generate_preset_pass_manager.py +437 -0
- qiskit/transpiler/preset_passmanagers/level0.py +104 -0
- qiskit/transpiler/preset_passmanagers/level1.py +108 -0
- qiskit/transpiler/preset_passmanagers/level2.py +109 -0
- qiskit/transpiler/preset_passmanagers/level3.py +110 -0
- qiskit/transpiler/preset_passmanagers/plugin.py +346 -0
- qiskit/transpiler/target.py +905 -0
- qiskit/transpiler/timing_constraints.py +59 -0
- qiskit/user_config.py +266 -0
- qiskit/utils/__init__.py +90 -0
- qiskit/utils/classtools.py +146 -0
- qiskit/utils/deprecation.py +382 -0
- qiskit/utils/lazy_tester.py +363 -0
- qiskit/utils/optionals.py +354 -0
- qiskit/utils/parallel.py +318 -0
- qiskit/utils/units.py +146 -0
- qiskit/version.py +84 -0
- qiskit/visualization/__init__.py +290 -0
- qiskit/visualization/array.py +207 -0
- qiskit/visualization/bloch.py +778 -0
- qiskit/visualization/circuit/__init__.py +15 -0
- qiskit/visualization/circuit/_utils.py +675 -0
- qiskit/visualization/circuit/circuit_visualization.py +735 -0
- qiskit/visualization/circuit/latex.py +661 -0
- qiskit/visualization/circuit/matplotlib.py +2019 -0
- qiskit/visualization/circuit/qcstyle.py +278 -0
- qiskit/visualization/circuit/styles/__init__.py +13 -0
- qiskit/visualization/circuit/styles/bw.json +202 -0
- qiskit/visualization/circuit/styles/clifford.json +202 -0
- qiskit/visualization/circuit/styles/iqp-dark.json +214 -0
- qiskit/visualization/circuit/styles/iqp.json +214 -0
- qiskit/visualization/circuit/styles/textbook.json +202 -0
- qiskit/visualization/circuit/text.py +1849 -0
- qiskit/visualization/circuit_visualization.py +19 -0
- qiskit/visualization/counts_visualization.py +487 -0
- qiskit/visualization/dag_visualization.py +318 -0
- qiskit/visualization/exceptions.py +21 -0
- qiskit/visualization/gate_map.py +1424 -0
- qiskit/visualization/library.py +40 -0
- qiskit/visualization/pass_manager_visualization.py +312 -0
- qiskit/visualization/state_visualization.py +1546 -0
- qiskit/visualization/timeline/__init__.py +21 -0
- qiskit/visualization/timeline/core.py +495 -0
- qiskit/visualization/timeline/drawings.py +260 -0
- qiskit/visualization/timeline/generators.py +506 -0
- qiskit/visualization/timeline/interface.py +444 -0
- qiskit/visualization/timeline/layouts.py +115 -0
- qiskit/visualization/timeline/plotters/__init__.py +16 -0
- qiskit/visualization/timeline/plotters/base_plotter.py +58 -0
- qiskit/visualization/timeline/plotters/matplotlib.py +195 -0
- qiskit/visualization/timeline/stylesheet.py +301 -0
- qiskit/visualization/timeline/types.py +148 -0
- qiskit/visualization/transition_visualization.py +369 -0
- qiskit/visualization/utils.py +49 -0
- qiskit-2.0.3.dist-info/METADATA +220 -0
- qiskit-2.0.3.dist-info/RECORD +690 -0
- qiskit-2.0.3.dist-info/WHEEL +6 -0
- qiskit-2.0.3.dist-info/entry_points.txt +82 -0
- qiskit-2.0.3.dist-info/licenses/LICENSE.txt +203 -0
- qiskit-2.0.3.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1345 @@
|
|
1
|
+
# This code is part of Qiskit.
|
2
|
+
#
|
3
|
+
# (C) Copyright IBM 2017, 2018.
|
4
|
+
#
|
5
|
+
# This code is licensed under the Apache License, Version 2.0. You may
|
6
|
+
# obtain a copy of this license in the LICENSE.txt file in the root directory
|
7
|
+
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
|
8
|
+
#
|
9
|
+
# Any modifications or derivative works of this code must retain this
|
10
|
+
# copyright notice, and modified files need to carry a notice indicating
|
11
|
+
# that they have been altered from the originals.
|
12
|
+
|
13
|
+
"""
|
14
|
+
=====================================
|
15
|
+
Transpiler (:mod:`qiskit.transpiler`)
|
16
|
+
=====================================
|
17
|
+
|
18
|
+
.. currentmodule:: qiskit.transpiler
|
19
|
+
|
20
|
+
Overview
|
21
|
+
========
|
22
|
+
|
23
|
+
Transpilation is the process of rewriting a given input circuit to match
|
24
|
+
the topology of a specific quantum device, and/or to optimize the circuit
|
25
|
+
for execution on present day noisy quantum systems.
|
26
|
+
|
27
|
+
Most circuits must undergo a series of transformations that make them compatible with
|
28
|
+
a given target device, and optimize them to reduce the effects of noise on the
|
29
|
+
resulting outcomes. Rewriting quantum circuits to match hardware constraints and
|
30
|
+
optimizing for performance can be far from trivial. The flow of logic in the rewriting
|
31
|
+
tool chain need not be linear, and can often have iterative sub-loops, conditional
|
32
|
+
branches, and other complex behaviors. That being said, the standard
|
33
|
+
compilation flow follows the structure given below:
|
34
|
+
|
35
|
+
.. image:: /source_images/transpiling_core_steps.png
|
36
|
+
:alt: The transpilation process takes the input circuit, applies the transpilation \
|
37
|
+
passes, then produces the output circuit.
|
38
|
+
|
39
|
+
Qiskit uses the graph-based :class:`.DAGCircuit` intermediate representation (IR) of a circuit
|
40
|
+
throughout the transpiler stack, rather than the tree-based :class:`.QuantumCircuit`. A transpiler
|
41
|
+
pipeline is a :class:`.PassManager` object, whose :meth:`.PassManager.run` method takes in a
|
42
|
+
:class:`.QuantumCircuit` and converts it to a :class:`.DAGCircuit`, then subjects the IR to a
|
43
|
+
sequence of *passes*, finally returning a :class:`.QuantumCircuit` back. A pass is either an
|
44
|
+
:class:`.AnalysisPass`, which calculates and stores properties about the circuit in the
|
45
|
+
stateful :class:`.PropertySet`, or a :class:`.TransformationPass`, which modifies the IR
|
46
|
+
to achieve a particular singular goal. You can think of a pipeline as being split into
|
47
|
+
"stages", where each stage is responsible for one high-level transformation.
|
48
|
+
|
49
|
+
Qiskit exposes a default transpilation pipeline builder using the function
|
50
|
+
:func:`.generate_preset_pass_manager`. This returns a properly configured pipeline for complete
|
51
|
+
transpilation, at a chosen ``optimization_level`` (between 0 and 3, inclusive). Unless you are
|
52
|
+
looking for something highly specialized, this is almost certainly the entry point you want. A
|
53
|
+
sample transpilation looks like::
|
54
|
+
|
55
|
+
from qiskit.circuit import QuantumCircuit
|
56
|
+
from qiskit.transpiler import generate_preset_pass_manager
|
57
|
+
from qiskit_ibm_runtime import QiskitRuntimeService
|
58
|
+
|
59
|
+
# Any abstract circuit you want:
|
60
|
+
abstract = QuantumCircuit(2)
|
61
|
+
abstract.h(0)
|
62
|
+
abstract.cx(0, 1)
|
63
|
+
|
64
|
+
# Any method you like to retrieve the backend you want to run on:
|
65
|
+
backend = QiskitRuntimeService().backend("some-backend")
|
66
|
+
|
67
|
+
# Create the pass manager for the transpilation ...
|
68
|
+
pm = generate_preset_pass_manager(backend=backend)
|
69
|
+
# ... and use it (as many times as you like).
|
70
|
+
physical = pm.run(abstract)
|
71
|
+
|
72
|
+
For most use cases, this is all you need.
|
73
|
+
All of Qiskit's transpiler infrastructure is highly extensible and configurable, however.
|
74
|
+
The rest of this page details how to harness the low-level capabilities of the transpiler stack.
|
75
|
+
|
76
|
+
.. _transpiler-preset:
|
77
|
+
|
78
|
+
Preset pass managers
|
79
|
+
====================
|
80
|
+
|
81
|
+
The function :func:`.generate_preset_pass_manager` creates the "preset pass managers".
|
82
|
+
These are all instances of :class:`.PassManager`, so are used by passing a :class:`.QuantumCircuit`
|
83
|
+
to the :meth:`.PassManager.run` method. More specifically, the preset pass managers are instances
|
84
|
+
of :class:`.StagedPassManager`, which allows greater configuration of the individual stages of a
|
85
|
+
transpilation, including pre- and post-stage hooks.
|
86
|
+
|
87
|
+
A preset pass manager has up to six named stages. These are summarized, in order of execution,
|
88
|
+
below, with more in-depth information in the following subsections.
|
89
|
+
|
90
|
+
``init``
|
91
|
+
Abstract-circuit optimizations, and reduction of multi-qubit operations to one- and two-qubit
|
92
|
+
operations. See :ref:`transpiler-preset-stage-init` for more details.
|
93
|
+
|
94
|
+
``layout``
|
95
|
+
Choose an initial mapping of virtual qubits to physical qubits, including expansion of the
|
96
|
+
circuit to contain explicit ancillas. This stage sometimes subsumes ``routing``. See
|
97
|
+
:ref:`transpiler-preset-stage-layout` for more details.
|
98
|
+
|
99
|
+
``routing``
|
100
|
+
Insert gates into the circuit to ensure it matches the connectivity constraints of the
|
101
|
+
:class:`.Target`. The inserted gates need not match the target ISA yet, so are often just
|
102
|
+
``swap`` instructions. This stage is sometimes omitted, when the ``layout`` stage handles its
|
103
|
+
job. See :ref:`transpiler-preset-stage-routing` for more details.
|
104
|
+
|
105
|
+
``translation``
|
106
|
+
Convert all gates in the circuit to ones matching the ISA of the :class:`Target`. See
|
107
|
+
:ref:`transpiler-preset-stage-translation` for more details.
|
108
|
+
|
109
|
+
``optimization``
|
110
|
+
Low-level, hardware-aware optimizations. Unlike the abstract optimizations of the ``init``
|
111
|
+
stage, this stage acts on a physical circuit. See :ref:`transpiler-preset-stage-optimization`
|
112
|
+
for more details.
|
113
|
+
|
114
|
+
``scheduling``
|
115
|
+
Insert :class:`~.circuit.Delay` instructions to make the wall-clock timing of a circuit
|
116
|
+
explicit. This may also include hardware-aware online error reduction techniques such as
|
117
|
+
dynamical decoupling, which are dependent on knowing wall-clock timings. See
|
118
|
+
:ref:`transpiler-preset-stage-scheduling` for more details.
|
119
|
+
|
120
|
+
The preset transpiler pipelines can also be configured at a high level by setting an
|
121
|
+
``optimization_level``. This is an integer from 0 to 3, inclusive, indicating the relative effort to
|
122
|
+
exert in attempting to optimize the circuit for the hardware. Level 0 disables all unnecessary
|
123
|
+
optimizations; only transformations needed to make the circuit runnable are used. On
|
124
|
+
the other end, level 3 enables a full range of optimization techniques, some of which can be very
|
125
|
+
expensive in compilation time. Similar to classical compilers, optimization level 3 is not always
|
126
|
+
guaranteed to produce the best results. Qiskit defaults to optimization level 2, as a trade-off
|
127
|
+
between compilation time and the expected amount of optimization.
|
128
|
+
|
129
|
+
The optimization level affects which implementations are used for a given stage by default, though
|
130
|
+
this can be overridden by passing explicit ``<stage>_method="<choice>"`` arguments to
|
131
|
+
:func:`.generate_preset_pass_manager`.
|
132
|
+
|
133
|
+
.. note::
|
134
|
+
|
135
|
+
The preset pass managers almost always include stochastic, heuristic-based passes. If you need
|
136
|
+
to ensure reproducibility of a compilation, pass a known integer to the ``seed_transpiler``
|
137
|
+
argument to the generator functions.
|
138
|
+
|
139
|
+
This stochasticity arises because many of the problems the transpiler must solve are known to be
|
140
|
+
non-polynomial in complexity, but transpilation must complete in a workable amount of time.
|
141
|
+
|
142
|
+
Choosing preset stage implementations
|
143
|
+
-------------------------------------
|
144
|
+
|
145
|
+
Qiskit includes several implementations of the above stages, and more can be installed as
|
146
|
+
separate "plugins". To control which implementation of a stage is used, pass its name to the
|
147
|
+
``<stage>_method`` keyword argument of the two functions, such as
|
148
|
+
``translation_method="translator"``. To read more about implementing such external plugins for a
|
149
|
+
stage, see :mod:`qiskit.transpiler.preset_passmanagers.plugin`.
|
150
|
+
|
151
|
+
For example, to generate a preset pass manager at optimization level 1 that explicitly uses the
|
152
|
+
``trivial`` method for layout with the ``sabre`` method for routing, we would do:
|
153
|
+
|
154
|
+
.. plot::
|
155
|
+
:include-source:
|
156
|
+
:nofigs:
|
157
|
+
|
158
|
+
from qiskit.transpiler import generate_preset_pass_manager
|
159
|
+
from qiskit.providers.fake_provider import GenericBackendV2
|
160
|
+
|
161
|
+
# Whatever backend you like:
|
162
|
+
backend = GenericBackendV2(num_qubits=5)
|
163
|
+
|
164
|
+
pass_manager = generate_preset_pass_manager(
|
165
|
+
optimization_level=1,
|
166
|
+
backend=backend,
|
167
|
+
layout_method="trivial",
|
168
|
+
routing_method="sabre",
|
169
|
+
)
|
170
|
+
|
171
|
+
.. note::
|
172
|
+
|
173
|
+
The built-in set of available plugins for each stage is part of Qiskit's public API, and subject
|
174
|
+
to all the stability guarantees. This includes the high-level logical effects of that method
|
175
|
+
(for example, ``routing_method="sabre"`` will always use a Sabre-derived algorithm). The exact
|
176
|
+
internal construction of the :class:`.PassManager` representing the stage is not, however; the
|
177
|
+
order of passes might change between minor versions, or new passes might be introduced.
|
178
|
+
|
179
|
+
For any stage that has one, the method named ``"default"`` is the most subject to change.
|
180
|
+
Qiskit typically only makes complete algorithmic changes in the default method across a
|
181
|
+
major-version boundary, but it might rebalance heuristics and add new passes to default
|
182
|
+
methods between minor versions.
|
183
|
+
|
184
|
+
Since the output of :func:`.generate_preset_pass_manager` is a :class:`.StagedPassManager`, you can
|
185
|
+
also modify the pass manager after its creation to provide an entirely custom stage implementation.
|
186
|
+
For example, if you wanted to run a custom scheduling stage using dynamical decoupling (using the
|
187
|
+
:class:`~.PadDynamicalDecoupling` pass) and also add initial logical optimization prior to routing,
|
188
|
+
you would do something like the following (building off the previous example):
|
189
|
+
|
190
|
+
.. plot::
|
191
|
+
:include-source:
|
192
|
+
:nofigs:
|
193
|
+
|
194
|
+
import numpy as np
|
195
|
+
from qiskit.providers.fake_provider import GenericBackendV2
|
196
|
+
from qiskit.circuit import library as lib
|
197
|
+
from qiskit.transpiler import PassManager, generate_preset_pass_manager
|
198
|
+
from qiskit.transpiler.passes import (
|
199
|
+
ALAPScheduleAnalysis,
|
200
|
+
InverseCancellation,
|
201
|
+
PadDynamicalDecoupling,
|
202
|
+
)
|
203
|
+
|
204
|
+
backend = GenericBackendV2(num_qubits=5)
|
205
|
+
dd_sequence = [lib.XGate(), lib.XGate()]
|
206
|
+
scheduling_pm = PassManager(
|
207
|
+
[
|
208
|
+
ALAPScheduleAnalysis(target=backend.target),
|
209
|
+
PadDynamicalDecoupling(target=backend.target, dd_sequence=dd_sequence),
|
210
|
+
]
|
211
|
+
)
|
212
|
+
inverse_gate_list = [
|
213
|
+
lib.CXGate(),
|
214
|
+
lib.HGate(),
|
215
|
+
(lib.RXGate(np.pi / 4), lib.RXGate(-np.pi / 4)),
|
216
|
+
(lib.PhaseGate(np.pi / 4), lib.PhaseGate(-np.pi / 4)),
|
217
|
+
(lib.TGate(), lib.TdgGate()),
|
218
|
+
]
|
219
|
+
logical_opt = PassManager([InverseCancellation(inverse_gate_list)])
|
220
|
+
|
221
|
+
pass_manager = generate_preset_pass_manager(optimization_level=0)
|
222
|
+
# Add pre-layout stage to run extra logical optimization
|
223
|
+
pass_manager.pre_layout = logical_opt
|
224
|
+
# Set scheduling stage to custom pass manager
|
225
|
+
pass_manager.scheduling = scheduling_pm
|
226
|
+
|
227
|
+
Now, when the staged pass manager is run via the :meth:`~.StagedPassManager.run` method,
|
228
|
+
the ``logical_opt`` pass manager will be called before the ``layout`` stage, and the
|
229
|
+
``scheduling_pm`` pass manager will be used for the ``scheduling`` stage instead of the default.
|
230
|
+
|
231
|
+
If you are constructing custom stages for the preset pass managers, you may find some of the
|
232
|
+
low-level helper functions in :mod:`qiskit.transpiler.preset_passmanagers` useful.
|
233
|
+
|
234
|
+
.. _transpiler-preset-stage-init:
|
235
|
+
|
236
|
+
Initialization stage
|
237
|
+
--------------------
|
238
|
+
|
239
|
+
.. seealso::
|
240
|
+
`Init stage explanation <https://quantum.cloud.ibm.com/docs/guides/transpiler-stages#init-stage>`__
|
241
|
+
Higher-level user-facing explanation of the init stage in the IBM Quantum guide.
|
242
|
+
|
243
|
+
The ``init`` stage is responsible for high-level, logical optimizations on abstract circuits, and
|
244
|
+
for lowering multi-qubit (3+) operations down to a series of one- and two-qubit operations. As this is
|
245
|
+
the first stage run, its input is a fully abstract circuit. The ``init`` stage must be able to
|
246
|
+
handle custom user-defined gates, and all the high-level abstract circuit-description objects, such
|
247
|
+
as :class:`.AnnotatedOperation`.
|
248
|
+
|
249
|
+
The output of the ``init`` stage is an abstract circuit that contains only one- and two-qubit
|
250
|
+
operations.
|
251
|
+
|
252
|
+
When writing :ref:`stage plugins <transpiler-preset-stage-plugins>`, the entry point for ``init`` is
|
253
|
+
``qiskit.transpiler.init``. The built-in plugins are:
|
254
|
+
|
255
|
+
.. list-table::
|
256
|
+
:header-rows: 1
|
257
|
+
|
258
|
+
* - Method
|
259
|
+
- Summary
|
260
|
+
|
261
|
+
* - :ref:`default <transpiler-preset-stage-init-default>`
|
262
|
+
- Built-in unrolling of multi-qubit operations and abstract optimizations.
|
263
|
+
|
264
|
+
|
265
|
+
.. _transpiler-preset-stage-init-default:
|
266
|
+
|
267
|
+
Built-in ``default`` plugin
|
268
|
+
...........................
|
269
|
+
|
270
|
+
At optimization level 0, no abstract optimization is done. The default plugin simply "unrolls"
|
271
|
+
operations with more than three qubits by accessing their hierarchical
|
272
|
+
:class:`~.circuit.Instruction.definition` fields.
|
273
|
+
|
274
|
+
At optimization levels 1 and above, the default plugin also does simple cancellation of adjacent
|
275
|
+
inverse gates, such as two back-to-back ``cx`` gates.
|
276
|
+
|
277
|
+
At optimization levels 2 and 3, the default plugin enables a much wider range of abstract
|
278
|
+
optimizations. This includes:
|
279
|
+
|
280
|
+
* "Virtual permutation elision" (see :class:`.ElidePermutations`), where explicit
|
281
|
+
permutation-inducing operations are removed and instead effected as remapping of virtual qubits.
|
282
|
+
* Analysis of the commutation structure of the IR to find pairs of gates that can be canceled out.
|
283
|
+
* Numerical splitting of two-qubit operations that can be expressed as a series of separable
|
284
|
+
one-qubit operations.
|
285
|
+
* Removal of imperceivable operations, such as tiny-angle Pauli rotations and diagonal operations
|
286
|
+
immediately preceding measurements.
|
287
|
+
|
288
|
+
.. _transpiler-preset-stage-layout:
|
289
|
+
|
290
|
+
Layout stage
|
291
|
+
------------
|
292
|
+
|
293
|
+
.. seealso::
|
294
|
+
`Layout stage explanation`__
|
295
|
+
Higher-level user-facing explanation of the layout stage in the IBM Quantum guide.
|
296
|
+
|
297
|
+
__ https://quantum.cloud.ibm.com/docs/guides/transpiler-stages#layout-stage
|
298
|
+
|
299
|
+
The layout stage is responsible for making an initial mapping between the virtual qubits of the
|
300
|
+
input circuit, and the hardware qubits of the target. This includes expanding the input circuit
|
301
|
+
with explicit ancillas so it has as many qubits as the target has, and rewriting all operations in
|
302
|
+
terms of hardware qubits. You may also see this problem called the "placement" problem in other
|
303
|
+
toolkits or literature.
|
304
|
+
|
305
|
+
The layout stage must set the properties ``layout`` and ``original_qubit_indices`` in the pipeline's
|
306
|
+
:class:`.PropertySet`.
|
307
|
+
|
308
|
+
.. note::
|
309
|
+
|
310
|
+
All built-in plugins for the layout stage will give priority to an explicit layout selected
|
311
|
+
using the ``initial_layout`` argument to :func:`.generate_preset_pass_manager` or
|
312
|
+
:func:`.transpile`.
|
313
|
+
|
314
|
+
At any given point in a circuit, we can identify a mapping between currently active "virtual" qubits
|
315
|
+
of the input circuit to hardware qubits of the backend. A hardware qubit can only ever represent a
|
316
|
+
single virtual qubit at a given point, but the mapping might vary over the course of the circuit.
|
317
|
+
In principle, some virtual qubits might not be mapped at all points in the circuit
|
318
|
+
execution, if the lifetime of a virtual qubit state can be shortened, though Qiskit's built-in
|
319
|
+
pipelines do not use this currently.
|
320
|
+
|
321
|
+
.. image:: /source_images/mapping.png
|
322
|
+
:alt: Illustration of how virtual qubits from an input circuit could be mapped to hardware
|
323
|
+
qubits on a backend device's connectivity map.
|
324
|
+
|
325
|
+
The layout stage is not responsible for ensuring that the connectivity of the target
|
326
|
+
is respected all the way through the circuit, nor that all operations are valid for direct execution
|
327
|
+
on the target; these are the responsibilities of the :ref:`routing
|
328
|
+
<transpiler-preset-stage-routing>` and :ref:`translation <transpiler-preset-stage-translation>`
|
329
|
+
stages, respectively.
|
330
|
+
|
331
|
+
The choice of initial layout is one of the most important factors that affects the quality of the
|
332
|
+
output circuit. The layout stage is often the most computationally expensive stage in the default
|
333
|
+
pipelines; the default plugin for layout even tries several different algorithms (described in more
|
334
|
+
detail in :ref:`transpiler-preset-stage-layout-default`).
|
335
|
+
|
336
|
+
The ideal situation for the layout stage is to find a "perfect" layout, where all operations
|
337
|
+
respect the connectivity constraints of the :class:`.Target` such that the routing stage
|
338
|
+
is not required. This is typically not possible for arbitrary input circuits, but when it is, the
|
339
|
+
:class:`.VF2Layout` pass can be used to find a valid initial layout. If multiple perfect layouts
|
340
|
+
are found, a scoring heuristic based on estimated error rates is used to decide which one to use.
|
341
|
+
|
342
|
+
In all built-in plugins, passing the :func:`.generate_preset_pass_manager` argument
|
343
|
+
``initial_layout`` causes the given layout to be used verbatim, skipping the individual "choosing"
|
344
|
+
logic. All built-in plugins also handle embedding the circuit into the full width of the device,
|
345
|
+
including assigning ancillas.
|
346
|
+
|
347
|
+
If you write your own layout plugin, you might find :func:`.generate_embed_passmanager` useful for
|
348
|
+
automating the "embedding" stage of the layout application.
|
349
|
+
|
350
|
+
When writing :ref:`stage plugins <transpiler-preset-stage-plugins>`, the entry point for ``layout``
|
351
|
+
is ``qiskit.transpiler.layout``. The built-in plugins are:
|
352
|
+
|
353
|
+
.. list-table::
|
354
|
+
:header-rows: 1
|
355
|
+
|
356
|
+
* - Method
|
357
|
+
- Summary
|
358
|
+
|
359
|
+
* - :ref:`default <transpiler-preset-stage-layout-default>`
|
360
|
+
- At the highest optimization levels, attempts to find a perfect layout, then tries a
|
361
|
+
Sabre-based layout-and-routing combined pass.
|
362
|
+
|
363
|
+
* - :ref:`dense <transpiler-preset-stage-layout-dense>`
|
364
|
+
- Finds the densest subgraph (in terms of qubit link degrees) of the backend to use as the
|
365
|
+
initial qubits.
|
366
|
+
|
367
|
+
* - :ref:`trivial <transpiler-preset-stage-layout-trivial>`
|
368
|
+
- Maps virtual qubit 0 to physical qubit 0, and so on.
|
369
|
+
|
370
|
+
* - :ref:`sabre <transpiler-preset-stage-layout-sabre>`
|
371
|
+
- Uses `Qiskit's enhanced Sabre layout algorithm <sabre-lightsabre-paper_>`_.
|
372
|
+
|
373
|
+
At all optimization levels, the default layout method is ``default``, though the structure of this
|
374
|
+
stage changes dramatically based on the level.
|
375
|
+
|
376
|
+
.. _transpiler-preset-stage-layout-default:
|
377
|
+
|
378
|
+
Built-in ``default`` plugin
|
379
|
+
...........................
|
380
|
+
|
381
|
+
An amalgamation of several different layout techniques.
|
382
|
+
|
383
|
+
At optimization level 0, the trivial layout is chosen.
|
384
|
+
|
385
|
+
At optimization levels above 0, there is a two-step process:
|
386
|
+
|
387
|
+
#. First, use :class:`.VF2Layout` to attempt to find a "perfect" layout. The maximum number of
|
388
|
+
calls to the isomorphism evaluator increases with the optimization level. For huge, complex
|
389
|
+
targets, we are not guaranteed to find perfect layouts even if they exist, but the chance
|
390
|
+
increases with the optimization level.
|
391
|
+
|
392
|
+
#. If no perfect layout can be found, use :class:`.SabreLayout` to choose an initial layout, with
|
393
|
+
the numbers of initial layout trials, swap-map trials, and forwards–backwards iterations
|
394
|
+
increasing with the optimization level.
|
395
|
+
|
396
|
+
In addition, optimization level 1 also tries the trivial layout before the VF2-based version,
|
397
|
+
for historical backwards compatibility.
|
398
|
+
|
399
|
+
|
400
|
+
.. _transpiler-preset-stage-layout-dense:
|
401
|
+
|
402
|
+
Built-in ``dense`` plugin
|
403
|
+
.........................
|
404
|
+
|
405
|
+
Uses the :class:`.DenseLayout` pass to choose the layout. This pass finds the densest connected
|
406
|
+
subgraph of the complete target connectivity graph, where "densest" means that hardware qubits with
|
407
|
+
the greatest number of available connections are preferred. The virtual-to-hardware mapping is
|
408
|
+
completed by assigning the highest-degree virtual qubits to the highest-degree hardware qubits.
|
409
|
+
|
410
|
+
This is a relatively cheap heuristic for choosing an initial layout, but typically has far worse
|
411
|
+
output quality than Sabre-based methods. The :ref:`default layout plugin
|
412
|
+
<transpiler-preset-stage-layout-default>` uses the initial mapping selected by :class:`.DenseLayout`
|
413
|
+
as one of its initial layouts to seed the Sabre algorithm.
|
414
|
+
|
415
|
+
.. _transpiler-preset-stage-layout-trivial:
|
416
|
+
|
417
|
+
Built-in ``trivial`` plugin
|
418
|
+
...........................
|
419
|
+
|
420
|
+
Uses the :class:`.TrivialLayout` pass to choose the layout. This is the simplest assignment, where
|
421
|
+
each virtual qubit is assigned to the hardware qubit with the same index, so virtual qubit 0 is
|
422
|
+
mapped to hardware qubit 0, and so on.
|
423
|
+
|
424
|
+
This method is most useful for hardware-characterization experiments, where the incoming "abstract"
|
425
|
+
circuit is already full-width on the device, its operations correspond to physical operations, and
|
426
|
+
the transpiler is just being invoked to formalize the creation of a physical
|
427
|
+
:class:`.QuantumCircuit`.
|
428
|
+
|
429
|
+
|
430
|
+
.. _transpiler-preset-stage-layout-sabre:
|
431
|
+
|
432
|
+
Built-in ``sabre`` plugin
|
433
|
+
.........................
|
434
|
+
|
435
|
+
Uses the :class:`.SabreLayout` to choose an initial layout, using Qiskit's modified :ref:`Sabre
|
436
|
+
routing algorithm <transpiler-preset-stage-routing-sabre>` as the subroutine to swap-map the
|
437
|
+
candidate circuit both forwards and backwards.
|
438
|
+
|
439
|
+
Summarily, the layout component of `the original Sabre algorithm <sabre-original-paper_>`_
|
440
|
+
chooses an initial layout arbitrarily, then tries to "improve" it by running routing on the circuit,
|
441
|
+
reversing the circuit, and running routing on the reversed circuit with the previous "final"
|
442
|
+
virtual-to-hardware assignment as the initial state. The configured optimization level decides how
|
443
|
+
many iterations of this to-and-fro to do, and how many different random initial layouts to try.
|
444
|
+
|
445
|
+
The principal difference to the :ref:`default stage <transpiler-preset-stage-layout-default>` at
|
446
|
+
optimization levels other than 0 is that this plugin *only* runs the Sabre-based algorithm. It
|
447
|
+
does not attempt to find a perfect layout, nor attempt the trivial layout.
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
.. _transpiler-preset-stage-routing:
|
452
|
+
|
453
|
+
Routing stage
|
454
|
+
-------------
|
455
|
+
|
456
|
+
.. seealso::
|
457
|
+
`Routing stage explanation`__
|
458
|
+
Higher-level user-facing explanation of the routing stage in the IBM Quantum guide.
|
459
|
+
|
460
|
+
__ https://quantum.cloud.ibm.com/docs/guides/transpiler-stages#routing-stage
|
461
|
+
|
462
|
+
The routing stage ensures that the virtual connectivity graph of the circuit is compatible with the
|
463
|
+
hardware connectivity graph of the target. In simpler terms, the routing stage makes sure that all
|
464
|
+
two-qubit gates in the circuit are mapped to hardware qubits that have a defined two-qubit operation
|
465
|
+
in the target ISA. You may also see this problem referred to as the "mapping" or "swap-mapping"
|
466
|
+
problem in other toolkits or literature.
|
467
|
+
|
468
|
+
Routing algorithms typically do this by inserting ``swap`` gates into the circuit, and modifying the
|
469
|
+
virtual-to-hardware mapping of qubits over the course of the circuit execution.
|
470
|
+
|
471
|
+
The routing stage does not need to ensure that all the gates in the circuit are valid for the target
|
472
|
+
ISA. For example, a routing plugin can leave literal ``swap`` gates in the circuit, even if the
|
473
|
+
:class:`.Target` does not contain :class:`.SwapGate`. However, there must be at least one two-qubit
|
474
|
+
gate defined in the :class:`.Target` for any pair of hardware qubits that has a gate applied in the
|
475
|
+
circuit.
|
476
|
+
|
477
|
+
The routing stage must set the ``final_layout`` and ``virtual_permutation_layout`` properties in
|
478
|
+
the :class:`.PropertySet` if routing has taken place.
|
479
|
+
|
480
|
+
All of Qiskit's built-in routing stages will additionally run the :class:`.VF2PostLayout` pass after
|
481
|
+
routing. This might reassign the initial layout, if lower-error qubits can be found. This
|
482
|
+
pass is very similar to the :class:`.VF2Layout` class that :ref:`the default layout plugin
|
483
|
+
<transpiler-preset-stage-layout-default>` uses, except in :class:`.VF2PostLayout` we can guarantee
|
484
|
+
that there is at least one isomorphic induced subgraph of the target topology that matches the
|
485
|
+
circuit topology.
|
486
|
+
|
487
|
+
.. note::
|
488
|
+
|
489
|
+
Qiskit's built-in routing plugins all generally assume that all pairs of qubits with a
|
490
|
+
defined two-qubit link have a *universal* set of gates defined for those two qubits. Hardware
|
491
|
+
does not necessarily need to respect this (for example, if the only defined two-qubit gate is
|
492
|
+
``swap``, then entangling operations like ``cx`` cannot be realized), but Qiskit does not yet
|
493
|
+
consider this possibility.
|
494
|
+
|
495
|
+
.. note::
|
496
|
+
|
497
|
+
Finding the minimal number of swaps to insert is known to be a non-polynomial problem. This
|
498
|
+
means it is prohibitively expensive to attempt, so many of Qiskit's built-in algorithms are
|
499
|
+
stochastic, and you may see large variations between different compilations. If you need
|
500
|
+
reproducibility, be sure to set the ``seed_transpiler`` argument of
|
501
|
+
:func:`.generate_preset_pass_manager` or :func:`.transpile`.
|
502
|
+
|
503
|
+
When writing :ref:`stage plugins <transpiler-preset-stage-plugins>`, the entry point for ``routing``
|
504
|
+
is ``qiskit.transpiler.routing``. The built-in plugins are:
|
505
|
+
|
506
|
+
.. list-table::
|
507
|
+
:header-rows: 1
|
508
|
+
|
509
|
+
* - Method
|
510
|
+
- Summary
|
511
|
+
|
512
|
+
* - :ref:`default <transpiler-preset-stage-routing-default>`
|
513
|
+
- Use a Qiskit-chosen default routing method.
|
514
|
+
|
515
|
+
* - :ref:`sabre <transpiler-preset-stage-routing-sabre>`
|
516
|
+
- Default. Uses `Qiskit's modified Sabre routing algorithm <sabre-lightsabre-paper_>`_ to
|
517
|
+
swap map.
|
518
|
+
|
519
|
+
* - :ref:`none <transpiler-preset-stage-routing-none>`
|
520
|
+
- Disable routing. Raises an error if routing is required.
|
521
|
+
|
522
|
+
* - :ref:`basic <transpiler-preset-stage-routing-basic>`
|
523
|
+
- Greedy swap insertion to route a single operation at a time.
|
524
|
+
|
525
|
+
* - :ref:`lookahead <transpiler-preset-stage-routing-lookahead>`
|
526
|
+
- Breadth-first search with heuristic pruning to find swaps that make gates executable.
|
527
|
+
|
528
|
+
.. _transpiler-preset-stage-routing-default:
|
529
|
+
|
530
|
+
Built-in ``default`` plugin
|
531
|
+
...........................
|
532
|
+
|
533
|
+
Use a Qiskit-chosen default method for routing. As of Qiskit 2.0, the chosen algorithm is the same
|
534
|
+
as :ref:`transpiler-preset-stage-routing-sabre`, though in practice, usually the :ref:`built-in
|
535
|
+
default layout-stage plugin <transpiler-preset-stage-layout-default>` will run the Sabre-based
|
536
|
+
routing algorithm, and the routing stage will only be used to run :class:`.VF2PostLayout`.
|
537
|
+
|
538
|
+
.. _transpiler-preset-stage-routing-none:
|
539
|
+
|
540
|
+
Built-in ``none`` plugin
|
541
|
+
........................
|
542
|
+
|
543
|
+
A dummy plugin used to disable routing entirely. This can occasionally be useful for
|
544
|
+
hardware-configuration experiments, or in certain special cases of partial compilation.
|
545
|
+
|
546
|
+
.. _transpiler-preset-stage-routing-basic:
|
547
|
+
|
548
|
+
Built-in ``basic`` plugin
|
549
|
+
.........................
|
550
|
+
|
551
|
+
Uses the :class:`.BasisSwap` greedy swap-insertion algorithm. This is conceptually very simple; for
|
552
|
+
each operation in topological order, insert the shortest-path swaps needed to make the connection
|
553
|
+
executable on the device.
|
554
|
+
|
555
|
+
The optimization level only affects the amount of work the :class:`.VF2PostLayout` step does to
|
556
|
+
attempt to improve the initial layout after routing.
|
557
|
+
|
558
|
+
This method typically has poor output quality.
|
559
|
+
|
560
|
+
.. _transpiler-preset-stage-routing-lookahead:
|
561
|
+
|
562
|
+
Built-in ``lookahead`` plugin
|
563
|
+
.............................
|
564
|
+
|
565
|
+
Uses the :class:`.LookaheadSwap` algorithm to route. This is essentially a breadth-first search
|
566
|
+
at producing a swap network, where the tree being explored is pruned down to a small number of
|
567
|
+
candidate swaps at each depth.
|
568
|
+
|
569
|
+
This algorithm is similar to the ``basic`` heuristic of :ref:`the "sabre" plugin
|
570
|
+
<transpiler-preset-stage-routing-sabre>`, except it considers the following effects of each swap to
|
571
|
+
a small depth as well.
|
572
|
+
|
573
|
+
The optimization level affects the search depth, the amount of per-depth pruning, and amount of work
|
574
|
+
done by :class:`.VF2PostLayout` to post-optimize the initial layout.
|
575
|
+
|
576
|
+
In practice, :ref:`the "sabre" plugin <transpiler-preset-stage-routing-sabre>` runs several orders
|
577
|
+
of magnitude faster, and produces better output.
|
578
|
+
|
579
|
+
.. _transpiler-preset-stage-routing-sabre:
|
580
|
+
|
581
|
+
Built-in ``sabre`` plugin
|
582
|
+
.........................
|
583
|
+
|
584
|
+
Uses the :class:`.SabreSwap` algorithm to route. This uses `Qiskit's enhanced version
|
585
|
+
<sabre-lightsabre-paper_>`_ of `the original Sabre routing algorithm <sabre-original-paper_>`_.
|
586
|
+
|
587
|
+
This routing algorithm runs with threaded parallelism to consider several different possibilities
|
588
|
+
for routing, choosing the one that minimizes the number of inserted swaps.
|
589
|
+
|
590
|
+
The optimization level affects how many different stochastic seeds are attempted for the full
|
591
|
+
routing, and the amount of work done by :class:`.VF2PostLayout` to post-optimize the initial layout.
|
592
|
+
|
593
|
+
This is almost invariably the best-performing built-in plugin, and the one Qiskit uses by default in
|
594
|
+
all cases where routing is necessary.
|
595
|
+
|
596
|
+
.. _transpiler-preset-stage-translation:
|
597
|
+
|
598
|
+
Translation stage
|
599
|
+
-----------------
|
600
|
+
|
601
|
+
.. seealso::
|
602
|
+
`Translation stage explanation`__
|
603
|
+
Higher-level user-facing explanation of the translation stage in the IBM Quantum guide.
|
604
|
+
|
605
|
+
.. __: https://quantum.cloud.ibm.com/docs/guides/transpiler-stages#translation-stage
|
606
|
+
|
607
|
+
The translation stage is responsible for rewriting all gates in the circuit into ones that are
|
608
|
+
supported by the target ISA. For example, if a ``cx`` is requested on hardware qubits 0 and 1, but
|
609
|
+
the ISA only contains a ``cz`` operation on those qubits, the translation stage must find a way of
|
610
|
+
representing the ``cx`` gate using the ``cz`` and available one-qubit gates.
|
611
|
+
|
612
|
+
The translation stage is called before entering the optimization stage. Optimization plugins
|
613
|
+
(including Qiskit's built-in plugins) may also use the translation stage as a "fixup" stage after
|
614
|
+
the optimization loop, if the optimization loop returns a circuit that includes non-ISA gates. This
|
615
|
+
latter situation is fairly common; the optimization loop may only be concerned with minimizing
|
616
|
+
properties like "number of two-qubit gates", and will leave its output in terms of locally
|
617
|
+
equivalent gates, which the translation stage can easily rewrite without affecting the target
|
618
|
+
optimization properties. This allows easier separation of concerns between the two stages. Some
|
619
|
+
optimization plugins may be stricter in their output, and so this follow-up to the translation stage
|
620
|
+
may no longer be necessary.
|
621
|
+
|
622
|
+
When writing :ref:`stage plugins <transpiler-preset-stage-plugins>`, the entry point for
|
623
|
+
``translation`` is ``qiskit.transpiler.translation``. The built-in plugins are:
|
624
|
+
|
625
|
+
.. list-table::
|
626
|
+
:header-rows: 1
|
627
|
+
|
628
|
+
* - Method
|
629
|
+
- Summary
|
630
|
+
|
631
|
+
* - :ref:`default <transpiler-preset-stage-translation-translator>`
|
632
|
+
- Use a Qiskit-chosen default translation method.
|
633
|
+
|
634
|
+
* - :ref:`translator <transpiler-preset-stage-translation-translator>`
|
635
|
+
- Symbolic translation of gates to the target basis using known equivalences.
|
636
|
+
|
637
|
+
* - :ref:`synthesis <transpiler-preset-stage-translation-synthesis>`
|
638
|
+
- Collect each run of one- and two-qubit gates into a matrix representation, and resynthesize
|
639
|
+
from there.
|
640
|
+
|
641
|
+
.. _transpiler-preset-stage-translation-default:
|
642
|
+
|
643
|
+
Built-in ``default`` plugin
|
644
|
+
...........................
|
645
|
+
|
646
|
+
Use a Qiskit-chosen default method for translation. As of Qiskit 2.0, this is the same as
|
647
|
+
:ref:`transpiler-preset-stage-translation-translator`, but the chosen algorithm might change during
|
648
|
+
the 2.x series, either for all targets, or only for certain classes of target.
|
649
|
+
|
650
|
+
.. _transpiler-preset-stage-translation-synthesis:
|
651
|
+
|
652
|
+
Built-in ``synthesis`` plugin
|
653
|
+
.............................
|
654
|
+
|
655
|
+
Collect runs of gates on the same qubits into matrix form, and then resynthesize using the
|
656
|
+
:class:`.UnitarySynthesis` pass (with the configured ``unitary_synthesis_method``). This is, in
|
657
|
+
large part, similar to the optimization loop itself at high optimization levels.
|
658
|
+
|
659
|
+
The collection into matrices is typically more expensive than matrix-free translations, but in
|
660
|
+
principle the quality of the translations can be better. In practice, this requires a synthesis
|
661
|
+
algorithm tailored to the target ISA, which makes this method less general than other methods. It
|
662
|
+
can produce higher-quality results when targeting simple ISAs that match the synthesis routines
|
663
|
+
already in Qiskit.
|
664
|
+
|
665
|
+
If this method is used, you might not need the optimization loop.
|
666
|
+
|
667
|
+
The optimization level has no effect on this plugin.
|
668
|
+
|
669
|
+
|
670
|
+
.. _transpiler-preset-stage-translation-translator:
|
671
|
+
|
672
|
+
Built-in ``translator`` plugin
|
673
|
+
..............................
|
674
|
+
|
675
|
+
Uses the :class:`.BasisTranslator` algorithm to symbolically translate gates into the target basis.
|
676
|
+
At a high level, this starts from the set of gates requested by the circuit, and uses rules from a
|
677
|
+
given :class:`.EquivalenceLibrary` (typically the :data:`.SessionEquivalenceLibrary`) to move
|
678
|
+
towards the ISA.
|
679
|
+
|
680
|
+
This is the default translation method.
|
681
|
+
|
682
|
+
The optimization level has no effect on this plugin.
|
683
|
+
|
684
|
+
|
685
|
+
.. _transpiler-preset-stage-optimization:
|
686
|
+
|
687
|
+
Optimization stage
|
688
|
+
------------------
|
689
|
+
|
690
|
+
.. seealso::
|
691
|
+
`Optimization stage explanation`__
|
692
|
+
Higher-level user-facing explanation of the optimization stage in the IBM Quantum guide.
|
693
|
+
|
694
|
+
.. __: https://quantum.cloud.ibm.com/docs/guides/transpiler-stages#optimization-stage
|
695
|
+
|
696
|
+
The optimization stage is for low-level hardware-aware optimizations. Unlike :ref:`the init stage
|
697
|
+
<transpiler-preset-stage-init>`, the input to this stage is a circuit that is already
|
698
|
+
ISA-compatible, so a low-level optimization plugin can be tailored for a particular ISA.
|
699
|
+
|
700
|
+
There are very few requirements on an optimization plugin, other than it takes in ISA-supported
|
701
|
+
circuits, and returns ISA-supported circuits. An optimization plugin will often contain a loop,
|
702
|
+
such as the :class:`.DoWhileController`, and might include the configured translation stage
|
703
|
+
as a fix-up pipeline.
|
704
|
+
|
705
|
+
Qiskit's built-in optimization plugins are general, and apply well to most real-world ISAs for
|
706
|
+
non-error-corrected devices. The built-in plugins are less well-suited to ISAs that have no
|
707
|
+
continuously parametrized single-qubit gate, such as a Clifford+T basis set.
|
708
|
+
|
709
|
+
When writing :ref:`stage plugins <transpiler-preset-stage-plugins>`, the entry point for
|
710
|
+
``optimization`` is ``qiskit.transpiler.optimization``. The built-in plugins are:
|
711
|
+
|
712
|
+
.. list-table::
|
713
|
+
:header-rows: 1
|
714
|
+
|
715
|
+
* - Method
|
716
|
+
- Summary
|
717
|
+
|
718
|
+
* - :ref:`default <transpiler-preset-stage-optimization-default>`
|
719
|
+
- A default set of optimization passes. This varies significantly between optimization
|
720
|
+
levels.
|
721
|
+
|
722
|
+
.. _transpiler-preset-stage-optimization-default:
|
723
|
+
|
724
|
+
Built-in ``default`` plugin
|
725
|
+
...........................
|
726
|
+
|
727
|
+
This varies significantly between optimization levels.
|
728
|
+
|
729
|
+
The specifics of this pipeline are subject to change between Qiskit versions. The broad principles
|
730
|
+
are described below.
|
731
|
+
|
732
|
+
At optimization level 0, the stage is empty.
|
733
|
+
|
734
|
+
At optimization level 1, the stage does matrix-based resynthesis of runs of single-qubit gates, and
|
735
|
+
very simple symbolic inverse cancellation of two-qubit gates, if they appear consecutively. This
|
736
|
+
runs in a loop until the size and depth of the circuit are fixed.
|
737
|
+
|
738
|
+
At optimization level 2, in addition the optimizations of level 1, the loop contains commutation
|
739
|
+
analysis of sets of gates to widen the range of gates that can be considered for cancellation.
|
740
|
+
Before the loop, runs of both one- and two-qubit gates undergo a single matrix-based resynthesis.
|
741
|
+
|
742
|
+
At optimization level 3, the two-qubit matrix-based resynthesis runs inside the optimization loop.
|
743
|
+
The optimization loop condition also tries multiple runs and chooses the minimum point in the case
|
744
|
+
of fluctuating output; this is necessary because matrix-based resynthesis is relatively unstable in
|
745
|
+
terms of concrete gates.
|
746
|
+
|
747
|
+
Optimization level 3 is typically very expensive for large circuits.
|
748
|
+
|
749
|
+
|
750
|
+
.. _transpiler-preset-stage-scheduling:
|
751
|
+
|
752
|
+
Scheduling stage
|
753
|
+
----------------
|
754
|
+
|
755
|
+
.. seealso::
|
756
|
+
:ref:`transpiler-scheduling-description`
|
757
|
+
A guide-level explanation of scheduling concepts.
|
758
|
+
|
759
|
+
The scheduling stage, if requested, is responsible for inserting explicit :class:`~.circuit.Delay`
|
760
|
+
instructions to make idle periods of qubits explicit. Plugins may optionally choose to do
|
761
|
+
walltime-sensitive transformations, such as inserting dynamical decoupling sequences.
|
762
|
+
|
763
|
+
The input to the scheduling stage is an ISA-compatible circuit. The output of the scheduling stage
|
764
|
+
must also be an ISA-compatible circuit, with explicit :class:`~.circuit.Delay` instructions that
|
765
|
+
satisfy the hardware's timing information, if appropriate.
|
766
|
+
|
767
|
+
The scheduling stage should set the ``node_start_time`` property in the pipeline's
|
768
|
+
:class:`.PropertySet`.
|
769
|
+
|
770
|
+
When writing :ref:`stage plugins <transpiler-preset-stage-plugins>`, the entry point for
|
771
|
+
``scheduling`` is ``qiskit.transpiler.scheduling``. The built-in plugins are:
|
772
|
+
|
773
|
+
.. list-table::
|
774
|
+
:header-rows: 1
|
775
|
+
|
776
|
+
* - Method
|
777
|
+
- Summary
|
778
|
+
|
779
|
+
* - :ref:`default <transpiler-preset-stage-scheduling-default>`
|
780
|
+
- Attempt to satisfy timing alignment constraints without otherwise scheduling.
|
781
|
+
|
782
|
+
* - :ref:`alap <transpiler-preset-stage-scheduling-alap>`
|
783
|
+
- Schedule the circuit, preferring operations to be as late as possible.
|
784
|
+
|
785
|
+
* - :ref:`asap <transpiler-preset-stage-scheduling-asap>`
|
786
|
+
- Schedule the circuit, preferring operations to be as soon as possible.
|
787
|
+
|
788
|
+
.. _transpiler-preset-stage-scheduling-default:
|
789
|
+
|
790
|
+
Built-in ``default`` plugin
|
791
|
+
...........................
|
792
|
+
|
793
|
+
Do nothing, unless the circuit already contains instructions with explicit timings. If there are
|
794
|
+
explicitly timed operations in the circuit, insert additional padding to ensure that these timings
|
795
|
+
satisfy the alignment and other hardware constraints.
|
796
|
+
|
797
|
+
.. _transpiler-preset-stage-scheduling-alap:
|
798
|
+
|
799
|
+
Builtin ``alap`` plugin
|
800
|
+
.......................
|
801
|
+
|
802
|
+
Explicitly schedule all operations using an "as late as possible" strategy. This uses the
|
803
|
+
:class:`.ALAPScheduleAnalysis` algorithm to decide where to place gates.
|
804
|
+
|
805
|
+
.. _transpiler-preset-stage-scheduling-asap:
|
806
|
+
|
807
|
+
Builtin ``asap`` plugin
|
808
|
+
.......................
|
809
|
+
|
810
|
+
Explicitly schedule all operations using an "as soon as possible" strategy. This uses the
|
811
|
+
:class:`.ASAPScheduleAnalysis` algorithm to decide where to place gates.
|
812
|
+
|
813
|
+
|
814
|
+
Custom pass managers
|
815
|
+
====================
|
816
|
+
|
817
|
+
In addition to modifying preset pass managers, it is also possible to construct a pass
|
818
|
+
manager to build an entirely custom pipeline for transforming input
|
819
|
+
circuits. You can use the :class:`~.StagedPassManager` class directly to do
|
820
|
+
this. You can define arbitrary stage names and populate them with a :class:`~.PassManager`
|
821
|
+
instance. For example, the following code creates a new :class:`~.StagedPassManager`
|
822
|
+
that has two stages, ``init`` and ``translation``.
|
823
|
+
|
824
|
+
.. plot::
|
825
|
+
:include-source:
|
826
|
+
:nofigs:
|
827
|
+
|
828
|
+
from qiskit.transpiler.passes import (
|
829
|
+
UnitarySynthesis,
|
830
|
+
Collect2qBlocks,
|
831
|
+
ConsolidateBlocks,
|
832
|
+
UnitarySynthesis,
|
833
|
+
Unroll3qOrMore,
|
834
|
+
)
|
835
|
+
from qiskit.transpiler import PassManager, StagedPassManager
|
836
|
+
|
837
|
+
basis_gates = ["rx", "ry", "rxx"]
|
838
|
+
init = PassManager([UnitarySynthesis(basis_gates, min_qubits=3), Unroll3qOrMore()])
|
839
|
+
translate = PassManager(
|
840
|
+
[
|
841
|
+
Collect2qBlocks(),
|
842
|
+
ConsolidateBlocks(basis_gates=basis_gates),
|
843
|
+
UnitarySynthesis(basis_gates),
|
844
|
+
]
|
845
|
+
)
|
846
|
+
|
847
|
+
staged_pm = StagedPassManager(
|
848
|
+
stages=["init", "translation"], init=init, translation=translate
|
849
|
+
)
|
850
|
+
|
851
|
+
There is no limit on the number of stages you can put in a :class:`~.StagedPassManager`. The stages
|
852
|
+
do not need to correspond to the stages used by Qiskit's preset pipelines.
|
853
|
+
|
854
|
+
The :ref:`stage_generators` may be useful for the construction of custom :class:`~.StagedPassManager`
|
855
|
+
instances. They generate pass managers which provide common functionality used in many stages. For
|
856
|
+
example, :func:`~.generate_embed_passmanager` generates a :class:`~.PassManager` to "embed" a
|
857
|
+
selected initial :class:`~.Layout` from a layout pass to the specified target device.
|
858
|
+
|
859
|
+
Representing Quantum Computers
|
860
|
+
==============================
|
861
|
+
|
862
|
+
To be able to compile a :class:`~.QuantumCircuit` for a specific backend, the transpiler needs a
|
863
|
+
specialized representation of that backend, including its constraints, instruction set, qubit
|
864
|
+
properties, and more, to be able to compile and optimize effectively. While the
|
865
|
+
:class:`~.BackendV2` class defines an interface for querying and interacting
|
866
|
+
with backends, its scope is larger than just the transpiler's needs including
|
867
|
+
managing job submission and potentially interfacing with remote services.
|
868
|
+
The specific information needed by the transpiler is described by the
|
869
|
+
:class:`~.Target` class
|
870
|
+
|
871
|
+
For example, to construct a simple :class:`~.Target` object, one can iteratively add
|
872
|
+
descriptions of the instructions it supports:
|
873
|
+
|
874
|
+
.. plot::
|
875
|
+
:include-source:
|
876
|
+
:nofigs:
|
877
|
+
|
878
|
+
from qiskit.circuit import Parameter, Measure
|
879
|
+
from qiskit.transpiler import Target, InstructionProperties
|
880
|
+
from qiskit.circuit.library import UGate, RZGate, RXGate, RYGate, CXGate, CZGate
|
881
|
+
|
882
|
+
target = Target(num_qubits=3)
|
883
|
+
target.add_instruction(CXGate(), {(0, 1): InstructionProperties(error=.0001, duration=5e-7)})
|
884
|
+
target.add_instruction(
|
885
|
+
UGate(Parameter('theta'), Parameter('phi'), Parameter('lam')),
|
886
|
+
{
|
887
|
+
(0,): InstructionProperties(error=.00001, duration=5e-8),
|
888
|
+
(1,): InstructionProperties(error=.00002, duration=6e-8)
|
889
|
+
}
|
890
|
+
)
|
891
|
+
target.add_instruction(
|
892
|
+
RZGate(Parameter('theta')),
|
893
|
+
{
|
894
|
+
(1,): InstructionProperties(error=.00001, duration=5e-8),
|
895
|
+
(2,): InstructionProperties(error=.00002, duration=6e-8)
|
896
|
+
}
|
897
|
+
)
|
898
|
+
target.add_instruction(
|
899
|
+
RYGate(Parameter('theta')),
|
900
|
+
{
|
901
|
+
(1,): InstructionProperties(error=.00001, duration=5e-8),
|
902
|
+
(2,): InstructionProperties(error=.00002, duration=6e-8)
|
903
|
+
}
|
904
|
+
)
|
905
|
+
target.add_instruction(
|
906
|
+
RXGate(Parameter('theta')),
|
907
|
+
{
|
908
|
+
(1,): InstructionProperties(error=.00001, duration=5e-8),
|
909
|
+
(2,): InstructionProperties(error=.00002, duration=6e-8)
|
910
|
+
}
|
911
|
+
)
|
912
|
+
target.add_instruction(
|
913
|
+
CZGate(),
|
914
|
+
{
|
915
|
+
(1, 2): InstructionProperties(error=.0001, duration=5e-7),
|
916
|
+
(2, 0): InstructionProperties(error=.0001, duration=5e-7)
|
917
|
+
}
|
918
|
+
)
|
919
|
+
target.add_instruction(
|
920
|
+
Measure(),
|
921
|
+
{
|
922
|
+
(0,): InstructionProperties(error=.001, duration=5e-5),
|
923
|
+
(1,): InstructionProperties(error=.002, duration=6e-5),
|
924
|
+
(2,): InstructionProperties(error=.2, duration=5e-7)
|
925
|
+
}
|
926
|
+
)
|
927
|
+
print(target)
|
928
|
+
|
929
|
+
.. code-block:: text
|
930
|
+
|
931
|
+
Target
|
932
|
+
Number of qubits: 3
|
933
|
+
Instructions:
|
934
|
+
cx
|
935
|
+
(0, 1):
|
936
|
+
Duration: 5e-07 sec.
|
937
|
+
Error Rate: 0.0001
|
938
|
+
u
|
939
|
+
(0,):
|
940
|
+
Duration: 5e-08 sec.
|
941
|
+
Error Rate: 1e-05
|
942
|
+
(1,):
|
943
|
+
Duration: 6e-08 sec.
|
944
|
+
Error Rate: 2e-05
|
945
|
+
rz
|
946
|
+
(1,):
|
947
|
+
Duration: 5e-08 sec.
|
948
|
+
Error Rate: 1e-05
|
949
|
+
(2,):
|
950
|
+
Duration: 6e-08 sec.
|
951
|
+
Error Rate: 2e-05
|
952
|
+
ry
|
953
|
+
(1,):
|
954
|
+
Duration: 5e-08 sec.
|
955
|
+
Error Rate: 1e-05
|
956
|
+
(2,):
|
957
|
+
Duration: 6e-08 sec.
|
958
|
+
Error Rate: 2e-05
|
959
|
+
rx
|
960
|
+
(1,):
|
961
|
+
Duration: 5e-08 sec.
|
962
|
+
Error Rate: 1e-05
|
963
|
+
(2,):
|
964
|
+
Duration: 6e-08 sec.
|
965
|
+
Error Rate: 2e-05
|
966
|
+
cz
|
967
|
+
(1, 2):
|
968
|
+
Duration: 5e-07 sec.
|
969
|
+
Error Rate: 0.0001
|
970
|
+
(2, 0):
|
971
|
+
Duration: 5e-07 sec.
|
972
|
+
Error Rate: 0.0001
|
973
|
+
measure
|
974
|
+
(0,):
|
975
|
+
Duration: 5e-05 sec.
|
976
|
+
Error Rate: 0.001
|
977
|
+
(1,):
|
978
|
+
Duration: 6e-05 sec.
|
979
|
+
Error Rate: 0.002
|
980
|
+
(2,):
|
981
|
+
Duration: 5e-07 sec.
|
982
|
+
Error Rate: 0.2
|
983
|
+
|
984
|
+
This :class:`~.Target` represents a 3 qubit backend that supports :class:`~.CXGate` between qubits
|
985
|
+
0 and 1, :class:`~.UGate` on qubits 0 and 1, :class:`~.RZGate`, :class:`~.RXGate`,
|
986
|
+
and :class:`~.RYGate` on qubits 1 and 2, :class:`~.CZGate` between qubits 1 and 2, and qubits
|
987
|
+
2 and 0, and :class:`~.Measure` on all qubits.
|
988
|
+
|
989
|
+
There are also specific data structures to represent a specific subset of information from the
|
990
|
+
:class:`~.Target`. For example, the :class:`~.CouplingMap` class is used to solely represent the
|
991
|
+
connectivity constraints of a backend as a directed graph. A coupling map can be generated from
|
992
|
+
a :class:`~.Target` using the :meth:`.Target.build_coupling_map` method. These data structures
|
993
|
+
typically pre-date the :class:`~.Target` class but are still used by some transpiler passes that do
|
994
|
+
not work natively with a :class:`~.Target` instance yet or when dealing with backends that aren't
|
995
|
+
using the latest :class:`~.BackendV2` interface.
|
996
|
+
|
997
|
+
For example, if we wanted to visualize the :class:`~.CouplingMap` for the
|
998
|
+
example 3 qubit :class:`~.Target` above:
|
999
|
+
|
1000
|
+
.. plot::
|
1001
|
+
:include-source:
|
1002
|
+
:alt: Output from the previous code.
|
1003
|
+
|
1004
|
+
from qiskit.circuit import Parameter, Measure
|
1005
|
+
from qiskit.transpiler import Target, InstructionProperties
|
1006
|
+
from qiskit.circuit.library import UGate, RZGate, RXGate, RYGate, CXGate, CZGate
|
1007
|
+
|
1008
|
+
target = Target(num_qubits=3)
|
1009
|
+
target.add_instruction(CXGate(), {(0, 1): InstructionProperties(error=.0001, duration=5e-7)})
|
1010
|
+
target.add_instruction(
|
1011
|
+
UGate(Parameter('theta'), Parameter('phi'), Parameter('lam')),
|
1012
|
+
{
|
1013
|
+
(0,): InstructionProperties(error=.00001, duration=5e-8),
|
1014
|
+
(1,): InstructionProperties(error=.00002, duration=6e-8)
|
1015
|
+
}
|
1016
|
+
)
|
1017
|
+
target.add_instruction(
|
1018
|
+
RZGate(Parameter('theta')),
|
1019
|
+
{
|
1020
|
+
(1,): InstructionProperties(error=.00001, duration=5e-8),
|
1021
|
+
(2,): InstructionProperties(error=.00002, duration=6e-8)
|
1022
|
+
}
|
1023
|
+
)
|
1024
|
+
target.add_instruction(
|
1025
|
+
RYGate(Parameter('theta')),
|
1026
|
+
{
|
1027
|
+
(1,): InstructionProperties(error=.00001, duration=5e-8),
|
1028
|
+
(2,): InstructionProperties(error=.00002, duration=6e-8)
|
1029
|
+
}
|
1030
|
+
)
|
1031
|
+
target.add_instruction(
|
1032
|
+
RXGate(Parameter('theta')),
|
1033
|
+
{
|
1034
|
+
(1,): InstructionProperties(error=.00001, duration=5e-8),
|
1035
|
+
(2,): InstructionProperties(error=.00002, duration=6e-8)
|
1036
|
+
}
|
1037
|
+
)
|
1038
|
+
target.add_instruction(
|
1039
|
+
CZGate(),
|
1040
|
+
{
|
1041
|
+
(1, 2): InstructionProperties(error=.0001, duration=5e-7),
|
1042
|
+
(2, 0): InstructionProperties(error=.0001, duration=5e-7)
|
1043
|
+
}
|
1044
|
+
)
|
1045
|
+
target.add_instruction(
|
1046
|
+
Measure(),
|
1047
|
+
{
|
1048
|
+
(0,): InstructionProperties(error=.001, duration=5e-5),
|
1049
|
+
(1,): InstructionProperties(error=.002, duration=6e-5),
|
1050
|
+
(2,): InstructionProperties(error=.2, duration=5e-7)
|
1051
|
+
}
|
1052
|
+
)
|
1053
|
+
|
1054
|
+
target.build_coupling_map().draw()
|
1055
|
+
|
1056
|
+
This shows the global connectivity of the :class:`~.Target` which is the
|
1057
|
+
combination of the supported qubits for :class:`~.CXGate` and :class:`~.CZGate`. To
|
1058
|
+
see the individual connectivity, you can pass the operation name to
|
1059
|
+
:meth:`.CouplingMap.build_coupling_map`:
|
1060
|
+
|
1061
|
+
.. plot::
|
1062
|
+
:alt: Output from the previous code.
|
1063
|
+
:include-source:
|
1064
|
+
|
1065
|
+
from qiskit.circuit import Parameter, Measure
|
1066
|
+
from qiskit.transpiler import Target, InstructionProperties
|
1067
|
+
from qiskit.circuit.library import UGate, RZGate, RXGate, RYGate, CXGate, CZGate
|
1068
|
+
|
1069
|
+
target = Target(num_qubits=3)
|
1070
|
+
target.add_instruction(CXGate(), {(0, 1): InstructionProperties(error=.0001, duration=5e-7)})
|
1071
|
+
target.add_instruction(
|
1072
|
+
UGate(Parameter('theta'), Parameter('phi'), Parameter('lam')),
|
1073
|
+
{
|
1074
|
+
(0,): InstructionProperties(error=.00001, duration=5e-8),
|
1075
|
+
(1,): InstructionProperties(error=.00002, duration=6e-8)
|
1076
|
+
}
|
1077
|
+
)
|
1078
|
+
target.add_instruction(
|
1079
|
+
RZGate(Parameter('theta')),
|
1080
|
+
{
|
1081
|
+
(1,): InstructionProperties(error=.00001, duration=5e-8),
|
1082
|
+
(2,): InstructionProperties(error=.00002, duration=6e-8)
|
1083
|
+
}
|
1084
|
+
)
|
1085
|
+
target.add_instruction(
|
1086
|
+
RYGate(Parameter('theta')),
|
1087
|
+
{
|
1088
|
+
(1,): InstructionProperties(error=.00001, duration=5e-8),
|
1089
|
+
(2,): InstructionProperties(error=.00002, duration=6e-8)
|
1090
|
+
}
|
1091
|
+
)
|
1092
|
+
target.add_instruction(
|
1093
|
+
RXGate(Parameter('theta')),
|
1094
|
+
{
|
1095
|
+
(1,): InstructionProperties(error=.00001, duration=5e-8),
|
1096
|
+
(2,): InstructionProperties(error=.00002, duration=6e-8)
|
1097
|
+
}
|
1098
|
+
)
|
1099
|
+
target.add_instruction(
|
1100
|
+
CZGate(),
|
1101
|
+
{
|
1102
|
+
(1, 2): InstructionProperties(error=.0001, duration=5e-7),
|
1103
|
+
(2, 0): InstructionProperties(error=.0001, duration=5e-7)
|
1104
|
+
}
|
1105
|
+
)
|
1106
|
+
target.add_instruction(
|
1107
|
+
Measure(),
|
1108
|
+
{
|
1109
|
+
(0,): InstructionProperties(error=.001, duration=5e-5),
|
1110
|
+
(1,): InstructionProperties(error=.002, duration=6e-5),
|
1111
|
+
(2,): InstructionProperties(error=.2, duration=5e-7)
|
1112
|
+
}
|
1113
|
+
)
|
1114
|
+
|
1115
|
+
target.build_coupling_map('cx').draw()
|
1116
|
+
|
1117
|
+
.. plot::
|
1118
|
+
:alt: Output from the previous code.
|
1119
|
+
:include-source:
|
1120
|
+
|
1121
|
+
from qiskit.circuit import Parameter, Measure
|
1122
|
+
from qiskit.transpiler import Target, InstructionProperties
|
1123
|
+
from qiskit.circuit.library import UGate, RZGate, RXGate, RYGate, CXGate, CZGate
|
1124
|
+
|
1125
|
+
target = Target(num_qubits=3)
|
1126
|
+
target.add_instruction(CXGate(), {(0, 1): InstructionProperties(error=.0001, duration=5e-7)})
|
1127
|
+
target.add_instruction(
|
1128
|
+
UGate(Parameter('theta'), Parameter('phi'), Parameter('lam')),
|
1129
|
+
{
|
1130
|
+
(0,): InstructionProperties(error=.00001, duration=5e-8),
|
1131
|
+
(1,): InstructionProperties(error=.00002, duration=6e-8)
|
1132
|
+
}
|
1133
|
+
)
|
1134
|
+
target.add_instruction(
|
1135
|
+
RZGate(Parameter('theta')),
|
1136
|
+
{
|
1137
|
+
(1,): InstructionProperties(error=.00001, duration=5e-8),
|
1138
|
+
(2,): InstructionProperties(error=.00002, duration=6e-8)
|
1139
|
+
}
|
1140
|
+
)
|
1141
|
+
target.add_instruction(
|
1142
|
+
RYGate(Parameter('theta')),
|
1143
|
+
{
|
1144
|
+
(1,): InstructionProperties(error=.00001, duration=5e-8),
|
1145
|
+
(2,): InstructionProperties(error=.00002, duration=6e-8)
|
1146
|
+
}
|
1147
|
+
)
|
1148
|
+
target.add_instruction(
|
1149
|
+
RXGate(Parameter('theta')),
|
1150
|
+
{
|
1151
|
+
(1,): InstructionProperties(error=.00001, duration=5e-8),
|
1152
|
+
(2,): InstructionProperties(error=.00002, duration=6e-8)
|
1153
|
+
}
|
1154
|
+
)
|
1155
|
+
target.add_instruction(
|
1156
|
+
CZGate(),
|
1157
|
+
{
|
1158
|
+
(1, 2): InstructionProperties(error=.0001, duration=5e-7),
|
1159
|
+
(2, 0): InstructionProperties(error=.0001, duration=5e-7)
|
1160
|
+
}
|
1161
|
+
)
|
1162
|
+
target.add_instruction(
|
1163
|
+
Measure(),
|
1164
|
+
{
|
1165
|
+
(0,): InstructionProperties(error=.001, duration=5e-5),
|
1166
|
+
(1,): InstructionProperties(error=.002, duration=6e-5),
|
1167
|
+
(2,): InstructionProperties(error=.2, duration=5e-7)
|
1168
|
+
}
|
1169
|
+
)
|
1170
|
+
|
1171
|
+
target.build_coupling_map('cz').draw()
|
1172
|
+
|
1173
|
+
|
1174
|
+
.. _transpiler-scheduling-description:
|
1175
|
+
|
1176
|
+
Scheduling of circuits
|
1177
|
+
======================
|
1178
|
+
|
1179
|
+
..
|
1180
|
+
This section is still here because the content hasn't fully migrated to other places yet, unlike
|
1181
|
+
other discussions of the components of quantum compilation.
|
1182
|
+
|
1183
|
+
.. seealso::
|
1184
|
+
:ref:`transpiler-preset-stage-scheduling`
|
1185
|
+
How to configure the scheduling stages of the preset pass managers.
|
1186
|
+
|
1187
|
+
After the circuit has been translated to the target basis, mapped to the device, and optimized,
|
1188
|
+
a scheduling phase can be applied to optionally account for all the idle time in the circuit.
|
1189
|
+
At a high level, the scheduling can be thought of as inserting delays into the circuit to account
|
1190
|
+
for idle time on the qubits between the execution of instructions. For example, if we start with a
|
1191
|
+
circuit such as:
|
1192
|
+
|
1193
|
+
.. plot::
|
1194
|
+
:alt: Diagram illustrating the previously described circuit.
|
1195
|
+
|
1196
|
+
from qiskit import QuantumCircuit
|
1197
|
+
|
1198
|
+
ghz = QuantumCircuit(5)
|
1199
|
+
ghz.h(0)
|
1200
|
+
ghz.cx(0,range(1,5))
|
1201
|
+
ghz.draw(output='mpl')
|
1202
|
+
|
1203
|
+
we can then call :func:`~.transpile` on it with ``scheduling_method`` set:
|
1204
|
+
|
1205
|
+
.. plot::
|
1206
|
+
:alt: Circuit diagram output by the previous code.
|
1207
|
+
:include-source:
|
1208
|
+
|
1209
|
+
from qiskit import QuantumCircuit, transpile
|
1210
|
+
from qiskit.providers.fake_provider import GenericBackendV2
|
1211
|
+
|
1212
|
+
backend = GenericBackendV2(5)
|
1213
|
+
|
1214
|
+
ghz = QuantumCircuit(5)
|
1215
|
+
ghz.h(0)
|
1216
|
+
ghz.cx(0,range(1,5))
|
1217
|
+
|
1218
|
+
circ = transpile(ghz, backend, scheduling_method="asap")
|
1219
|
+
circ.draw(output='mpl')
|
1220
|
+
|
1221
|
+
You can see here that the transpiler inserted :class:`~qiskit.circuit.Delay` instructions to
|
1222
|
+
account for idle time on each qubit. To get a better idea of the timing of the circuit we can
|
1223
|
+
also look at it with the :func:`.timeline.draw` function:
|
1224
|
+
|
1225
|
+
.. plot::
|
1226
|
+
:alt: Output from circuit timeline drawer.
|
1227
|
+
|
1228
|
+
from qiskit.visualization.timeline import draw as timeline_draw
|
1229
|
+
|
1230
|
+
from qiskit import QuantumCircuit, transpile
|
1231
|
+
from qiskit.providers.fake_provider import GenericBackendV2
|
1232
|
+
|
1233
|
+
backend = GenericBackendV2(5)
|
1234
|
+
|
1235
|
+
ghz = QuantumCircuit(5)
|
1236
|
+
ghz.h(0)
|
1237
|
+
ghz.cx(0,range(1,5))
|
1238
|
+
|
1239
|
+
circ = transpile(ghz, backend, scheduling_method="asap")
|
1240
|
+
|
1241
|
+
timeline_draw(circ, target=backend.target)
|
1242
|
+
|
1243
|
+
The scheduling of a circuit involves two parts: analysis and constraint mapping, followed by a
|
1244
|
+
padding pass. The first part requires running a scheduling analysis pass such as
|
1245
|
+
:class:`~.ALAPSchedulingAnalysis` or :class:`~.ASAPSchedulingAnalysis` which analyzes the circuit
|
1246
|
+
and records the start time of each instruction in the circuit using a scheduling algorithm ("as late
|
1247
|
+
as possible" for :class:`~.ALAPSchedulingAnalysis` and "as soon as possible" for
|
1248
|
+
:class:`~.ASAPSchedulingAnalysis`) in the property set. Once the circuit has an initial scheduling,
|
1249
|
+
additional passes can be run to account for any timing constraints on the target backend, such
|
1250
|
+
as alignment constraints. This is typically done with the
|
1251
|
+
:class:`~.ConstrainedReschedule` pass which will adjust the scheduling
|
1252
|
+
set in the property set to the constraints of the target backend. Once all
|
1253
|
+
the scheduling and adjustments/rescheduling are finished, a padding pass,
|
1254
|
+
such as :class:`~.PadDelay` or :class:`~.PadDynamicalDecoupling` is run
|
1255
|
+
to insert the instructions into the circuit, which completes the scheduling.
|
1256
|
+
|
1257
|
+
Transpiler API
|
1258
|
+
==============
|
1259
|
+
|
1260
|
+
Hardware description
|
1261
|
+
--------------------
|
1262
|
+
|
1263
|
+
.. autosummary::
|
1264
|
+
:toctree: ../stubs/
|
1265
|
+
|
1266
|
+
Target
|
1267
|
+
InstructionProperties
|
1268
|
+
|
1269
|
+
Pass Manager Definition
|
1270
|
+
-----------------------
|
1271
|
+
|
1272
|
+
.. autosummary::
|
1273
|
+
:toctree: ../stubs/
|
1274
|
+
|
1275
|
+
StagedPassManager
|
1276
|
+
PassManager
|
1277
|
+
PassManagerConfig
|
1278
|
+
generate_preset_pass_manager
|
1279
|
+
|
1280
|
+
Layout and Topology
|
1281
|
+
-------------------
|
1282
|
+
|
1283
|
+
.. autosummary::
|
1284
|
+
:toctree: ../stubs/
|
1285
|
+
|
1286
|
+
Layout
|
1287
|
+
CouplingMap
|
1288
|
+
TranspileLayout
|
1289
|
+
|
1290
|
+
Scheduling
|
1291
|
+
----------
|
1292
|
+
|
1293
|
+
.. autosummary::
|
1294
|
+
:toctree: ../stubs/
|
1295
|
+
|
1296
|
+
InstructionDurations
|
1297
|
+
|
1298
|
+
Abstract Passes
|
1299
|
+
---------------
|
1300
|
+
|
1301
|
+
.. autosummary::
|
1302
|
+
:toctree: ../stubs/
|
1303
|
+
|
1304
|
+
TransformationPass
|
1305
|
+
AnalysisPass
|
1306
|
+
|
1307
|
+
Exceptions
|
1308
|
+
----------
|
1309
|
+
|
1310
|
+
.. autoexception:: TranspilerError
|
1311
|
+
.. autoexception:: TranspilerAccessError
|
1312
|
+
.. autoexception:: CouplingError
|
1313
|
+
.. autoexception:: LayoutError
|
1314
|
+
.. autoexception:: CircuitTooWideForTarget
|
1315
|
+
.. autoexception:: InvalidLayoutError
|
1316
|
+
|
1317
|
+
.. _sabre-original-paper: https://arxiv.org/abs/1809.02573
|
1318
|
+
.. _sabre-lightsabre-paper: https://arxiv.org/abs/2409.08368
|
1319
|
+
"""
|
1320
|
+
|
1321
|
+
# For backward compatibility
|
1322
|
+
from qiskit.passmanager import (
|
1323
|
+
ConditionalController,
|
1324
|
+
DoWhileController,
|
1325
|
+
)
|
1326
|
+
from qiskit.passmanager.compilation_status import PropertySet
|
1327
|
+
|
1328
|
+
from .passmanager import PassManager, StagedPassManager
|
1329
|
+
from .passmanager_config import PassManagerConfig
|
1330
|
+
from .exceptions import (
|
1331
|
+
TranspilerError,
|
1332
|
+
TranspilerAccessError,
|
1333
|
+
CouplingError,
|
1334
|
+
LayoutError,
|
1335
|
+
CircuitTooWideForTarget,
|
1336
|
+
InvalidLayoutError,
|
1337
|
+
)
|
1338
|
+
from .basepasses import AnalysisPass, TransformationPass
|
1339
|
+
from .coupling import CouplingMap
|
1340
|
+
from .layout import Layout, TranspileLayout
|
1341
|
+
from .instruction_durations import InstructionDurations
|
1342
|
+
from .preset_passmanagers import generate_preset_pass_manager
|
1343
|
+
from .target import Target
|
1344
|
+
from .target import InstructionProperties
|
1345
|
+
from .target import QubitProperties
|