qiskit 1.3.0b1__cp39-abi3-win32.whl → 1.3.0rc2__cp39-abi3-win32.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- qiskit/VERSION.txt +1 -1
- qiskit/__init__.py +20 -1
- qiskit/_accelerate.pyd +0 -0
- qiskit/assembler/assemble_schedules.py +2 -0
- qiskit/circuit/__init__.py +44 -1
- qiskit/circuit/_standard_gates_commutations.py +585 -0
- qiskit/circuit/barrier.py +2 -0
- qiskit/circuit/controlflow/builder.py +3 -3
- qiskit/circuit/controlflow/if_else.py +13 -5
- qiskit/circuit/controlflow/while_loop.py +10 -2
- qiskit/circuit/delay.py +20 -3
- qiskit/circuit/equivalence.py +13 -214
- qiskit/circuit/gate.py +3 -1
- qiskit/circuit/instruction.py +32 -11
- qiskit/circuit/instructionset.py +2 -0
- qiskit/circuit/library/__init__.py +110 -14
- qiskit/circuit/library/arithmetic/__init__.py +9 -2
- qiskit/circuit/library/arithmetic/adders/__init__.py +1 -0
- qiskit/circuit/library/arithmetic/adders/adder.py +154 -2
- qiskit/circuit/library/arithmetic/adders/cdkm_ripple_carry_adder.py +20 -56
- qiskit/circuit/library/arithmetic/adders/draper_qft_adder.py +14 -1
- qiskit/circuit/library/arithmetic/adders/vbe_ripple_carry_adder.py +21 -91
- qiskit/circuit/library/arithmetic/linear_pauli_rotations.py +1 -1
- qiskit/circuit/library/arithmetic/multipliers/__init__.py +1 -0
- qiskit/circuit/library/arithmetic/multipliers/hrs_cumulative_multiplier.py +8 -1
- qiskit/circuit/library/arithmetic/multipliers/multiplier.py +94 -3
- qiskit/circuit/library/arithmetic/multipliers/rg_qft_multiplier.py +8 -1
- qiskit/circuit/library/arithmetic/weighted_adder.py +1 -1
- qiskit/circuit/library/basis_change/qft.py +20 -38
- qiskit/circuit/library/blueprintcircuit.py +64 -0
- qiskit/circuit/library/boolean_logic/__init__.py +4 -4
- qiskit/circuit/library/boolean_logic/inner_product.py +81 -4
- qiskit/circuit/library/boolean_logic/quantum_and.py +107 -4
- qiskit/circuit/library/boolean_logic/quantum_or.py +107 -3
- qiskit/circuit/library/boolean_logic/quantum_xor.py +97 -3
- qiskit/circuit/library/data_preparation/__init__.py +6 -3
- qiskit/circuit/library/data_preparation/{z_feature_map.py → _z_feature_map.py} +45 -34
- qiskit/circuit/library/data_preparation/_zz_feature_map.py +150 -0
- qiskit/circuit/library/data_preparation/pauli_feature_map.py +342 -29
- qiskit/circuit/library/fourier_checking.py +72 -11
- qiskit/circuit/library/generalized_gates/__init__.py +1 -1
- qiskit/circuit/library/generalized_gates/diagonal.py +45 -51
- qiskit/circuit/library/generalized_gates/gms.py +67 -14
- qiskit/circuit/library/generalized_gates/gr.py +4 -4
- qiskit/circuit/library/generalized_gates/isometry.py +2 -2
- qiskit/circuit/library/generalized_gates/linear_function.py +12 -6
- qiskit/circuit/library/generalized_gates/mcmt.py +167 -107
- qiskit/circuit/library/generalized_gates/permutation.py +8 -6
- qiskit/circuit/library/generalized_gates/rv.py +8 -9
- qiskit/circuit/library/graph_state.py +93 -10
- qiskit/circuit/library/grover_operator.py +270 -2
- qiskit/circuit/library/hidden_linear_function.py +83 -20
- qiskit/circuit/library/iqp.py +99 -20
- qiskit/circuit/library/n_local/__init__.py +19 -7
- qiskit/circuit/library/n_local/efficient_su2.py +118 -5
- qiskit/circuit/library/n_local/evolved_operator_ansatz.py +259 -0
- qiskit/circuit/library/n_local/excitation_preserving.py +130 -6
- qiskit/circuit/library/n_local/n_local.py +406 -5
- qiskit/circuit/library/n_local/pauli_two_design.py +106 -4
- qiskit/circuit/library/n_local/qaoa_ansatz.py +80 -1
- qiskit/circuit/library/n_local/real_amplitudes.py +127 -7
- qiskit/circuit/library/n_local/two_local.py +14 -7
- qiskit/circuit/library/overlap.py +91 -26
- qiskit/circuit/library/pauli_evolution.py +17 -15
- qiskit/circuit/library/phase_estimation.py +80 -4
- qiskit/circuit/library/quantum_volume.py +72 -20
- qiskit/circuit/library/standard_gates/__init__.py +20 -1
- qiskit/circuit/library/standard_gates/dcx.py +2 -1
- qiskit/circuit/library/standard_gates/ecr.py +2 -2
- qiskit/circuit/library/standard_gates/h.py +4 -3
- qiskit/circuit/library/standard_gates/i.py +2 -1
- qiskit/circuit/library/standard_gates/iswap.py +2 -2
- qiskit/circuit/library/standard_gates/p.py +20 -12
- qiskit/circuit/library/standard_gates/r.py +1 -1
- qiskit/circuit/library/standard_gates/rx.py +4 -3
- qiskit/circuit/library/standard_gates/rxx.py +2 -2
- qiskit/circuit/library/standard_gates/ry.py +4 -3
- qiskit/circuit/library/standard_gates/ryy.py +2 -2
- qiskit/circuit/library/standard_gates/rz.py +13 -12
- qiskit/circuit/library/standard_gates/rzx.py +6 -6
- qiskit/circuit/library/standard_gates/rzz.py +1 -1
- qiskit/circuit/library/standard_gates/s.py +4 -4
- qiskit/circuit/library/standard_gates/swap.py +3 -3
- qiskit/circuit/library/standard_gates/sx.py +4 -3
- qiskit/circuit/library/standard_gates/t.py +2 -2
- qiskit/circuit/library/standard_gates/u.py +11 -3
- qiskit/circuit/library/standard_gates/u1.py +65 -15
- qiskit/circuit/library/standard_gates/u2.py +4 -1
- qiskit/circuit/library/standard_gates/u3.py +31 -3
- qiskit/circuit/library/standard_gates/x.py +7 -5
- qiskit/circuit/library/standard_gates/xx_minus_yy.py +2 -2
- qiskit/circuit/library/standard_gates/xx_plus_yy.py +2 -2
- qiskit/circuit/library/standard_gates/y.py +4 -3
- qiskit/circuit/library/standard_gates/z.py +3 -3
- qiskit/circuit/library/templates/clifford/clifford_2_1.py +9 -8
- qiskit/circuit/library/templates/clifford/clifford_2_2.py +10 -9
- qiskit/circuit/library/templates/clifford/clifford_2_3.py +9 -7
- qiskit/circuit/library/templates/clifford/clifford_2_4.py +9 -8
- qiskit/circuit/library/templates/clifford/clifford_3_1.py +9 -8
- qiskit/circuit/library/templates/clifford/clifford_4_1.py +10 -9
- qiskit/circuit/library/templates/clifford/clifford_4_2.py +10 -9
- qiskit/circuit/library/templates/clifford/clifford_4_3.py +10 -9
- qiskit/circuit/library/templates/clifford/clifford_4_4.py +10 -9
- qiskit/circuit/library/templates/clifford/clifford_5_1.py +10 -9
- qiskit/circuit/library/templates/clifford/clifford_6_1.py +10 -9
- qiskit/circuit/library/templates/clifford/clifford_6_2.py +10 -9
- qiskit/circuit/library/templates/clifford/clifford_6_3.py +10 -9
- qiskit/circuit/library/templates/clifford/clifford_6_4.py +9 -8
- qiskit/circuit/library/templates/clifford/clifford_6_5.py +10 -9
- qiskit/circuit/library/templates/clifford/clifford_8_1.py +10 -9
- qiskit/circuit/library/templates/clifford/clifford_8_2.py +10 -9
- qiskit/circuit/library/templates/clifford/clifford_8_3.py +10 -9
- qiskit/circuit/library/templates/nct/template_nct_2a_1.py +9 -7
- qiskit/circuit/library/templates/nct/template_nct_2a_2.py +10 -8
- qiskit/circuit/library/templates/nct/template_nct_2a_3.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_4a_1.py +16 -14
- qiskit/circuit/library/templates/nct/template_nct_4a_2.py +14 -12
- qiskit/circuit/library/templates/nct/template_nct_4a_3.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_4b_1.py +14 -12
- qiskit/circuit/library/templates/nct/template_nct_4b_2.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_5a_1.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_5a_2.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_5a_3.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_5a_4.py +11 -9
- qiskit/circuit/library/templates/nct/template_nct_6a_1.py +11 -9
- qiskit/circuit/library/templates/nct/template_nct_6a_2.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_6a_3.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_6a_4.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_6b_1.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_6b_2.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_6c_1.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_7a_1.py +13 -11
- qiskit/circuit/library/templates/nct/template_nct_7b_1.py +13 -11
- qiskit/circuit/library/templates/nct/template_nct_7c_1.py +13 -11
- qiskit/circuit/library/templates/nct/template_nct_7d_1.py +13 -11
- qiskit/circuit/library/templates/nct/template_nct_7e_1.py +13 -11
- qiskit/circuit/library/templates/nct/template_nct_9a_1.py +13 -11
- qiskit/circuit/library/templates/nct/template_nct_9c_1.py +11 -9
- qiskit/circuit/library/templates/nct/template_nct_9c_10.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_9c_11.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_9c_12.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_9c_2.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_9c_3.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_9c_4.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_9c_5.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_9c_6.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_9c_7.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_9c_8.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_9c_9.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_9d_1.py +11 -9
- qiskit/circuit/library/templates/nct/template_nct_9d_10.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_9d_2.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_9d_3.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_9d_4.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_9d_5.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_9d_6.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_9d_7.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_9d_8.py +12 -10
- qiskit/circuit/library/templates/nct/template_nct_9d_9.py +12 -10
- qiskit/circuit/library/templates/rzx/rzx_cy.py +11 -10
- qiskit/circuit/library/templates/rzx/rzx_xz.py +16 -15
- qiskit/circuit/library/templates/rzx/rzx_yz.py +12 -10
- qiskit/circuit/library/templates/rzx/rzx_zz1.py +22 -20
- qiskit/circuit/library/templates/rzx/rzx_zz2.py +16 -15
- qiskit/circuit/library/templates/rzx/rzx_zz3.py +17 -15
- qiskit/circuit/parameter.py +4 -0
- qiskit/circuit/parameterexpression.py +167 -34
- qiskit/circuit/quantumcircuit.py +162 -126
- qiskit/circuit/singleton.py +2 -0
- qiskit/circuit/store.py +2 -0
- qiskit/circuit/twirling.py +145 -0
- qiskit/compiler/assembler.py +17 -4
- qiskit/compiler/scheduler.py +2 -0
- qiskit/compiler/sequencer.py +2 -0
- qiskit/compiler/transpiler.py +81 -26
- qiskit/converters/circuit_to_dag.py +2 -2
- qiskit/converters/circuit_to_dagdependency.py +1 -1
- qiskit/converters/circuit_to_dagdependency_v2.py +1 -1
- qiskit/converters/circuit_to_instruction.py +1 -1
- qiskit/converters/dag_to_circuit.py +7 -5
- qiskit/converters/dag_to_dagdependency.py +1 -1
- qiskit/converters/dag_to_dagdependency_v2.py +1 -1
- qiskit/converters/dagdependency_to_circuit.py +5 -1
- qiskit/converters/dagdependency_to_dag.py +6 -1
- qiskit/dagcircuit/collect_blocks.py +3 -3
- qiskit/dagcircuit/dagdependency.py +18 -5
- qiskit/dagcircuit/dagdependency_v2.py +1 -1
- qiskit/dagcircuit/dagnode.py +2 -2
- qiskit/passmanager/__init__.py +2 -2
- qiskit/primitives/backend_estimator.py +5 -2
- qiskit/primitives/backend_sampler_v2.py +61 -18
- qiskit/primitives/base/base_estimator.py +2 -2
- qiskit/primitives/containers/data_bin.py +9 -1
- qiskit/primitives/statevector_sampler.py +1 -1
- qiskit/primitives/utils.py +1 -1
- qiskit/providers/__init__.py +3 -3
- qiskit/providers/backend.py +12 -1
- qiskit/providers/backend_compat.py +23 -3
- qiskit/providers/basic_provider/basic_simulator.py +12 -2
- qiskit/providers/fake_provider/fake_pulse_backend.py +6 -1
- qiskit/providers/fake_provider/generic_backend_v2.py +46 -30
- qiskit/providers/models/pulsedefaults.py +2 -0
- qiskit/pulse/builder.py +59 -18
- qiskit/pulse/calibration_entries.py +4 -1
- qiskit/pulse/channels.py +2 -0
- qiskit/pulse/exceptions.py +2 -0
- qiskit/pulse/instruction_schedule_map.py +21 -6
- qiskit/pulse/instructions/acquire.py +2 -0
- qiskit/pulse/instructions/delay.py +2 -0
- qiskit/pulse/instructions/directives.py +8 -0
- qiskit/pulse/instructions/frequency.py +3 -0
- qiskit/pulse/instructions/instruction.py +2 -0
- qiskit/pulse/instructions/phase.py +3 -0
- qiskit/pulse/instructions/play.py +2 -0
- qiskit/pulse/instructions/reference.py +2 -0
- qiskit/pulse/instructions/snapshot.py +2 -0
- qiskit/pulse/library/pulse.py +2 -0
- qiskit/pulse/library/symbolic_pulses.py +28 -0
- qiskit/pulse/library/waveform.py +2 -0
- qiskit/pulse/macros.py +1 -1
- qiskit/pulse/schedule.py +12 -13
- qiskit/pulse/transforms/alignments.py +5 -3
- qiskit/pulse/transforms/dag.py +7 -0
- qiskit/qasm2/export.py +5 -3
- qiskit/qasm2/parse.py +46 -2
- qiskit/qasm3/__init__.py +1 -0
- qiskit/qasm3/ast.py +123 -15
- qiskit/qasm3/exporter.py +103 -77
- qiskit/qobj/converters/pulse_instruction.py +6 -4
- qiskit/qpy/__init__.py +181 -0
- qiskit/qpy/binary_io/circuits.py +20 -5
- qiskit/qpy/binary_io/schedules.py +3 -4
- qiskit/qpy/binary_io/value.py +310 -13
- qiskit/qpy/common.py +46 -2
- qiskit/qpy/formats.py +7 -0
- qiskit/qpy/interface.py +40 -4
- qiskit/quantum_info/__init__.py +4 -0
- qiskit/quantum_info/operators/channel/transformations.py +28 -21
- qiskit/quantum_info/operators/dihedral/dihedral.py +1 -1
- qiskit/quantum_info/operators/operator.py +54 -8
- qiskit/quantum_info/operators/symplectic/base_pauli.py +11 -19
- qiskit/quantum_info/operators/symplectic/clifford.py +1 -1
- qiskit/quantum_info/operators/symplectic/clifford_circuits.py +1 -1
- qiskit/quantum_info/operators/symplectic/pauli.py +2 -0
- qiskit/quantum_info/operators/symplectic/pauli_list.py +4 -4
- qiskit/quantum_info/operators/symplectic/sparse_pauli_op.py +23 -2
- qiskit/quantum_info/states/densitymatrix.py +5 -5
- qiskit/quantum_info/states/stabilizerstate.py +1 -1
- qiskit/quantum_info/states/statevector.py +6 -6
- qiskit/result/mitigation/base_readout_mitigator.py +1 -1
- qiskit/result/mitigation/correlated_readout_mitigator.py +9 -1
- qiskit/result/mitigation/local_readout_mitigator.py +9 -1
- qiskit/result/mitigation/utils.py +57 -0
- qiskit/scheduler/config.py +2 -0
- qiskit/scheduler/methods/basic.py +3 -0
- qiskit/scheduler/schedule_circuit.py +2 -0
- qiskit/scheduler/sequence.py +2 -0
- qiskit/synthesis/__init__.py +25 -0
- qiskit/synthesis/arithmetic/__init__.py +16 -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/multipliers/__init__.py +16 -0
- qiskit/synthesis/arithmetic/multipliers/hrs_cumulative_multiplier.py +102 -0
- qiskit/synthesis/arithmetic/multipliers/rg_qft_multiplier.py +99 -0
- qiskit/synthesis/clifford/clifford_decompose_bm.py +1 -2
- qiskit/synthesis/clifford/clifford_decompose_greedy.py +3 -2
- qiskit/synthesis/clifford/clifford_decompose_layers.py +2 -1
- qiskit/synthesis/evolution/__init__.py +1 -0
- qiskit/synthesis/evolution/lie_trotter.py +16 -42
- qiskit/synthesis/evolution/pauli_network.py +80 -0
- qiskit/synthesis/evolution/product_formula.py +165 -238
- qiskit/synthesis/evolution/qdrift.py +36 -29
- qiskit/synthesis/evolution/suzuki_trotter.py +87 -27
- qiskit/synthesis/multi_controlled/__init__.py +1 -0
- qiskit/synthesis/multi_controlled/mcmt_vchain.py +52 -0
- qiskit/synthesis/qft/qft_decompose_full.py +19 -1
- qiskit/synthesis/qft/qft_decompose_lnn.py +2 -1
- qiskit/synthesis/stabilizer/stabilizer_decompose.py +2 -1
- qiskit/synthesis/two_qubit/two_qubit_decompose.py +4 -63
- qiskit/synthesis/unitary/qsd.py +5 -5
- qiskit/transpiler/__init__.py +21 -14
- qiskit/transpiler/basepasses.py +1 -1
- qiskit/transpiler/passes/__init__.py +2 -0
- qiskit/transpiler/passes/basis/basis_translator.py +9 -565
- qiskit/transpiler/passes/basis/decompose.py +45 -12
- qiskit/transpiler/passes/basis/unroll_3q_or_more.py +1 -1
- qiskit/transpiler/passes/basis/unroll_custom_definitions.py +1 -1
- qiskit/transpiler/passes/calibration/pulse_gate.py +4 -2
- qiskit/transpiler/passes/calibration/rx_builder.py +11 -7
- qiskit/transpiler/passes/calibration/rzx_builder.py +46 -30
- qiskit/transpiler/passes/layout/disjoint_utils.py +15 -13
- qiskit/transpiler/passes/layout/sabre_layout.py +7 -2
- qiskit/transpiler/passes/layout/sabre_pre_layout.py +5 -0
- qiskit/transpiler/passes/optimization/__init__.py +1 -0
- qiskit/transpiler/passes/optimization/collect_cliffords.py +19 -3
- qiskit/transpiler/passes/optimization/collect_linear_functions.py +1 -1
- qiskit/transpiler/passes/optimization/collect_multiqubit_blocks.py +2 -2
- qiskit/transpiler/passes/optimization/commutative_inverse_cancellation.py +1 -1
- qiskit/transpiler/passes/optimization/consolidate_blocks.py +48 -131
- qiskit/transpiler/passes/optimization/echo_rzx_weyl_decomposition.py +4 -2
- qiskit/transpiler/passes/optimization/elide_permutations.py +9 -32
- qiskit/transpiler/passes/optimization/optimize_1q_decomposition.py +5 -11
- qiskit/transpiler/passes/optimization/optimize_1q_gates.py +1 -1
- qiskit/transpiler/passes/optimization/optimize_swap_before_measure.py +1 -1
- qiskit/transpiler/passes/optimization/remove_identity_equiv.py +69 -0
- qiskit/transpiler/passes/optimization/template_matching/backward_match.py +5 -5
- qiskit/transpiler/passes/optimization/template_matching/forward_match.py +4 -4
- qiskit/transpiler/passes/optimization/template_matching/template_substitution.py +2 -2
- qiskit/transpiler/passes/routing/commuting_2q_gate_routing/commuting_2q_gate_router.py +1 -1
- qiskit/transpiler/passes/routing/commuting_2q_gate_routing/swap_strategy.py +1 -1
- qiskit/transpiler/passes/routing/sabre_swap.py +7 -3
- qiskit/transpiler/passes/routing/star_prerouting.py +2 -2
- qiskit/transpiler/passes/scheduling/alap.py +1 -1
- qiskit/transpiler/passes/scheduling/alignments/align_measures.py +2 -2
- qiskit/transpiler/passes/scheduling/alignments/check_durations.py +1 -1
- qiskit/transpiler/passes/scheduling/alignments/pulse_gate_validation.py +2 -0
- qiskit/transpiler/passes/scheduling/alignments/reschedule.py +2 -2
- qiskit/transpiler/passes/scheduling/asap.py +1 -1
- qiskit/transpiler/passes/scheduling/base_scheduler.py +14 -12
- qiskit/transpiler/passes/scheduling/dynamical_decoupling.py +9 -4
- qiskit/transpiler/passes/scheduling/padding/base_padding.py +1 -1
- qiskit/transpiler/passes/scheduling/padding/dynamical_decoupling.py +16 -5
- qiskit/transpiler/passes/scheduling/padding/pad_delay.py +4 -1
- qiskit/transpiler/passes/scheduling/scheduling/base_scheduler.py +6 -2
- qiskit/transpiler/passes/scheduling/time_unit_conversion.py +9 -4
- qiskit/transpiler/passes/synthesis/high_level_synthesis.py +262 -99
- qiskit/transpiler/passes/synthesis/hls_plugins.py +637 -7
- qiskit/transpiler/passes/synthesis/solovay_kitaev_synthesis.py +3 -3
- qiskit/transpiler/passes/synthesis/unitary_synthesis.py +55 -34
- qiskit/transpiler/passes/utils/barrier_before_final_measurements.py +2 -56
- qiskit/transpiler/passes/utils/convert_conditions_to_if_ops.py +5 -0
- qiskit/transpiler/passes/utils/gate_direction.py +12 -275
- qiskit/transpiler/passes/utils/gates_basis.py +7 -30
- qiskit/transpiler/passes/utils/merge_adjacent_barriers.py +2 -1
- qiskit/transpiler/passmanager_config.py +22 -4
- qiskit/transpiler/preset_passmanagers/builtin_plugins.py +40 -14
- qiskit/transpiler/preset_passmanagers/common.py +5 -3
- qiskit/transpiler/preset_passmanagers/generate_preset_pass_manager.py +125 -42
- qiskit/transpiler/preset_passmanagers/plugin.py +1 -1
- qiskit/transpiler/target.py +74 -16
- qiskit/utils/deprecate_pulse.py +119 -0
- qiskit/visualization/circuit/_utils.py +2 -2
- qiskit/visualization/circuit/circuit_visualization.py +3 -2
- qiskit/visualization/circuit/matplotlib.py +1 -1
- qiskit/visualization/dag_visualization.py +1 -1
- qiskit/visualization/pass_manager_visualization.py +3 -14
- qiskit/visualization/pulse_v2/interface.py +3 -1
- qiskit/visualization/timeline/core.py +25 -2
- qiskit/visualization/timeline/interface.py +12 -0
- {qiskit-1.3.0b1.dist-info → qiskit-1.3.0rc2.dist-info}/METADATA +9 -8
- {qiskit-1.3.0b1.dist-info → qiskit-1.3.0rc2.dist-info}/RECORD +357 -346
- {qiskit-1.3.0b1.dist-info → qiskit-1.3.0rc2.dist-info}/WHEEL +1 -1
- {qiskit-1.3.0b1.dist-info → qiskit-1.3.0rc2.dist-info}/entry_points.txt +19 -0
- qiskit/circuit/library/data_preparation/zz_feature_map.py +0 -118
- qiskit/synthesis/two_qubit/weyl.py +0 -97
- qiskit/transpiler/passes/synthesis/qubit_tracker.py +0 -132
- {qiskit-1.3.0b1.dist-info → qiskit-1.3.0rc2.dist-info}/LICENSE.txt +0 -0
- {qiskit-1.3.0b1.dist-info → qiskit-1.3.0rc2.dist-info}/top_level.txt +0 -0
qiskit/pulse/builder.py
CHANGED
@@ -137,7 +137,6 @@ In the example below we demonstrate some more features of the pulse builder:
|
|
137
137
|
from qiskit.compiler import schedule
|
138
138
|
|
139
139
|
from qiskit import pulse, QuantumCircuit
|
140
|
-
from qiskit.pulse import library
|
141
140
|
from qiskit.providers.fake_provider import FakeOpenPulse2Q
|
142
141
|
|
143
142
|
backend = FakeOpenPulse2Q()
|
@@ -147,7 +146,7 @@ In the example below we demonstrate some more features of the pulse builder:
|
|
147
146
|
|
148
147
|
with pulse.build(backend) as pulse_prog:
|
149
148
|
# Create a pulse.
|
150
|
-
gaussian_pulse =
|
149
|
+
gaussian_pulse = pulse.Gaussian(10, 1.0, 2)
|
151
150
|
# Get the qubit's corresponding drive channel from the backend.
|
152
151
|
d0 = pulse.drive_channel(0)
|
153
152
|
d1 = pulse.drive_channel(1)
|
@@ -258,7 +257,7 @@ Methods to return the correct channels for the respective qubit indices.
|
|
258
257
|
d0 = pulse.drive_channel(0)
|
259
258
|
print(d0)
|
260
259
|
|
261
|
-
..
|
260
|
+
.. code-block:: text
|
262
261
|
|
263
262
|
DriveChannel(0)
|
264
263
|
|
@@ -285,7 +284,7 @@ Pulse instructions are available within the builder interface. Here's an example
|
|
285
284
|
d0 = pulse.drive_channel(0)
|
286
285
|
a0 = pulse.acquire_channel(0)
|
287
286
|
|
288
|
-
pulse.play(pulse.
|
287
|
+
pulse.play(pulse.Constant(10, 1.0), d0)
|
289
288
|
pulse.delay(20, d0)
|
290
289
|
pulse.shift_phase(3.14/2, d0)
|
291
290
|
pulse.set_phase(3.14, d0)
|
@@ -293,8 +292,8 @@ Pulse instructions are available within the builder interface. Here's an example
|
|
293
292
|
pulse.set_frequency(5e9, d0)
|
294
293
|
|
295
294
|
with pulse.build() as temp_sched:
|
296
|
-
pulse.play(pulse.
|
297
|
-
pulse.play(pulse.
|
295
|
+
pulse.play(pulse.Gaussian(20, 1.0, 3.0), d0)
|
296
|
+
pulse.play(pulse.Gaussian(20, -1.0, 3.0), d0)
|
298
297
|
|
299
298
|
pulse.call(temp_sched)
|
300
299
|
pulse.acquire(30, a0, pulse.MemorySlot(0))
|
@@ -363,7 +362,7 @@ Macros help you add more complex functionality to your pulse program.
|
|
363
362
|
mem_slot = pulse.measure(0)
|
364
363
|
print(mem_slot)
|
365
364
|
|
366
|
-
..
|
365
|
+
.. code-block:: text
|
367
366
|
|
368
367
|
MemorySlot(0)
|
369
368
|
|
@@ -397,7 +396,7 @@ how the program is built.
|
|
397
396
|
print('There are {} seconds in {} samples.'.format(
|
398
397
|
seconds, pulse.seconds_to_samples(1e-6)))
|
399
398
|
|
400
|
-
..
|
399
|
+
.. code-block:: text
|
401
400
|
|
402
401
|
Number of qubits in backend: 1
|
403
402
|
There are 160 samples in 3.5555555555555554e-08 seconds
|
@@ -437,6 +436,7 @@ from qiskit.providers.backend import BackendV2
|
|
437
436
|
from qiskit.pulse.instructions import directives
|
438
437
|
from qiskit.pulse.schedule import Schedule, ScheduleBlock
|
439
438
|
from qiskit.pulse.transforms.alignments import AlignmentKind
|
439
|
+
from qiskit.utils.deprecate_pulse import deprecate_pulse_func
|
440
440
|
|
441
441
|
|
442
442
|
if sys.version_info >= (3, 12):
|
@@ -774,6 +774,7 @@ class _PulseBuilder:
|
|
774
774
|
return self.backend.configuration().dt
|
775
775
|
|
776
776
|
|
777
|
+
@deprecate_pulse_func
|
777
778
|
def build(
|
778
779
|
backend=None,
|
779
780
|
schedule: ScheduleBlock | None = None,
|
@@ -847,6 +848,7 @@ def _active_builder() -> _PulseBuilder:
|
|
847
848
|
) from ex
|
848
849
|
|
849
850
|
|
851
|
+
@deprecate_pulse_func
|
850
852
|
def active_backend():
|
851
853
|
"""Get the backend of the currently active builder context.
|
852
854
|
|
@@ -890,13 +892,14 @@ def append_instruction(instruction: instructions.Instruction):
|
|
890
892
|
|
891
893
|
print(pulse_prog.instructions)
|
892
894
|
|
893
|
-
..
|
895
|
+
.. code-block:: text
|
894
896
|
|
895
897
|
((0, Delay(10, DriveChannel(0))),)
|
896
898
|
"""
|
897
899
|
_active_builder().append_instruction(instruction)
|
898
900
|
|
899
901
|
|
902
|
+
@deprecate_pulse_func
|
900
903
|
def num_qubits() -> int:
|
901
904
|
"""Return number of qubits in the currently active backend.
|
902
905
|
|
@@ -912,7 +915,7 @@ def num_qubits() -> int:
|
|
912
915
|
with pulse.build(backend):
|
913
916
|
print(pulse.num_qubits())
|
914
917
|
|
915
|
-
..
|
918
|
+
.. code-block:: text
|
916
919
|
|
917
920
|
2
|
918
921
|
|
@@ -923,6 +926,7 @@ def num_qubits() -> int:
|
|
923
926
|
return active_backend().configuration().n_qubits
|
924
927
|
|
925
928
|
|
929
|
+
@deprecate_pulse_func
|
926
930
|
def seconds_to_samples(seconds: float | np.ndarray) -> int | np.ndarray:
|
927
931
|
"""Obtain the number of samples that will elapse in ``seconds`` on the
|
928
932
|
active backend.
|
@@ -941,6 +945,7 @@ def seconds_to_samples(seconds: float | np.ndarray) -> int | np.ndarray:
|
|
941
945
|
return int(seconds / dt)
|
942
946
|
|
943
947
|
|
948
|
+
@deprecate_pulse_func
|
944
949
|
def samples_to_seconds(samples: int | np.ndarray) -> float | np.ndarray:
|
945
950
|
"""Obtain the time in seconds that will elapse for the input number of
|
946
951
|
samples on the active backend.
|
@@ -954,6 +959,7 @@ def samples_to_seconds(samples: int | np.ndarray) -> float | np.ndarray:
|
|
954
959
|
return samples * _active_builder().get_dt()
|
955
960
|
|
956
961
|
|
962
|
+
@deprecate_pulse_func
|
957
963
|
def qubit_channels(qubit: int) -> set[chans.Channel]:
|
958
964
|
"""Returns the set of channels associated with a qubit.
|
959
965
|
|
@@ -969,7 +975,7 @@ def qubit_channels(qubit: int) -> set[chans.Channel]:
|
|
969
975
|
with pulse.build(backend):
|
970
976
|
print(pulse.qubit_channels(0))
|
971
977
|
|
972
|
-
..
|
978
|
+
.. code-block:: text
|
973
979
|
|
974
980
|
{MeasureChannel(0), ControlChannel(0), DriveChannel(0), AcquireChannel(0), ControlChannel(1)}
|
975
981
|
|
@@ -1026,6 +1032,7 @@ def _qubits_to_channels(*channels_or_qubits: int | chans.Channel) -> set[chans.C
|
|
1026
1032
|
|
1027
1033
|
|
1028
1034
|
@contextmanager
|
1035
|
+
@deprecate_pulse_func
|
1029
1036
|
def align_left() -> Generator[None, None, None]:
|
1030
1037
|
"""Left alignment pulse scheduling context.
|
1031
1038
|
|
@@ -1064,6 +1071,7 @@ def align_left() -> Generator[None, None, None]:
|
|
1064
1071
|
|
1065
1072
|
|
1066
1073
|
@contextmanager
|
1074
|
+
@deprecate_pulse_func
|
1067
1075
|
def align_right() -> Generator[None, None, None]:
|
1068
1076
|
"""Right alignment pulse scheduling context.
|
1069
1077
|
|
@@ -1102,6 +1110,7 @@ def align_right() -> Generator[None, None, None]:
|
|
1102
1110
|
|
1103
1111
|
|
1104
1112
|
@contextmanager
|
1113
|
+
@deprecate_pulse_func
|
1105
1114
|
def align_sequential() -> Generator[None, None, None]:
|
1106
1115
|
"""Sequential alignment pulse scheduling context.
|
1107
1116
|
|
@@ -1140,6 +1149,7 @@ def align_sequential() -> Generator[None, None, None]:
|
|
1140
1149
|
|
1141
1150
|
|
1142
1151
|
@contextmanager
|
1152
|
+
@deprecate_pulse_func
|
1143
1153
|
def align_equispaced(duration: int | ParameterExpression) -> Generator[None, None, None]:
|
1144
1154
|
"""Equispaced alignment pulse scheduling context.
|
1145
1155
|
|
@@ -1192,6 +1202,7 @@ def align_equispaced(duration: int | ParameterExpression) -> Generator[None, Non
|
|
1192
1202
|
|
1193
1203
|
|
1194
1204
|
@contextmanager
|
1205
|
+
@deprecate_pulse_func
|
1195
1206
|
def align_func(
|
1196
1207
|
duration: int | ParameterExpression, func: Callable[[int], float]
|
1197
1208
|
) -> Generator[None, None, None]:
|
@@ -1280,6 +1291,7 @@ def general_transforms(alignment_context: AlignmentKind) -> Generator[None, None
|
|
1280
1291
|
|
1281
1292
|
|
1282
1293
|
@contextmanager
|
1294
|
+
@deprecate_pulse_func
|
1283
1295
|
def phase_offset(phase: float, *channels: chans.PulseChannel) -> Generator[None, None, None]:
|
1284
1296
|
"""Shift the phase of input channels on entry into context and undo on exit.
|
1285
1297
|
|
@@ -1316,6 +1328,7 @@ def phase_offset(phase: float, *channels: chans.PulseChannel) -> Generator[None,
|
|
1316
1328
|
|
1317
1329
|
|
1318
1330
|
@contextmanager
|
1331
|
+
@deprecate_pulse_func
|
1319
1332
|
def frequency_offset(
|
1320
1333
|
frequency: float, *channels: chans.PulseChannel, compensate_phase: bool = False
|
1321
1334
|
) -> Generator[None, None, None]:
|
@@ -1327,7 +1340,9 @@ def frequency_offset(
|
|
1327
1340
|
:emphasize-lines: 7, 16
|
1328
1341
|
|
1329
1342
|
from qiskit import pulse
|
1343
|
+
from qiskit.providers.fake_provider import FakeOpenPulse2Q
|
1330
1344
|
|
1345
|
+
backend = FakeOpenPulse2Q()
|
1331
1346
|
d0 = pulse.DriveChannel(0)
|
1332
1347
|
|
1333
1348
|
with pulse.build(backend) as pulse_prog:
|
@@ -1379,6 +1394,7 @@ def frequency_offset(
|
|
1379
1394
|
|
1380
1395
|
|
1381
1396
|
# Channels
|
1397
|
+
@deprecate_pulse_func
|
1382
1398
|
def drive_channel(qubit: int) -> chans.DriveChannel:
|
1383
1399
|
"""Return ``DriveChannel`` for ``qubit`` on the active builder backend.
|
1384
1400
|
|
@@ -1402,6 +1418,7 @@ def drive_channel(qubit: int) -> chans.DriveChannel:
|
|
1402
1418
|
return active_backend().configuration().drive(qubit)
|
1403
1419
|
|
1404
1420
|
|
1421
|
+
@deprecate_pulse_func
|
1405
1422
|
def measure_channel(qubit: int) -> chans.MeasureChannel:
|
1406
1423
|
"""Return ``MeasureChannel`` for ``qubit`` on the active builder backend.
|
1407
1424
|
|
@@ -1425,6 +1442,7 @@ def measure_channel(qubit: int) -> chans.MeasureChannel:
|
|
1425
1442
|
return active_backend().configuration().measure(qubit)
|
1426
1443
|
|
1427
1444
|
|
1445
|
+
@deprecate_pulse_func
|
1428
1446
|
def acquire_channel(qubit: int) -> chans.AcquireChannel:
|
1429
1447
|
"""Return ``AcquireChannel`` for ``qubit`` on the active builder backend.
|
1430
1448
|
|
@@ -1448,6 +1466,7 @@ def acquire_channel(qubit: int) -> chans.AcquireChannel:
|
|
1448
1466
|
return active_backend().configuration().acquire(qubit)
|
1449
1467
|
|
1450
1468
|
|
1469
|
+
@deprecate_pulse_func
|
1451
1470
|
def control_channels(*qubits: Iterable[int]) -> list[chans.ControlChannel]:
|
1452
1471
|
"""Return ``ControlChannel`` for ``qubit`` on the active builder backend.
|
1453
1472
|
|
@@ -1482,6 +1501,7 @@ def control_channels(*qubits: Iterable[int]) -> list[chans.ControlChannel]:
|
|
1482
1501
|
|
1483
1502
|
|
1484
1503
|
# Base Instructions
|
1504
|
+
@deprecate_pulse_func
|
1485
1505
|
def delay(duration: int, channel: chans.Channel, name: str | None = None):
|
1486
1506
|
"""Delay on a ``channel`` for a ``duration``.
|
1487
1507
|
|
@@ -1504,6 +1524,7 @@ def delay(duration: int, channel: chans.Channel, name: str | None = None):
|
|
1504
1524
|
append_instruction(instructions.Delay(duration, channel, name=name))
|
1505
1525
|
|
1506
1526
|
|
1527
|
+
@deprecate_pulse_func
|
1507
1528
|
def play(pulse: library.Pulse | np.ndarray, channel: chans.PulseChannel, name: str | None = None):
|
1508
1529
|
"""Play a ``pulse`` on a ``channel``.
|
1509
1530
|
|
@@ -1537,6 +1558,7 @@ class _MetaDataType(TypedDict, total=False):
|
|
1537
1558
|
name: str
|
1538
1559
|
|
1539
1560
|
|
1561
|
+
@deprecate_pulse_func
|
1540
1562
|
def acquire(
|
1541
1563
|
duration: int,
|
1542
1564
|
qubit_or_channel: int | chans.AcquireChannel,
|
@@ -1590,6 +1612,7 @@ def acquire(
|
|
1590
1612
|
raise exceptions.PulseError(f'Register of type: "{type(register)}" is not supported')
|
1591
1613
|
|
1592
1614
|
|
1615
|
+
@deprecate_pulse_func
|
1593
1616
|
def set_frequency(frequency: float, channel: chans.PulseChannel, name: str | None = None):
|
1594
1617
|
"""Set the ``frequency`` of a pulse ``channel``.
|
1595
1618
|
|
@@ -1612,6 +1635,7 @@ def set_frequency(frequency: float, channel: chans.PulseChannel, name: str | Non
|
|
1612
1635
|
append_instruction(instructions.SetFrequency(frequency, channel, name=name))
|
1613
1636
|
|
1614
1637
|
|
1638
|
+
@deprecate_pulse_func
|
1615
1639
|
def shift_frequency(frequency: float, channel: chans.PulseChannel, name: str | None = None):
|
1616
1640
|
"""Shift the ``frequency`` of a pulse ``channel``.
|
1617
1641
|
|
@@ -1635,6 +1659,7 @@ def shift_frequency(frequency: float, channel: chans.PulseChannel, name: str | N
|
|
1635
1659
|
append_instruction(instructions.ShiftFrequency(frequency, channel, name=name))
|
1636
1660
|
|
1637
1661
|
|
1662
|
+
@deprecate_pulse_func
|
1638
1663
|
def set_phase(phase: float, channel: chans.PulseChannel, name: str | None = None):
|
1639
1664
|
"""Set the ``phase`` of a pulse ``channel``.
|
1640
1665
|
|
@@ -1660,6 +1685,7 @@ def set_phase(phase: float, channel: chans.PulseChannel, name: str | None = None
|
|
1660
1685
|
append_instruction(instructions.SetPhase(phase, channel, name=name))
|
1661
1686
|
|
1662
1687
|
|
1688
|
+
@deprecate_pulse_func
|
1663
1689
|
def shift_phase(phase: float, channel: chans.PulseChannel, name: str | None = None):
|
1664
1690
|
"""Shift the ``phase`` of a pulse ``channel``.
|
1665
1691
|
|
@@ -1684,6 +1710,7 @@ def shift_phase(phase: float, channel: chans.PulseChannel, name: str | None = No
|
|
1684
1710
|
append_instruction(instructions.ShiftPhase(phase, channel, name))
|
1685
1711
|
|
1686
1712
|
|
1713
|
+
@deprecate_pulse_func
|
1687
1714
|
def snapshot(label: str, snapshot_type: str = "statevector"):
|
1688
1715
|
"""Simulator snapshot.
|
1689
1716
|
|
@@ -1703,6 +1730,7 @@ def snapshot(label: str, snapshot_type: str = "statevector"):
|
|
1703
1730
|
append_instruction(instructions.Snapshot(label, snapshot_type=snapshot_type))
|
1704
1731
|
|
1705
1732
|
|
1733
|
+
@deprecate_pulse_func
|
1706
1734
|
def call(
|
1707
1735
|
target: Schedule | ScheduleBlock | None,
|
1708
1736
|
name: str | None = None,
|
@@ -1742,7 +1770,7 @@ def call(
|
|
1742
1770
|
|
1743
1771
|
print(pulse_prog)
|
1744
1772
|
|
1745
|
-
..
|
1773
|
+
.. code-block:: text
|
1746
1774
|
|
1747
1775
|
ScheduleBlock(
|
1748
1776
|
ScheduleBlock(
|
@@ -1763,7 +1791,7 @@ def call(
|
|
1763
1791
|
|
1764
1792
|
print(pulse_prog.references)
|
1765
1793
|
|
1766
|
-
..
|
1794
|
+
.. code-block:: text
|
1767
1795
|
|
1768
1796
|
ReferenceManager:
|
1769
1797
|
- ('block0', '634b3b50bd684e26a673af1fbd2d6c81'): ScheduleBlock(Play(Gaussian(...
|
@@ -1783,7 +1811,7 @@ def call(
|
|
1783
1811
|
|
1784
1812
|
print(pulse_prog)
|
1785
1813
|
|
1786
|
-
..
|
1814
|
+
.. code-block:: text
|
1787
1815
|
|
1788
1816
|
ScheduleBlock(
|
1789
1817
|
ScheduleBlock(
|
@@ -1823,7 +1851,7 @@ def call(
|
|
1823
1851
|
|
1824
1852
|
print(pulse_prog)
|
1825
1853
|
|
1826
|
-
..
|
1854
|
+
.. code-block:: text
|
1827
1855
|
|
1828
1856
|
ScheduleBlock(
|
1829
1857
|
ScheduleBlock(
|
@@ -1847,7 +1875,7 @@ def call(
|
|
1847
1875
|
|
1848
1876
|
print(pulse_prog)
|
1849
1877
|
|
1850
|
-
..
|
1878
|
+
.. code-block:: text
|
1851
1879
|
|
1852
1880
|
ScheduleBlock(
|
1853
1881
|
Call(
|
@@ -1897,6 +1925,7 @@ def call(
|
|
1897
1925
|
_active_builder().call_subroutine(target, name, value_dict, **kw_params)
|
1898
1926
|
|
1899
1927
|
|
1928
|
+
@deprecate_pulse_func
|
1900
1929
|
def reference(name: str, *extra_keys: str):
|
1901
1930
|
"""Refer to undefined subroutine by string keys.
|
1902
1931
|
|
@@ -1923,6 +1952,7 @@ def reference(name: str, *extra_keys: str):
|
|
1923
1952
|
|
1924
1953
|
|
1925
1954
|
# Directives
|
1955
|
+
@deprecate_pulse_func
|
1926
1956
|
def barrier(*channels_or_qubits: chans.Channel | int, name: str | None = None):
|
1927
1957
|
"""Barrier directive for a set of channels and qubits.
|
1928
1958
|
|
@@ -1969,19 +1999,23 @@ def barrier(*channels_or_qubits: chans.Channel | int, name: str | None = None):
|
|
1969
1999
|
.. code-block::
|
1970
2000
|
|
1971
2001
|
import math
|
2002
|
+
from qiskit import pulse
|
2003
|
+
from qiskit.providers.fake_provider import FakeOpenPulse2Q
|
2004
|
+
|
2005
|
+
backend = FakeOpenPulse2Q()
|
1972
2006
|
|
1973
2007
|
d0 = pulse.DriveChannel(0)
|
1974
2008
|
|
1975
2009
|
with pulse.build(backend) as pulse_prog:
|
1976
2010
|
with pulse.align_right():
|
1977
|
-
pulse.call(backend.defaults.instruction_schedule_map.get('
|
2011
|
+
pulse.call(backend.defaults().instruction_schedule_map.get('u1', (1,)))
|
1978
2012
|
# Barrier qubit 1 and d0.
|
1979
2013
|
pulse.barrier(1, d0)
|
1980
2014
|
# Due to barrier this will play before the gate on qubit 1.
|
1981
2015
|
pulse.play(pulse.Constant(10, 1.0), d0)
|
1982
2016
|
# This will end at the same time as the pulse above due to
|
1983
2017
|
# the barrier.
|
1984
|
-
pulse.call(backend.defaults.instruction_schedule_map.get('
|
2018
|
+
pulse.call(backend.defaults().instruction_schedule_map.get('u1', (1,)))
|
1985
2019
|
|
1986
2020
|
.. note:: Requires the active builder context to have a backend set if
|
1987
2021
|
qubits are barriered on.
|
@@ -2012,6 +2046,7 @@ def macro(func: Callable):
|
|
2012
2046
|
:include-source:
|
2013
2047
|
|
2014
2048
|
from qiskit import pulse
|
2049
|
+
from qiskit.providers.fake_provider import FakeOpenPulse2Q
|
2015
2050
|
|
2016
2051
|
@pulse.macro
|
2017
2052
|
def measure(qubit: int):
|
@@ -2021,6 +2056,9 @@ def macro(func: Callable):
|
|
2021
2056
|
|
2022
2057
|
return mem_slot
|
2023
2058
|
|
2059
|
+
|
2060
|
+
backend = FakeOpenPulse2Q()
|
2061
|
+
|
2024
2062
|
with pulse.build(backend=backend) as sched:
|
2025
2063
|
mem_slot = measure(0)
|
2026
2064
|
print(f"Qubit measured into {mem_slot}")
|
@@ -2052,6 +2090,7 @@ def macro(func: Callable):
|
|
2052
2090
|
return wrapper
|
2053
2091
|
|
2054
2092
|
|
2093
|
+
@deprecate_pulse_func
|
2055
2094
|
def measure(
|
2056
2095
|
qubits: list[int] | int,
|
2057
2096
|
registers: list[StorageLocation] | StorageLocation = None,
|
@@ -2140,6 +2179,7 @@ def measure(
|
|
2140
2179
|
return registers
|
2141
2180
|
|
2142
2181
|
|
2182
|
+
@deprecate_pulse_func
|
2143
2183
|
def measure_all() -> list[chans.MemorySlot]:
|
2144
2184
|
r"""Measure all qubits within the currently active builder context.
|
2145
2185
|
|
@@ -2183,6 +2223,7 @@ def measure_all() -> list[chans.MemorySlot]:
|
|
2183
2223
|
return registers
|
2184
2224
|
|
2185
2225
|
|
2226
|
+
@deprecate_pulse_func
|
2186
2227
|
def delay_qubits(duration: int, *qubits: int):
|
2187
2228
|
r"""Insert delays on all the :class:`channels.Channel`\s that correspond
|
2188
2229
|
to the input ``qubits`` at the same time.
|
@@ -321,7 +321,10 @@ class PulseQobjDef(ScheduleDef):
|
|
321
321
|
|
322
322
|
def _build_schedule(self):
|
323
323
|
"""Build pulse schedule from cmd-def sequence."""
|
324
|
-
|
324
|
+
with warnings.catch_warnings():
|
325
|
+
warnings.simplefilter(action="ignore", category=DeprecationWarning)
|
326
|
+
# `Schedule` is being deprecated in Qiskit 1.3
|
327
|
+
schedule = Schedule(name=self._name)
|
325
328
|
try:
|
326
329
|
for qobj_inst in self._source:
|
327
330
|
for qiskit_inst in self._converter._get_sequences(qobj_inst):
|
qiskit/pulse/channels.py
CHANGED
@@ -58,6 +58,7 @@ import numpy as np
|
|
58
58
|
from qiskit.circuit import Parameter
|
59
59
|
from qiskit.circuit.parameterexpression import ParameterExpression
|
60
60
|
from qiskit.pulse.exceptions import PulseError
|
61
|
+
from qiskit.utils.deprecate_pulse import deprecate_pulse_func
|
61
62
|
|
62
63
|
|
63
64
|
class Channel(metaclass=ABCMeta):
|
@@ -90,6 +91,7 @@ class Channel(metaclass=ABCMeta):
|
|
90
91
|
|
91
92
|
return super().__new__(cls)
|
92
93
|
|
94
|
+
@deprecate_pulse_func
|
93
95
|
def __init__(self, index: int):
|
94
96
|
"""Channel class.
|
95
97
|
|
qiskit/pulse/exceptions.py
CHANGED
@@ -12,11 +12,13 @@
|
|
12
12
|
|
13
13
|
"""Exception for errors raised by the pulse module."""
|
14
14
|
from qiskit.exceptions import QiskitError
|
15
|
+
from qiskit.utils.deprecate_pulse import deprecate_pulse_func
|
15
16
|
|
16
17
|
|
17
18
|
class PulseError(QiskitError):
|
18
19
|
"""Errors raised by the pulse module."""
|
19
20
|
|
21
|
+
@deprecate_pulse_func
|
20
22
|
def __init__(self, *message):
|
21
23
|
"""Set the error message."""
|
22
24
|
super().__init__(*message)
|
@@ -46,6 +46,7 @@ from qiskit.pulse.calibration_entries import (
|
|
46
46
|
)
|
47
47
|
from qiskit.pulse.exceptions import PulseError
|
48
48
|
from qiskit.pulse.schedule import Schedule, ScheduleBlock
|
49
|
+
from qiskit.utils.deprecate_pulse import deprecate_pulse_func
|
49
50
|
|
50
51
|
|
51
52
|
class InstructionScheduleMap:
|
@@ -62,6 +63,7 @@ class InstructionScheduleMap:
|
|
62
63
|
These can usually be seen as gate calibrations.
|
63
64
|
"""
|
64
65
|
|
66
|
+
@deprecate_pulse_func
|
65
67
|
def __init__(self):
|
66
68
|
"""Initialize a circuit instruction to schedule mapper instance."""
|
67
69
|
# The processed and reformatted circuit instruction definitions
|
@@ -167,12 +169,22 @@ class InstructionScheduleMap:
|
|
167
169
|
"""
|
168
170
|
instruction = _get_instruction_string(instruction)
|
169
171
|
if not self.has(instruction, _to_tuple(qubits)):
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
172
|
+
# TODO: PulseError is deprecated, this code will be removed in 2.0.
|
173
|
+
# In the meantime, we catch the deprecation
|
174
|
+
# warning not to overload users with non-actionable messages
|
175
|
+
with warnings.catch_warnings():
|
176
|
+
warnings.filterwarnings(
|
177
|
+
"ignore",
|
178
|
+
category=DeprecationWarning,
|
179
|
+
message=".*The entire Qiskit Pulse package*",
|
180
|
+
module="qiskit",
|
174
181
|
)
|
175
|
-
|
182
|
+
if instruction in self._map:
|
183
|
+
raise PulseError(
|
184
|
+
f"Operation '{instruction}' exists, but is only defined for qubits "
|
185
|
+
f"{self.qubits_with_instruction(instruction)}."
|
186
|
+
)
|
187
|
+
raise PulseError(f"Operation '{instruction}' is not defined for this system.")
|
176
188
|
|
177
189
|
def get(
|
178
190
|
self,
|
@@ -354,7 +366,10 @@ class InstructionScheduleMap:
|
|
354
366
|
instruction = _get_instruction_string(instruction)
|
355
367
|
|
356
368
|
self.assert_has(instruction, qubits)
|
357
|
-
|
369
|
+
with warnings.catch_warnings():
|
370
|
+
warnings.simplefilter(action="ignore", category=DeprecationWarning)
|
371
|
+
# Prevent `get_signature` from emitting pulse package deprecation warnings
|
372
|
+
signature = self._map[instruction][_to_tuple(qubits)].get_signature()
|
358
373
|
return tuple(signature.parameters.keys())
|
359
374
|
|
360
375
|
def __str__(self):
|
@@ -19,6 +19,7 @@ from qiskit.pulse.channels import MemorySlot, RegisterSlot, AcquireChannel
|
|
19
19
|
from qiskit.pulse.configuration import Kernel, Discriminator
|
20
20
|
from qiskit.pulse.exceptions import PulseError
|
21
21
|
from qiskit.pulse.instructions.instruction import Instruction
|
22
|
+
from qiskit.utils.deprecate_pulse import deprecate_pulse_func
|
22
23
|
|
23
24
|
|
24
25
|
class Acquire(Instruction):
|
@@ -38,6 +39,7 @@ class Acquire(Instruction):
|
|
38
39
|
* the discriminator to classify kerneled IQ points.
|
39
40
|
"""
|
40
41
|
|
42
|
+
@deprecate_pulse_func
|
41
43
|
def __init__(
|
42
44
|
self,
|
43
45
|
duration: int | ParameterExpression,
|
@@ -16,6 +16,7 @@ from __future__ import annotations
|
|
16
16
|
from qiskit.circuit import ParameterExpression
|
17
17
|
from qiskit.pulse.channels import Channel
|
18
18
|
from qiskit.pulse.instructions.instruction import Instruction
|
19
|
+
from qiskit.utils.deprecate_pulse import deprecate_pulse_func
|
19
20
|
|
20
21
|
|
21
22
|
class Delay(Instruction):
|
@@ -34,6 +35,7 @@ class Delay(Instruction):
|
|
34
35
|
The ``channel`` will output no signal from time=0 up until time=10.
|
35
36
|
"""
|
36
37
|
|
38
|
+
@deprecate_pulse_func
|
37
39
|
def __init__(
|
38
40
|
self,
|
39
41
|
duration: int | ParameterExpression,
|
@@ -18,6 +18,7 @@ from abc import ABC
|
|
18
18
|
from qiskit.pulse import channels as chans
|
19
19
|
from qiskit.pulse.instructions import instruction
|
20
20
|
from qiskit.pulse.exceptions import PulseError
|
21
|
+
from qiskit.utils.deprecate_pulse import deprecate_pulse_func
|
21
22
|
|
22
23
|
|
23
24
|
class Directive(instruction.Instruction, ABC):
|
@@ -35,6 +36,7 @@ class Directive(instruction.Instruction, ABC):
|
|
35
36
|
class RelativeBarrier(Directive):
|
36
37
|
"""Pulse ``RelativeBarrier`` directive."""
|
37
38
|
|
39
|
+
@deprecate_pulse_func
|
38
40
|
def __init__(self, *channels: chans.Channel, name: str | None = None):
|
39
41
|
"""Create a relative barrier directive.
|
40
42
|
|
@@ -72,6 +74,8 @@ class TimeBlockade(Directive):
|
|
72
74
|
|
73
75
|
.. code-block:: python
|
74
76
|
|
77
|
+
from qiskit.pulse import Schedule, Play, Constant, DriveChannel
|
78
|
+
|
75
79
|
schedule = Schedule()
|
76
80
|
schedule.insert(120, Play(Constant(10, 0.1), DriveChannel(0)))
|
77
81
|
|
@@ -79,6 +83,9 @@ class TimeBlockade(Directive):
|
|
79
83
|
|
80
84
|
.. code-block:: python
|
81
85
|
|
86
|
+
from qiskit.pulse import ScheduleBlock, Play, Constant, DriveChannel
|
87
|
+
from qiskit.pulse.instructions import TimeBlockade
|
88
|
+
|
82
89
|
block = ScheduleBlock()
|
83
90
|
block.append(TimeBlockade(120, DriveChannel(0)))
|
84
91
|
block.append(Play(Constant(10, 0.1), DriveChannel(0)))
|
@@ -102,6 +109,7 @@ class TimeBlockade(Directive):
|
|
102
109
|
user can insert another instruction without timing overlap.
|
103
110
|
"""
|
104
111
|
|
112
|
+
@deprecate_pulse_func
|
105
113
|
def __init__(
|
106
114
|
self,
|
107
115
|
duration: int,
|
@@ -19,6 +19,7 @@ from qiskit.circuit.parameterexpression import ParameterExpression
|
|
19
19
|
from qiskit.pulse.channels import PulseChannel
|
20
20
|
from qiskit.pulse.instructions.instruction import Instruction
|
21
21
|
from qiskit.pulse.exceptions import PulseError
|
22
|
+
from qiskit.utils.deprecate_pulse import deprecate_pulse_func
|
22
23
|
|
23
24
|
|
24
25
|
class SetFrequency(Instruction):
|
@@ -35,6 +36,7 @@ class SetFrequency(Instruction):
|
|
35
36
|
The duration of SetFrequency is 0.
|
36
37
|
"""
|
37
38
|
|
39
|
+
@deprecate_pulse_func
|
38
40
|
def __init__(
|
39
41
|
self,
|
40
42
|
frequency: Union[float, ParameterExpression],
|
@@ -85,6 +87,7 @@ class SetFrequency(Instruction):
|
|
85
87
|
class ShiftFrequency(Instruction):
|
86
88
|
"""Shift the channel frequency away from the current frequency."""
|
87
89
|
|
90
|
+
@deprecate_pulse_func
|
88
91
|
def __init__(
|
89
92
|
self,
|
90
93
|
frequency: Union[float, ParameterExpression],
|
@@ -28,6 +28,7 @@ from collections.abc import Iterable
|
|
28
28
|
from qiskit.circuit import Parameter, ParameterExpression
|
29
29
|
from qiskit.pulse.channels import Channel
|
30
30
|
from qiskit.pulse.exceptions import PulseError
|
31
|
+
from qiskit.utils.deprecate_pulse import deprecate_pulse_func
|
31
32
|
|
32
33
|
|
33
34
|
# pylint: disable=bad-docstring-quotes
|
@@ -38,6 +39,7 @@ class Instruction(ABC):
|
|
38
39
|
channels.
|
39
40
|
"""
|
40
41
|
|
42
|
+
@deprecate_pulse_func
|
41
43
|
def __init__(
|
42
44
|
self,
|
43
45
|
operands: tuple,
|
@@ -21,6 +21,7 @@ from qiskit.circuit import ParameterExpression
|
|
21
21
|
from qiskit.pulse.channels import PulseChannel
|
22
22
|
from qiskit.pulse.instructions.instruction import Instruction
|
23
23
|
from qiskit.pulse.exceptions import PulseError
|
24
|
+
from qiskit.utils.deprecate_pulse import deprecate_pulse_func
|
24
25
|
|
25
26
|
|
26
27
|
class ShiftPhase(Instruction):
|
@@ -40,6 +41,7 @@ class ShiftPhase(Instruction):
|
|
40
41
|
by using a ShiftPhase to update the frame tracking the qubit state.
|
41
42
|
"""
|
42
43
|
|
44
|
+
@deprecate_pulse_func
|
43
45
|
def __init__(
|
44
46
|
self,
|
45
47
|
phase: Union[complex, ParameterExpression],
|
@@ -101,6 +103,7 @@ class SetPhase(Instruction):
|
|
101
103
|
The ``SetPhase`` instruction sets :math:`\phi` to the instruction's ``phase`` operand.
|
102
104
|
"""
|
103
105
|
|
106
|
+
@deprecate_pulse_func
|
104
107
|
def __init__(
|
105
108
|
self,
|
106
109
|
phase: Union[complex, ParameterExpression],
|
@@ -21,6 +21,7 @@ from qiskit.pulse.channels import PulseChannel
|
|
21
21
|
from qiskit.pulse.exceptions import PulseError
|
22
22
|
from qiskit.pulse.instructions.instruction import Instruction
|
23
23
|
from qiskit.pulse.library.pulse import Pulse
|
24
|
+
from qiskit.utils.deprecate_pulse import deprecate_pulse_func
|
24
25
|
|
25
26
|
|
26
27
|
class Play(Instruction):
|
@@ -32,6 +33,7 @@ class Play(Instruction):
|
|
32
33
|
cycle time, dt, of the backend.
|
33
34
|
"""
|
34
35
|
|
36
|
+
@deprecate_pulse_func
|
35
37
|
def __init__(self, pulse: Pulse, channel: PulseChannel, name: str | None = None):
|
36
38
|
"""Create a new pulse instruction.
|
37
39
|
|