qiskit 1.3.0__cp39-abi3-win32.whl → 1.3.0b1__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 +1 -20
- qiskit/_accelerate.pyd +0 -0
- qiskit/assembler/assemble_schedules.py +0 -2
- qiskit/circuit/__init__.py +1 -44
- qiskit/circuit/_standard_gates_commutations.py +0 -585
- qiskit/circuit/barrier.py +0 -2
- qiskit/circuit/controlflow/builder.py +3 -3
- qiskit/circuit/controlflow/if_else.py +5 -13
- qiskit/circuit/controlflow/while_loop.py +2 -10
- qiskit/circuit/delay.py +3 -20
- qiskit/circuit/equivalence.py +214 -13
- qiskit/circuit/gate.py +1 -3
- qiskit/circuit/instruction.py +11 -32
- qiskit/circuit/instructionset.py +0 -2
- qiskit/circuit/library/__init__.py +14 -110
- qiskit/circuit/library/arithmetic/__init__.py +2 -9
- qiskit/circuit/library/arithmetic/adders/__init__.py +0 -1
- qiskit/circuit/library/arithmetic/adders/adder.py +2 -154
- qiskit/circuit/library/arithmetic/adders/cdkm_ripple_carry_adder.py +56 -20
- qiskit/circuit/library/arithmetic/adders/draper_qft_adder.py +1 -14
- qiskit/circuit/library/arithmetic/adders/vbe_ripple_carry_adder.py +91 -21
- qiskit/circuit/library/arithmetic/linear_pauli_rotations.py +1 -1
- qiskit/circuit/library/arithmetic/multipliers/__init__.py +0 -1
- qiskit/circuit/library/arithmetic/multipliers/hrs_cumulative_multiplier.py +1 -8
- qiskit/circuit/library/arithmetic/multipliers/multiplier.py +3 -94
- qiskit/circuit/library/arithmetic/multipliers/rg_qft_multiplier.py +1 -8
- qiskit/circuit/library/arithmetic/weighted_adder.py +1 -1
- qiskit/circuit/library/basis_change/qft.py +38 -20
- qiskit/circuit/library/blueprintcircuit.py +0 -64
- qiskit/circuit/library/boolean_logic/__init__.py +4 -4
- qiskit/circuit/library/boolean_logic/inner_product.py +4 -81
- qiskit/circuit/library/boolean_logic/quantum_and.py +4 -107
- qiskit/circuit/library/boolean_logic/quantum_or.py +3 -107
- qiskit/circuit/library/boolean_logic/quantum_xor.py +3 -97
- qiskit/circuit/library/data_preparation/__init__.py +3 -6
- qiskit/circuit/library/data_preparation/pauli_feature_map.py +29 -342
- qiskit/circuit/library/data_preparation/{_z_feature_map.py → z_feature_map.py} +34 -45
- qiskit/circuit/library/data_preparation/zz_feature_map.py +118 -0
- qiskit/circuit/library/fourier_checking.py +11 -72
- qiskit/circuit/library/generalized_gates/__init__.py +1 -1
- qiskit/circuit/library/generalized_gates/diagonal.py +51 -45
- qiskit/circuit/library/generalized_gates/gms.py +14 -67
- 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 +6 -12
- qiskit/circuit/library/generalized_gates/mcmt.py +107 -167
- qiskit/circuit/library/generalized_gates/permutation.py +6 -8
- qiskit/circuit/library/generalized_gates/rv.py +9 -8
- qiskit/circuit/library/graph_state.py +10 -93
- qiskit/circuit/library/grover_operator.py +2 -270
- qiskit/circuit/library/hidden_linear_function.py +20 -83
- qiskit/circuit/library/iqp.py +20 -99
- qiskit/circuit/library/n_local/__init__.py +7 -19
- qiskit/circuit/library/n_local/efficient_su2.py +5 -118
- qiskit/circuit/library/n_local/evolved_operator_ansatz.py +0 -259
- qiskit/circuit/library/n_local/excitation_preserving.py +6 -130
- qiskit/circuit/library/n_local/n_local.py +5 -406
- qiskit/circuit/library/n_local/pauli_two_design.py +4 -106
- qiskit/circuit/library/n_local/qaoa_ansatz.py +1 -80
- qiskit/circuit/library/n_local/real_amplitudes.py +7 -127
- qiskit/circuit/library/n_local/two_local.py +7 -14
- qiskit/circuit/library/overlap.py +26 -91
- qiskit/circuit/library/pauli_evolution.py +15 -17
- qiskit/circuit/library/phase_estimation.py +4 -80
- qiskit/circuit/library/quantum_volume.py +20 -72
- qiskit/circuit/library/standard_gates/__init__.py +1 -20
- qiskit/circuit/library/standard_gates/dcx.py +1 -2
- qiskit/circuit/library/standard_gates/ecr.py +2 -2
- qiskit/circuit/library/standard_gates/h.py +3 -4
- qiskit/circuit/library/standard_gates/i.py +1 -2
- qiskit/circuit/library/standard_gates/iswap.py +2 -2
- qiskit/circuit/library/standard_gates/p.py +12 -20
- qiskit/circuit/library/standard_gates/r.py +1 -1
- qiskit/circuit/library/standard_gates/rx.py +3 -4
- qiskit/circuit/library/standard_gates/rxx.py +2 -2
- qiskit/circuit/library/standard_gates/ry.py +3 -4
- qiskit/circuit/library/standard_gates/ryy.py +2 -2
- qiskit/circuit/library/standard_gates/rz.py +12 -13
- 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 +3 -4
- qiskit/circuit/library/standard_gates/t.py +2 -2
- qiskit/circuit/library/standard_gates/u.py +3 -11
- qiskit/circuit/library/standard_gates/u1.py +15 -65
- qiskit/circuit/library/standard_gates/u2.py +1 -4
- qiskit/circuit/library/standard_gates/u3.py +3 -31
- qiskit/circuit/library/standard_gates/x.py +5 -7
- 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 +3 -4
- qiskit/circuit/library/standard_gates/z.py +3 -3
- qiskit/circuit/library/templates/clifford/clifford_2_1.py +8 -9
- qiskit/circuit/library/templates/clifford/clifford_2_2.py +9 -10
- qiskit/circuit/library/templates/clifford/clifford_2_3.py +7 -9
- qiskit/circuit/library/templates/clifford/clifford_2_4.py +8 -9
- qiskit/circuit/library/templates/clifford/clifford_3_1.py +8 -9
- qiskit/circuit/library/templates/clifford/clifford_4_1.py +9 -10
- qiskit/circuit/library/templates/clifford/clifford_4_2.py +9 -10
- qiskit/circuit/library/templates/clifford/clifford_4_3.py +9 -10
- qiskit/circuit/library/templates/clifford/clifford_4_4.py +9 -10
- qiskit/circuit/library/templates/clifford/clifford_5_1.py +9 -10
- qiskit/circuit/library/templates/clifford/clifford_6_1.py +9 -10
- qiskit/circuit/library/templates/clifford/clifford_6_2.py +9 -10
- qiskit/circuit/library/templates/clifford/clifford_6_3.py +9 -10
- qiskit/circuit/library/templates/clifford/clifford_6_4.py +8 -9
- qiskit/circuit/library/templates/clifford/clifford_6_5.py +9 -10
- qiskit/circuit/library/templates/clifford/clifford_8_1.py +9 -10
- qiskit/circuit/library/templates/clifford/clifford_8_2.py +9 -10
- qiskit/circuit/library/templates/clifford/clifford_8_3.py +9 -10
- qiskit/circuit/library/templates/nct/template_nct_2a_1.py +7 -9
- qiskit/circuit/library/templates/nct/template_nct_2a_2.py +8 -10
- qiskit/circuit/library/templates/nct/template_nct_2a_3.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_4a_1.py +14 -16
- qiskit/circuit/library/templates/nct/template_nct_4a_2.py +12 -14
- qiskit/circuit/library/templates/nct/template_nct_4a_3.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_4b_1.py +12 -14
- qiskit/circuit/library/templates/nct/template_nct_4b_2.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_5a_1.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_5a_2.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_5a_3.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_5a_4.py +9 -11
- qiskit/circuit/library/templates/nct/template_nct_6a_1.py +9 -11
- qiskit/circuit/library/templates/nct/template_nct_6a_2.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_6a_3.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_6a_4.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_6b_1.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_6b_2.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_6c_1.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_7a_1.py +11 -13
- qiskit/circuit/library/templates/nct/template_nct_7b_1.py +11 -13
- qiskit/circuit/library/templates/nct/template_nct_7c_1.py +11 -13
- qiskit/circuit/library/templates/nct/template_nct_7d_1.py +11 -13
- qiskit/circuit/library/templates/nct/template_nct_7e_1.py +11 -13
- qiskit/circuit/library/templates/nct/template_nct_9a_1.py +11 -13
- qiskit/circuit/library/templates/nct/template_nct_9c_1.py +9 -11
- qiskit/circuit/library/templates/nct/template_nct_9c_10.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_9c_11.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_9c_12.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_9c_2.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_9c_3.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_9c_4.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_9c_5.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_9c_6.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_9c_7.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_9c_8.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_9c_9.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_9d_1.py +9 -11
- qiskit/circuit/library/templates/nct/template_nct_9d_10.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_9d_2.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_9d_3.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_9d_4.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_9d_5.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_9d_6.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_9d_7.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_9d_8.py +10 -12
- qiskit/circuit/library/templates/nct/template_nct_9d_9.py +10 -12
- qiskit/circuit/library/templates/rzx/rzx_cy.py +10 -11
- qiskit/circuit/library/templates/rzx/rzx_xz.py +15 -16
- qiskit/circuit/library/templates/rzx/rzx_yz.py +10 -12
- qiskit/circuit/library/templates/rzx/rzx_zz1.py +20 -22
- qiskit/circuit/library/templates/rzx/rzx_zz2.py +15 -16
- qiskit/circuit/library/templates/rzx/rzx_zz3.py +15 -17
- qiskit/circuit/parameter.py +0 -4
- qiskit/circuit/parameterexpression.py +34 -167
- qiskit/circuit/quantumcircuit.py +126 -162
- qiskit/circuit/singleton.py +0 -2
- qiskit/circuit/store.py +0 -2
- qiskit/compiler/assembler.py +4 -17
- qiskit/compiler/scheduler.py +0 -2
- qiskit/compiler/sequencer.py +0 -2
- qiskit/compiler/transpiler.py +26 -81
- 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 +5 -7
- qiskit/converters/dag_to_dagdependency.py +1 -1
- qiskit/converters/dag_to_dagdependency_v2.py +1 -1
- qiskit/converters/dagdependency_to_circuit.py +1 -5
- qiskit/converters/dagdependency_to_dag.py +1 -6
- qiskit/dagcircuit/collect_blocks.py +3 -3
- qiskit/dagcircuit/dagdependency.py +5 -18
- qiskit/dagcircuit/dagdependency_v2.py +1 -1
- qiskit/dagcircuit/dagnode.py +2 -2
- qiskit/passmanager/__init__.py +2 -2
- qiskit/primitives/backend_estimator.py +2 -5
- qiskit/primitives/backend_sampler_v2.py +18 -61
- qiskit/primitives/base/base_estimator.py +2 -2
- qiskit/primitives/containers/data_bin.py +1 -9
- qiskit/primitives/statevector_sampler.py +1 -1
- qiskit/primitives/utils.py +1 -1
- qiskit/providers/__init__.py +3 -3
- qiskit/providers/backend.py +1 -12
- qiskit/providers/backend_compat.py +3 -23
- qiskit/providers/basic_provider/basic_simulator.py +2 -12
- qiskit/providers/fake_provider/fake_pulse_backend.py +1 -6
- qiskit/providers/fake_provider/generic_backend_v2.py +30 -46
- qiskit/providers/models/pulsedefaults.py +0 -2
- qiskit/pulse/builder.py +18 -59
- qiskit/pulse/calibration_entries.py +1 -4
- qiskit/pulse/channels.py +0 -2
- qiskit/pulse/exceptions.py +0 -2
- qiskit/pulse/instruction_schedule_map.py +6 -21
- qiskit/pulse/instructions/acquire.py +0 -2
- qiskit/pulse/instructions/delay.py +0 -2
- qiskit/pulse/instructions/directives.py +0 -8
- qiskit/pulse/instructions/frequency.py +0 -3
- qiskit/pulse/instructions/instruction.py +0 -2
- qiskit/pulse/instructions/phase.py +0 -3
- qiskit/pulse/instructions/play.py +0 -2
- qiskit/pulse/instructions/reference.py +0 -2
- qiskit/pulse/instructions/snapshot.py +0 -2
- qiskit/pulse/library/pulse.py +0 -2
- qiskit/pulse/library/symbolic_pulses.py +0 -28
- qiskit/pulse/library/waveform.py +0 -2
- qiskit/pulse/macros.py +1 -1
- qiskit/pulse/schedule.py +13 -12
- qiskit/pulse/transforms/alignments.py +3 -5
- qiskit/pulse/transforms/dag.py +0 -7
- qiskit/qasm2/export.py +3 -5
- qiskit/qasm2/parse.py +2 -46
- qiskit/qasm3/__init__.py +0 -1
- qiskit/qasm3/ast.py +15 -123
- qiskit/qasm3/exporter.py +77 -103
- qiskit/qobj/converters/pulse_instruction.py +4 -6
- qiskit/qpy/__init__.py +0 -181
- qiskit/qpy/binary_io/circuits.py +5 -20
- qiskit/qpy/binary_io/schedules.py +4 -3
- qiskit/qpy/binary_io/value.py +13 -310
- qiskit/qpy/common.py +2 -46
- qiskit/qpy/formats.py +0 -7
- qiskit/qpy/interface.py +4 -40
- qiskit/quantum_info/__init__.py +0 -4
- qiskit/quantum_info/operators/channel/transformations.py +21 -28
- qiskit/quantum_info/operators/dihedral/dihedral.py +1 -1
- qiskit/quantum_info/operators/operator.py +8 -54
- qiskit/quantum_info/operators/symplectic/base_pauli.py +19 -11
- 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 +0 -2
- qiskit/quantum_info/operators/symplectic/pauli_list.py +4 -4
- qiskit/quantum_info/operators/symplectic/sparse_pauli_op.py +2 -23
- 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 +1 -9
- qiskit/result/mitigation/local_readout_mitigator.py +1 -9
- qiskit/result/mitigation/utils.py +0 -57
- qiskit/scheduler/config.py +0 -2
- qiskit/scheduler/methods/basic.py +0 -3
- qiskit/scheduler/schedule_circuit.py +0 -2
- qiskit/scheduler/sequence.py +0 -2
- qiskit/synthesis/__init__.py +0 -25
- qiskit/synthesis/clifford/clifford_decompose_bm.py +2 -1
- qiskit/synthesis/clifford/clifford_decompose_greedy.py +2 -3
- qiskit/synthesis/clifford/clifford_decompose_layers.py +1 -2
- qiskit/synthesis/evolution/__init__.py +0 -1
- qiskit/synthesis/evolution/lie_trotter.py +42 -16
- qiskit/synthesis/evolution/product_formula.py +238 -165
- qiskit/synthesis/evolution/qdrift.py +29 -36
- qiskit/synthesis/evolution/suzuki_trotter.py +27 -87
- qiskit/synthesis/multi_controlled/__init__.py +0 -1
- qiskit/synthesis/qft/qft_decompose_full.py +1 -19
- qiskit/synthesis/qft/qft_decompose_lnn.py +1 -2
- qiskit/synthesis/stabilizer/stabilizer_decompose.py +1 -2
- qiskit/synthesis/two_qubit/two_qubit_decompose.py +63 -4
- qiskit/synthesis/two_qubit/weyl.py +97 -0
- qiskit/synthesis/unitary/qsd.py +5 -5
- qiskit/transpiler/__init__.py +14 -21
- qiskit/transpiler/basepasses.py +1 -1
- qiskit/transpiler/passes/__init__.py +0 -2
- qiskit/transpiler/passes/basis/basis_translator.py +565 -9
- qiskit/transpiler/passes/basis/decompose.py +12 -45
- 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 +2 -4
- qiskit/transpiler/passes/calibration/rx_builder.py +7 -11
- qiskit/transpiler/passes/calibration/rzx_builder.py +30 -46
- qiskit/transpiler/passes/layout/disjoint_utils.py +13 -15
- qiskit/transpiler/passes/layout/sabre_layout.py +2 -7
- qiskit/transpiler/passes/layout/sabre_pre_layout.py +0 -5
- qiskit/transpiler/passes/optimization/__init__.py +0 -1
- qiskit/transpiler/passes/optimization/collect_cliffords.py +3 -19
- 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 +131 -48
- qiskit/transpiler/passes/optimization/echo_rzx_weyl_decomposition.py +2 -4
- qiskit/transpiler/passes/optimization/elide_permutations.py +32 -9
- qiskit/transpiler/passes/optimization/inverse_cancellation.py +0 -2
- qiskit/transpiler/passes/optimization/optimize_1q_decomposition.py +11 -5
- 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/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 +3 -7
- 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 +0 -2
- qiskit/transpiler/passes/scheduling/alignments/reschedule.py +2 -2
- qiskit/transpiler/passes/scheduling/asap.py +1 -1
- qiskit/transpiler/passes/scheduling/base_scheduler.py +12 -14
- qiskit/transpiler/passes/scheduling/dynamical_decoupling.py +4 -9
- qiskit/transpiler/passes/scheduling/padding/base_padding.py +1 -1
- qiskit/transpiler/passes/scheduling/padding/dynamical_decoupling.py +5 -16
- qiskit/transpiler/passes/scheduling/padding/pad_delay.py +1 -4
- qiskit/transpiler/passes/scheduling/scheduling/base_scheduler.py +2 -6
- qiskit/transpiler/passes/scheduling/time_unit_conversion.py +4 -9
- qiskit/transpiler/passes/synthesis/high_level_synthesis.py +99 -262
- qiskit/transpiler/passes/synthesis/hls_plugins.py +7 -638
- qiskit/transpiler/passes/synthesis/qubit_tracker.py +132 -0
- qiskit/transpiler/passes/synthesis/solovay_kitaev_synthesis.py +3 -3
- qiskit/transpiler/passes/synthesis/unitary_synthesis.py +34 -55
- qiskit/transpiler/passes/utils/barrier_before_final_measurements.py +56 -2
- qiskit/transpiler/passes/utils/convert_conditions_to_if_ops.py +0 -5
- qiskit/transpiler/passes/utils/gate_direction.py +275 -12
- qiskit/transpiler/passes/utils/gates_basis.py +30 -7
- qiskit/transpiler/passes/utils/merge_adjacent_barriers.py +1 -2
- qiskit/transpiler/passmanager_config.py +4 -22
- qiskit/transpiler/preset_passmanagers/builtin_plugins.py +14 -40
- qiskit/transpiler/preset_passmanagers/common.py +3 -5
- qiskit/transpiler/preset_passmanagers/generate_preset_pass_manager.py +42 -125
- qiskit/transpiler/preset_passmanagers/plugin.py +1 -1
- qiskit/transpiler/target.py +16 -74
- qiskit/visualization/circuit/_utils.py +2 -2
- qiskit/visualization/circuit/circuit_visualization.py +2 -3
- qiskit/visualization/circuit/matplotlib.py +1 -1
- qiskit/visualization/dag_visualization.py +1 -1
- qiskit/visualization/pass_manager_visualization.py +14 -3
- qiskit/visualization/pulse_v2/interface.py +1 -3
- qiskit/visualization/timeline/core.py +2 -25
- qiskit/visualization/timeline/interface.py +0 -12
- {qiskit-1.3.0.dist-info → qiskit-1.3.0b1.dist-info}/METADATA +19 -20
- {qiskit-1.3.0.dist-info → qiskit-1.3.0b1.dist-info}/RECORD +347 -358
- {qiskit-1.3.0.dist-info → qiskit-1.3.0b1.dist-info}/WHEEL +1 -1
- {qiskit-1.3.0.dist-info → qiskit-1.3.0b1.dist-info}/entry_points.txt +0 -19
- qiskit/circuit/library/data_preparation/_zz_feature_map.py +0 -150
- qiskit/circuit/twirling.py +0 -145
- qiskit/synthesis/arithmetic/__init__.py +0 -16
- qiskit/synthesis/arithmetic/adders/__init__.py +0 -17
- qiskit/synthesis/arithmetic/adders/cdkm_ripple_carry_adder.py +0 -154
- qiskit/synthesis/arithmetic/adders/draper_qft_adder.py +0 -103
- qiskit/synthesis/arithmetic/adders/vbe_ripple_carry_adder.py +0 -161
- qiskit/synthesis/arithmetic/multipliers/__init__.py +0 -16
- qiskit/synthesis/arithmetic/multipliers/hrs_cumulative_multiplier.py +0 -102
- qiskit/synthesis/arithmetic/multipliers/rg_qft_multiplier.py +0 -99
- qiskit/synthesis/evolution/pauli_network.py +0 -80
- qiskit/synthesis/multi_controlled/mcmt_vchain.py +0 -52
- qiskit/transpiler/passes/optimization/remove_identity_equiv.py +0 -69
- qiskit/utils/deprecate_pulse.py +0 -119
- {qiskit-1.3.0.dist-info → qiskit-1.3.0b1.dist-info}/LICENSE.txt +0 -0
- {qiskit-1.3.0.dist-info → qiskit-1.3.0b1.dist-info}/top_level.txt +0 -0
@@ -214,202 +214,13 @@ not sufficient, the corresponding synthesis method will return `None`.
|
|
214
214
|
MCXSynthesisNDirtyI15
|
215
215
|
MCXSynthesis1CleanB95
|
216
216
|
MCXSynthesisDefault
|
217
|
-
|
218
|
-
|
219
|
-
MCMT Synthesis
|
220
|
-
''''''''''''''
|
221
|
-
|
222
|
-
.. list-table:: Plugins for :class:`.MCMTGate` (key = ``"mcmt"``)
|
223
|
-
:header-rows: 1
|
224
|
-
|
225
|
-
* - Plugin name
|
226
|
-
- Plugin class
|
227
|
-
- Number of clean ancillas
|
228
|
-
- Number of dirty ancillas
|
229
|
-
- Description
|
230
|
-
* - ``"vchain"``
|
231
|
-
- :class:`.MCMTSynthesisVChain`
|
232
|
-
- `k-1`
|
233
|
-
- `0`
|
234
|
-
- uses a linear number of Toffoli gates
|
235
|
-
* - ``"noaux"``
|
236
|
-
- :class:`~.MCMTSynthesisNoAux`
|
237
|
-
- `0`
|
238
|
-
- `0`
|
239
|
-
- uses Qiskit's standard control mechanism
|
240
|
-
* - ``"default"``
|
241
|
-
- :class:`~.MCMTSynthesisDefault`
|
242
|
-
- any
|
243
|
-
- any
|
244
|
-
- chooses the best algorithm based on the ancillas available
|
245
|
-
|
246
|
-
.. autosummary::
|
247
|
-
:toctree: ../stubs/
|
248
|
-
|
249
|
-
MCMTSynthesisVChain
|
250
|
-
MCMTSynthesisNoAux
|
251
|
-
MCMTSynthesisDefault
|
252
|
-
|
253
|
-
|
254
|
-
Pauli Evolution Synthesis
|
255
|
-
'''''''''''''''''''''''''
|
256
|
-
|
257
|
-
.. list-table:: Plugins for :class:`.PauliEvolutionGate` (key = ``"PauliEvolution"``)
|
258
|
-
:header-rows: 1
|
259
|
-
|
260
|
-
* - Plugin name
|
261
|
-
- Plugin class
|
262
|
-
- Description
|
263
|
-
- Targeted connectivity
|
264
|
-
* - ``"rustiq"``
|
265
|
-
- :class:`~.PauliEvolutionSynthesisRustiq`
|
266
|
-
- use the synthesis method from `Rustiq circuit synthesis library
|
267
|
-
<https://github.com/smartiel/rustiq-core>`_
|
268
|
-
- all-to-all
|
269
|
-
* - ``"default"``
|
270
|
-
- :class:`~.PauliEvolutionSynthesisDefault`
|
271
|
-
- use a diagonalizing Clifford per Pauli term
|
272
|
-
- all-to-all
|
273
|
-
|
274
|
-
.. autosummary::
|
275
|
-
:toctree: ../stubs/
|
276
|
-
|
277
|
-
PauliEvolutionSynthesisDefault
|
278
|
-
PauliEvolutionSynthesisRustiq
|
279
|
-
|
280
|
-
|
281
|
-
Modular Adder Synthesis
|
282
|
-
'''''''''''''''''''''''
|
283
|
-
|
284
|
-
.. list-table:: Plugins for :class:`.ModularAdderGate` (key = ``"ModularAdder"``)
|
285
|
-
:header-rows: 1
|
286
|
-
|
287
|
-
* - Plugin name
|
288
|
-
- Plugin class
|
289
|
-
- Number of clean ancillas
|
290
|
-
- Description
|
291
|
-
* - ``"ripple_cdkm"``
|
292
|
-
- :class:`.ModularAdderSynthesisC04`
|
293
|
-
- 1
|
294
|
-
- a ripple-carry adder
|
295
|
-
* - ``"ripple_vbe"``
|
296
|
-
- :class:`.ModularAdderSynthesisV95`
|
297
|
-
- :math:`n-1`, for :math:`n`-bit numbers
|
298
|
-
- a ripple-carry adder
|
299
|
-
* - ``"qft"``
|
300
|
-
- :class:`.ModularAdderSynthesisD00`
|
301
|
-
- 0
|
302
|
-
- a QFT-based adder
|
303
|
-
|
304
|
-
.. autosummary::
|
305
|
-
:toctree: ../stubs/
|
306
|
-
|
307
|
-
ModularAdderSynthesisC04
|
308
|
-
ModularAdderSynthesisD00
|
309
|
-
ModularAdderSynthesisV95
|
310
|
-
|
311
|
-
Half Adder Synthesis
|
312
|
-
''''''''''''''''''''
|
313
|
-
|
314
|
-
.. list-table:: Plugins for :class:`.HalfAdderGate` (key = ``"HalfAdder"``)
|
315
|
-
:header-rows: 1
|
316
|
-
|
317
|
-
* - Plugin name
|
318
|
-
- Plugin class
|
319
|
-
- Number of clean ancillas
|
320
|
-
- Description
|
321
|
-
* - ``"ripple_cdkm"``
|
322
|
-
- :class:`.HalfAdderSynthesisC04`
|
323
|
-
- 1
|
324
|
-
- a ripple-carry adder
|
325
|
-
* - ``"ripple_vbe"``
|
326
|
-
- :class:`.HalfAdderSynthesisV95`
|
327
|
-
- :math:`n-1`, for :math:`n`-bit numbers
|
328
|
-
- a ripple-carry adder
|
329
|
-
* - ``"qft"``
|
330
|
-
- :class:`.HalfAdderSynthesisD00`
|
331
|
-
- 0
|
332
|
-
- a QFT-based adder
|
333
|
-
|
334
|
-
.. autosummary::
|
335
|
-
:toctree: ../stubs/
|
336
|
-
|
337
|
-
HalfAdderSynthesisC04
|
338
|
-
HalfAdderSynthesisD00
|
339
|
-
HalfAdderSynthesisV95
|
340
|
-
|
341
|
-
Full Adder Synthesis
|
342
|
-
''''''''''''''''''''
|
343
|
-
|
344
|
-
.. list-table:: Plugins for :class:`.FullAdderGate` (key = ``"FullAdder"``)
|
345
|
-
:header-rows: 1
|
346
|
-
|
347
|
-
* - Plugin name
|
348
|
-
- Plugin class
|
349
|
-
- Number of clean ancillas
|
350
|
-
- Description
|
351
|
-
* - ``"ripple_cdkm"``
|
352
|
-
- :class:`.FullAdderSynthesisC04`
|
353
|
-
- 0
|
354
|
-
- a ripple-carry adder
|
355
|
-
* - ``"ripple_vbe"``
|
356
|
-
- :class:`.FullAdderSynthesisV95`
|
357
|
-
- :math:`n-1`, for :math:`n`-bit numbers
|
358
|
-
- a ripple-carry adder
|
359
|
-
|
360
|
-
.. autosummary::
|
361
|
-
:toctree: ../stubs/
|
362
|
-
|
363
|
-
FullAdderSynthesisC04
|
364
|
-
FullAdderSynthesisV95
|
365
|
-
|
366
|
-
|
367
|
-
Multiplier Synthesis
|
368
|
-
''''''''''''''''''''
|
369
|
-
|
370
|
-
.. list-table:: Plugins for :class:`.MultiplierGate` (key = ``"Multiplier"``)
|
371
|
-
:header-rows: 1
|
372
|
-
|
373
|
-
* - Plugin name
|
374
|
-
- Plugin class
|
375
|
-
- Number of clean ancillas
|
376
|
-
- Description
|
377
|
-
* - ``"cumulative"``
|
378
|
-
- :class:`.MultiplierSynthesisH18`
|
379
|
-
- depending on the :class:`.HalfAdderGate` used
|
380
|
-
- a cumulative adder based on controlled adders
|
381
|
-
* - ``"qft"``
|
382
|
-
- :class:`.MultiplierSynthesisR17`
|
383
|
-
- 0
|
384
|
-
- a QFT-based multiplier
|
385
|
-
|
386
|
-
.. autosummary::
|
387
|
-
:toctree: ../stubs/
|
388
|
-
|
389
|
-
MultiplierSynthesisH18
|
390
|
-
MultiplierSynthesisR17
|
391
|
-
|
392
217
|
"""
|
393
218
|
|
394
|
-
from __future__ import annotations
|
395
|
-
|
396
|
-
import warnings
|
397
219
|
import numpy as np
|
398
220
|
import rustworkx as rx
|
399
221
|
|
400
222
|
from qiskit.circuit.quantumcircuit import QuantumCircuit
|
401
|
-
from qiskit.circuit.library import
|
402
|
-
LinearFunction,
|
403
|
-
QFTGate,
|
404
|
-
MCXGate,
|
405
|
-
C3XGate,
|
406
|
-
C4XGate,
|
407
|
-
PauliEvolutionGate,
|
408
|
-
ModularAdderGate,
|
409
|
-
HalfAdderGate,
|
410
|
-
FullAdderGate,
|
411
|
-
MultiplierGate,
|
412
|
-
)
|
223
|
+
from qiskit.circuit.library import LinearFunction, QFTGate, MCXGate, C3XGate, C4XGate
|
413
224
|
from qiskit.transpiler.exceptions import TranspilerError
|
414
225
|
from qiskit.transpiler.coupling import CouplingMap
|
415
226
|
|
@@ -442,15 +253,6 @@ from qiskit.synthesis.multi_controlled import (
|
|
442
253
|
synth_mcx_1_clean_b95,
|
443
254
|
synth_mcx_gray_code,
|
444
255
|
synth_mcx_noaux_v24,
|
445
|
-
synth_mcmt_vchain,
|
446
|
-
)
|
447
|
-
from qiskit.synthesis.evolution import ProductFormula, synth_pauli_network_rustiq
|
448
|
-
from qiskit.synthesis.arithmetic import (
|
449
|
-
adder_ripple_c04,
|
450
|
-
adder_qft_d00,
|
451
|
-
adder_ripple_v95,
|
452
|
-
multiplier_qft_r17,
|
453
|
-
multiplier_cumulative_h18,
|
454
256
|
)
|
455
257
|
from qiskit.transpiler.passes.routing.algorithms import ApproximateTokenSwapper
|
456
258
|
from .plugin import HighLevelSynthesisPlugin
|
@@ -703,10 +505,6 @@ class QFTSynthesisFull(HighLevelSynthesisPlugin):
|
|
703
505
|
This plugin name is :``qft.full`` which can be used as the key on
|
704
506
|
an :class:`~.HLSConfig` object to use this method with :class:`~.HighLevelSynthesis`.
|
705
507
|
|
706
|
-
Note that the plugin mechanism is not applied if the gate is called ``qft`` but
|
707
|
-
is not an instance of ``QFTGate``. This allows users to create custom gates with
|
708
|
-
name ``qft``.
|
709
|
-
|
710
508
|
The plugin supports the following additional options:
|
711
509
|
|
712
510
|
* reverse_qubits (bool): Whether to synthesize the "QFT" operation (if ``False``,
|
@@ -734,11 +532,10 @@ class QFTSynthesisFull(HighLevelSynthesisPlugin):
|
|
734
532
|
|
735
533
|
def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
|
736
534
|
"""Run synthesis for the given QFTGate."""
|
737
|
-
|
738
|
-
# Even though the gate is called "qft", it's not a QFTGate,
|
739
|
-
# and we should not synthesize it using the plugin.
|
740
535
|
if not isinstance(high_level_object, QFTGate):
|
741
|
-
|
536
|
+
raise TranspilerError(
|
537
|
+
"The synthesis plugin 'qft.full` only applies to objects of type QFTGate."
|
538
|
+
)
|
742
539
|
|
743
540
|
reverse_qubits = options.get("reverse_qubits", False)
|
744
541
|
approximation_degree = options.get("approximation_degree", 0)
|
@@ -763,10 +560,6 @@ class QFTSynthesisLine(HighLevelSynthesisPlugin):
|
|
763
560
|
This plugin name is :``qft.line`` which can be used as the key on
|
764
561
|
an :class:`~.HLSConfig` object to use this method with :class:`~.HighLevelSynthesis`.
|
765
562
|
|
766
|
-
Note that the plugin mechanism is not applied if the gate is called ``qft`` but
|
767
|
-
is not an instance of ``QFTGate``. This allows users to create custom gates with
|
768
|
-
name ``qft``.
|
769
|
-
|
770
563
|
The plugin supports the following additional options:
|
771
564
|
|
772
565
|
* reverse_qubits (bool): Whether to synthesize the "QFT" operation (if ``False``,
|
@@ -791,11 +584,10 @@ class QFTSynthesisLine(HighLevelSynthesisPlugin):
|
|
791
584
|
|
792
585
|
def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
|
793
586
|
"""Run synthesis for the given QFTGate."""
|
794
|
-
|
795
|
-
# Even though the gate is called "qft", it's not a QFTGate,
|
796
|
-
# and we should not synthesize it using the plugin.
|
797
587
|
if not isinstance(high_level_object, QFTGate):
|
798
|
-
|
588
|
+
raise TranspilerError(
|
589
|
+
"The synthesis plugin 'qft.line` only applies to objects of type QFTGate."
|
590
|
+
)
|
799
591
|
|
800
592
|
reverse_qubits = options.get("reverse_qubits", False)
|
801
593
|
approximation_degree = options.get("approximation_degree", 0)
|
@@ -1134,426 +926,3 @@ class MCXSynthesisDefault(HighLevelSynthesisPlugin):
|
|
1134
926
|
return MCXSynthesisNoAuxV24().run(
|
1135
927
|
high_level_object, coupling_map, target, qubits, **options
|
1136
928
|
)
|
1137
|
-
|
1138
|
-
|
1139
|
-
class MCMTSynthesisDefault(HighLevelSynthesisPlugin):
|
1140
|
-
"""A default decomposition for MCMT gates."""
|
1141
|
-
|
1142
|
-
def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
|
1143
|
-
# first try to use the V-chain synthesis if enough auxiliary qubits are available
|
1144
|
-
if (
|
1145
|
-
decomposition := MCMTSynthesisVChain().run(
|
1146
|
-
high_level_object, coupling_map, target, qubits, **options
|
1147
|
-
)
|
1148
|
-
) is not None:
|
1149
|
-
return decomposition
|
1150
|
-
|
1151
|
-
return MCMTSynthesisNoAux().run(high_level_object, coupling_map, target, qubits, **options)
|
1152
|
-
|
1153
|
-
|
1154
|
-
class MCMTSynthesisNoAux(HighLevelSynthesisPlugin):
|
1155
|
-
"""A V-chain based synthesis for ``MCMTGate``."""
|
1156
|
-
|
1157
|
-
def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
|
1158
|
-
base_gate = high_level_object.base_gate
|
1159
|
-
ctrl_state = options.get("ctrl_state", None)
|
1160
|
-
|
1161
|
-
if high_level_object.num_target_qubits == 1:
|
1162
|
-
# no broadcasting needed (makes for better circuit diagrams)
|
1163
|
-
circuit = QuantumCircuit(high_level_object.num_qubits)
|
1164
|
-
circuit.append(
|
1165
|
-
base_gate.control(high_level_object.num_ctrl_qubits, ctrl_state=ctrl_state),
|
1166
|
-
circuit.qubits,
|
1167
|
-
)
|
1168
|
-
|
1169
|
-
else:
|
1170
|
-
base = QuantumCircuit(high_level_object.num_target_qubits, name=high_level_object.label)
|
1171
|
-
for i in range(high_level_object.num_target_qubits):
|
1172
|
-
base.append(base_gate, [i], [])
|
1173
|
-
|
1174
|
-
circuit = base.control(high_level_object.num_ctrl_qubits, ctrl_state=ctrl_state)
|
1175
|
-
|
1176
|
-
return circuit.decompose()
|
1177
|
-
|
1178
|
-
|
1179
|
-
class MCMTSynthesisVChain(HighLevelSynthesisPlugin):
|
1180
|
-
"""A V-chain based synthesis for ``MCMTGate``."""
|
1181
|
-
|
1182
|
-
def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
|
1183
|
-
if options.get("num_clean_ancillas", 0) < high_level_object.num_ctrl_qubits - 1:
|
1184
|
-
return None # insufficient number of auxiliary qubits
|
1185
|
-
|
1186
|
-
ctrl_state = options.get("ctrl_state", None)
|
1187
|
-
|
1188
|
-
return synth_mcmt_vchain(
|
1189
|
-
high_level_object.base_gate,
|
1190
|
-
high_level_object.num_ctrl_qubits,
|
1191
|
-
high_level_object.num_target_qubits,
|
1192
|
-
ctrl_state,
|
1193
|
-
)
|
1194
|
-
|
1195
|
-
|
1196
|
-
class ModularAdderSynthesisDefault(HighLevelSynthesisPlugin):
|
1197
|
-
"""The default modular adder (no carry in, no carry out qubit) synthesis.
|
1198
|
-
|
1199
|
-
This plugin name is:``ModularAdder.default`` which can be used as the key on
|
1200
|
-
an :class:`~.HLSConfig` object to use this method with :class:`~.HighLevelSynthesis`.
|
1201
|
-
|
1202
|
-
If at least one clean auxiliary qubit is available, the :class:`ModularAdderSynthesisC04`
|
1203
|
-
is used, otherwise :class:`ModularAdderSynthesisD00`.
|
1204
|
-
|
1205
|
-
The plugin supports the following plugin-specific options:
|
1206
|
-
|
1207
|
-
* ``num_clean_ancillas``: The number of clean auxiliary qubits available.
|
1208
|
-
|
1209
|
-
"""
|
1210
|
-
|
1211
|
-
def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
|
1212
|
-
if not isinstance(high_level_object, ModularAdderGate):
|
1213
|
-
return None
|
1214
|
-
|
1215
|
-
if options.get("num_clean_ancillas", 0) >= 1:
|
1216
|
-
return adder_ripple_c04(high_level_object.num_state_qubits, kind="fixed")
|
1217
|
-
|
1218
|
-
return adder_qft_d00(high_level_object.num_state_qubits, kind="fixed")
|
1219
|
-
|
1220
|
-
|
1221
|
-
class ModularAdderSynthesisC04(HighLevelSynthesisPlugin):
|
1222
|
-
r"""A ripple-carry adder, modulo :math:`2^n`.
|
1223
|
-
|
1224
|
-
This plugin name is:``ModularAdder.ripple_c04`` which can be used as the key on
|
1225
|
-
an :class:`~.HLSConfig` object to use this method with :class:`~.HighLevelSynthesis`.
|
1226
|
-
|
1227
|
-
This plugin requires at least one clean auxiliary qubit.
|
1228
|
-
|
1229
|
-
The plugin supports the following plugin-specific options:
|
1230
|
-
|
1231
|
-
* ``num_clean_ancillas``: The number of clean auxiliary qubits available.
|
1232
|
-
|
1233
|
-
"""
|
1234
|
-
|
1235
|
-
def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
|
1236
|
-
if not isinstance(high_level_object, ModularAdderGate):
|
1237
|
-
return None
|
1238
|
-
|
1239
|
-
# unless we implement the full adder, this implementation needs an ancilla qubit
|
1240
|
-
if options.get("num_clean_ancillas", 0) < 1:
|
1241
|
-
return None
|
1242
|
-
|
1243
|
-
return adder_ripple_c04(high_level_object.num_state_qubits, kind="fixed")
|
1244
|
-
|
1245
|
-
|
1246
|
-
class ModularAdderSynthesisV95(HighLevelSynthesisPlugin):
|
1247
|
-
r"""A ripple-carry adder, modulo :math:`2^n`.
|
1248
|
-
|
1249
|
-
This plugin name is:``ModularAdder.ripple_v95`` which can be used as the key on
|
1250
|
-
an :class:`~.HLSConfig` object to use this method with :class:`~.HighLevelSynthesis`.
|
1251
|
-
|
1252
|
-
For an adder on 2 registers with :math:`n` qubits each, this plugin requires at
|
1253
|
-
least :math:`n-1` clean auxiliary qubit.
|
1254
|
-
|
1255
|
-
The plugin supports the following plugin-specific options:
|
1256
|
-
|
1257
|
-
* ``num_clean_ancillas``: The number of clean auxiliary qubits available.
|
1258
|
-
|
1259
|
-
"""
|
1260
|
-
|
1261
|
-
def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
|
1262
|
-
if not isinstance(high_level_object, ModularAdderGate):
|
1263
|
-
return None
|
1264
|
-
|
1265
|
-
num_state_qubits = high_level_object.num_state_qubits
|
1266
|
-
|
1267
|
-
# for more than 1 state qubit, we need an ancilla
|
1268
|
-
if num_state_qubits > 1 > options.get("num_clean_ancillas", 1):
|
1269
|
-
return None
|
1270
|
-
|
1271
|
-
return adder_ripple_v95(num_state_qubits, kind="fixed")
|
1272
|
-
|
1273
|
-
|
1274
|
-
class ModularAdderSynthesisD00(HighLevelSynthesisPlugin):
|
1275
|
-
r"""A QFT-based adder, modulo :math:`2^n`.
|
1276
|
-
|
1277
|
-
This plugin name is:``ModularAdder.qft_d00`` which can be used as the key on
|
1278
|
-
an :class:`~.HLSConfig` object to use this method with :class:`~.HighLevelSynthesis`.
|
1279
|
-
"""
|
1280
|
-
|
1281
|
-
def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
|
1282
|
-
if not isinstance(high_level_object, ModularAdderGate):
|
1283
|
-
return None
|
1284
|
-
|
1285
|
-
return adder_qft_d00(high_level_object.num_state_qubits, kind="fixed")
|
1286
|
-
|
1287
|
-
|
1288
|
-
class HalfAdderSynthesisDefault(HighLevelSynthesisPlugin):
|
1289
|
-
r"""The default half-adder (no carry in, but a carry out qubit) synthesis.
|
1290
|
-
|
1291
|
-
If we have an auxiliary qubit available, the Cuccaro ripple-carry adder uses
|
1292
|
-
:math:`O(n)` CX gates and 1 auxiliary qubit, whereas the Vedral ripple-carry uses more CX
|
1293
|
-
and :math:`n-1` auxiliary qubits. The QFT-based adder uses no auxiliary qubits, but
|
1294
|
-
:math:`O(n^2)`, hence it is only used if no auxiliary qubits are available.
|
1295
|
-
|
1296
|
-
This plugin name is:``HalfAdder.default`` which can be used as the key on
|
1297
|
-
an :class:`~.HLSConfig` object to use this method with :class:`~.HighLevelSynthesis`.
|
1298
|
-
|
1299
|
-
If at least one clean auxiliary qubit is available, the :class:`HalfAdderSynthesisC04`
|
1300
|
-
is used, otherwise :class:`HalfAdderSynthesisD00`.
|
1301
|
-
|
1302
|
-
The plugin supports the following plugin-specific options:
|
1303
|
-
|
1304
|
-
* ``num_clean_ancillas``: The number of clean auxiliary qubits available.
|
1305
|
-
|
1306
|
-
"""
|
1307
|
-
|
1308
|
-
def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
|
1309
|
-
if not isinstance(high_level_object, HalfAdderGate):
|
1310
|
-
return None
|
1311
|
-
|
1312
|
-
if options.get("num_clean_ancillas", 0) >= 1:
|
1313
|
-
return adder_ripple_c04(high_level_object.num_state_qubits, kind="half")
|
1314
|
-
|
1315
|
-
return adder_qft_d00(high_level_object.num_state_qubits, kind="half")
|
1316
|
-
|
1317
|
-
|
1318
|
-
class HalfAdderSynthesisC04(HighLevelSynthesisPlugin):
|
1319
|
-
"""A ripple-carry adder with a carry-out bit.
|
1320
|
-
|
1321
|
-
This plugin name is:``HalfAdder.ripple_c04`` which can be used as the key on
|
1322
|
-
an :class:`~.HLSConfig` object to use this method with :class:`~.HighLevelSynthesis`.
|
1323
|
-
|
1324
|
-
This plugin requires at least one clean auxiliary qubit.
|
1325
|
-
|
1326
|
-
The plugin supports the following plugin-specific options:
|
1327
|
-
|
1328
|
-
* ``num_clean_ancillas``: The number of clean auxiliary qubits available.
|
1329
|
-
|
1330
|
-
"""
|
1331
|
-
|
1332
|
-
def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
|
1333
|
-
if not isinstance(high_level_object, HalfAdderGate):
|
1334
|
-
return None
|
1335
|
-
|
1336
|
-
# unless we implement the full adder, this implementation needs an ancilla qubit
|
1337
|
-
if options.get("num_clean_ancillas", 0) < 1:
|
1338
|
-
return None
|
1339
|
-
|
1340
|
-
return adder_ripple_c04(high_level_object.num_state_qubits, kind="half")
|
1341
|
-
|
1342
|
-
|
1343
|
-
class HalfAdderSynthesisV95(HighLevelSynthesisPlugin):
|
1344
|
-
"""A ripple-carry adder with a carry-out bit.
|
1345
|
-
|
1346
|
-
This plugin name is:``HalfAdder.ripple_v95`` which can be used as the key on
|
1347
|
-
an :class:`~.HLSConfig` object to use this method with :class:`~.HighLevelSynthesis`.
|
1348
|
-
|
1349
|
-
For an adder on 2 registers with :math:`n` qubits each, this plugin requires at
|
1350
|
-
least :math:`n-1` clean auxiliary qubit.
|
1351
|
-
|
1352
|
-
The plugin supports the following plugin-specific options:
|
1353
|
-
|
1354
|
-
* ``num_clean_ancillas``: The number of clean auxiliary qubits available.
|
1355
|
-
"""
|
1356
|
-
|
1357
|
-
def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
|
1358
|
-
if not isinstance(high_level_object, HalfAdderGate):
|
1359
|
-
return None
|
1360
|
-
|
1361
|
-
num_state_qubits = high_level_object.num_state_qubits
|
1362
|
-
|
1363
|
-
# for more than 1 state qubit, we need an ancilla
|
1364
|
-
if num_state_qubits > 1 > options.get("num_clean_ancillas", 1):
|
1365
|
-
return None
|
1366
|
-
|
1367
|
-
return adder_ripple_v95(num_state_qubits, kind="half")
|
1368
|
-
|
1369
|
-
|
1370
|
-
class HalfAdderSynthesisD00(HighLevelSynthesisPlugin):
|
1371
|
-
"""A QFT-based adder with a carry-in and a carry-out bit.
|
1372
|
-
|
1373
|
-
This plugin name is:``HalfAdder.qft_d00`` which can be used as the key on
|
1374
|
-
an :class:`~.HLSConfig` object to use this method with :class:`~.HighLevelSynthesis`.
|
1375
|
-
"""
|
1376
|
-
|
1377
|
-
def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
|
1378
|
-
if not isinstance(high_level_object, HalfAdderGate):
|
1379
|
-
return None
|
1380
|
-
|
1381
|
-
return adder_qft_d00(high_level_object.num_state_qubits, kind="half")
|
1382
|
-
|
1383
|
-
|
1384
|
-
class FullAdderSynthesisC04(HighLevelSynthesisPlugin):
|
1385
|
-
"""A ripple-carry adder with a carry-in and a carry-out bit.
|
1386
|
-
|
1387
|
-
This plugin name is:``FullAdder.ripple_c04`` which can be used as the key on
|
1388
|
-
an :class:`~.HLSConfig` object to use this method with :class:`~.HighLevelSynthesis`.
|
1389
|
-
|
1390
|
-
This plugin requires at least one clean auxiliary qubit.
|
1391
|
-
|
1392
|
-
The plugin supports the following plugin-specific options:
|
1393
|
-
|
1394
|
-
* ``num_clean_ancillas``: The number of clean auxiliary qubits available.
|
1395
|
-
|
1396
|
-
"""
|
1397
|
-
|
1398
|
-
def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
|
1399
|
-
if not isinstance(high_level_object, FullAdderGate):
|
1400
|
-
return None
|
1401
|
-
|
1402
|
-
return adder_ripple_c04(high_level_object.num_state_qubits, kind="full")
|
1403
|
-
|
1404
|
-
|
1405
|
-
class FullAdderSynthesisV95(HighLevelSynthesisPlugin):
|
1406
|
-
"""A ripple-carry adder with a carry-in and a carry-out bit.
|
1407
|
-
|
1408
|
-
This plugin name is:``FullAdder.ripple_v95`` which can be used as the key on
|
1409
|
-
an :class:`~.HLSConfig` object to use this method with :class:`~.HighLevelSynthesis`.
|
1410
|
-
|
1411
|
-
For an adder on 2 registers with :math:`n` qubits each, this plugin requires at
|
1412
|
-
least :math:`n-1` clean auxiliary qubit.
|
1413
|
-
|
1414
|
-
The plugin supports the following plugin-specific options:
|
1415
|
-
|
1416
|
-
* ``num_clean_ancillas``: The number of clean auxiliary qubits available.
|
1417
|
-
"""
|
1418
|
-
|
1419
|
-
def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
|
1420
|
-
if not isinstance(high_level_object, FullAdderGate):
|
1421
|
-
return None
|
1422
|
-
|
1423
|
-
num_state_qubits = high_level_object.num_state_qubits
|
1424
|
-
|
1425
|
-
# for more than 1 state qubit, we need an ancilla
|
1426
|
-
if num_state_qubits > 1 > options.get("num_clean_ancillas", 1):
|
1427
|
-
return None
|
1428
|
-
|
1429
|
-
return adder_ripple_v95(num_state_qubits, kind="full")
|
1430
|
-
|
1431
|
-
|
1432
|
-
class MultiplierSynthesisH18(HighLevelSynthesisPlugin):
|
1433
|
-
"""A cumulative multiplier based on controlled adders.
|
1434
|
-
|
1435
|
-
This plugin name is:``Multiplier.cumulative_h18`` which can be used as the key on
|
1436
|
-
an :class:`~.HLSConfig` object to use this method with :class:`~.HighLevelSynthesis`.
|
1437
|
-
"""
|
1438
|
-
|
1439
|
-
def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
|
1440
|
-
if not isinstance(high_level_object, MultiplierGate):
|
1441
|
-
return None
|
1442
|
-
|
1443
|
-
return multiplier_cumulative_h18(
|
1444
|
-
high_level_object.num_state_qubits, high_level_object.num_result_qubits
|
1445
|
-
)
|
1446
|
-
|
1447
|
-
|
1448
|
-
class MultiplierSynthesisR17(HighLevelSynthesisPlugin):
|
1449
|
-
"""A QFT-based multiplier.
|
1450
|
-
|
1451
|
-
This plugin name is:``Multiplier.qft_r17`` which can be used as the key on
|
1452
|
-
an :class:`~.HLSConfig` object to use this method with :class:`~.HighLevelSynthesis`.
|
1453
|
-
"""
|
1454
|
-
|
1455
|
-
def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
|
1456
|
-
if not isinstance(high_level_object, MultiplierGate):
|
1457
|
-
return None
|
1458
|
-
|
1459
|
-
return multiplier_qft_r17(
|
1460
|
-
high_level_object.num_state_qubits, high_level_object.num_result_qubits
|
1461
|
-
)
|
1462
|
-
|
1463
|
-
|
1464
|
-
class PauliEvolutionSynthesisDefault(HighLevelSynthesisPlugin):
|
1465
|
-
"""Synthesize a :class:`.PauliEvolutionGate` using the default synthesis algorithm.
|
1466
|
-
|
1467
|
-
This plugin name is:``PauliEvolution.default`` which can be used as the key on
|
1468
|
-
an :class:`~.HLSConfig` object to use this method with :class:`~.HighLevelSynthesis`.
|
1469
|
-
|
1470
|
-
The following plugin option can be set:
|
1471
|
-
|
1472
|
-
* preserve_order: If ``False``, allow re-ordering the Pauli terms in the Hamiltonian to
|
1473
|
-
reduce the circuit depth of the decomposition.
|
1474
|
-
|
1475
|
-
"""
|
1476
|
-
|
1477
|
-
def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
|
1478
|
-
if not isinstance(high_level_object, PauliEvolutionGate):
|
1479
|
-
# Don't do anything if a gate is called "evolution" but is not an
|
1480
|
-
# actual PauliEvolutionGate
|
1481
|
-
return None
|
1482
|
-
|
1483
|
-
algo = high_level_object.synthesis
|
1484
|
-
|
1485
|
-
if "preserve_order" in options and isinstance(algo, ProductFormula):
|
1486
|
-
algo.preserve_order = options["preserve_order"]
|
1487
|
-
|
1488
|
-
return algo.synthesize(high_level_object)
|
1489
|
-
|
1490
|
-
|
1491
|
-
class PauliEvolutionSynthesisRustiq(HighLevelSynthesisPlugin):
|
1492
|
-
"""Synthesize a :class:`.PauliEvolutionGate` using Rustiq.
|
1493
|
-
|
1494
|
-
This plugin name is :``PauliEvolution.rustiq`` which can be used as the key on
|
1495
|
-
an :class:`~.HLSConfig` object to use this method with :class:`~.HighLevelSynthesis`.
|
1496
|
-
|
1497
|
-
The Rustiq synthesis algorithm is described in [1], and is implemented in
|
1498
|
-
Rust-based quantum circuit synthesis library available at
|
1499
|
-
https://github.com/smartiel/rustiq-core.
|
1500
|
-
|
1501
|
-
On large circuits the plugin may take a significant runtime.
|
1502
|
-
|
1503
|
-
The plugin supports the following additional options:
|
1504
|
-
|
1505
|
-
* optimize_count (bool): if `True` the synthesis algorithm will try to optimize
|
1506
|
-
the 2-qubit gate count; and if `False` then the 2-qubit depth.
|
1507
|
-
* preserve_order (bool): whether the order of paulis should be preserved, up to
|
1508
|
-
commutativity.
|
1509
|
-
* upto_clifford (bool): if `True`, the final Clifford operator is not synthesized.
|
1510
|
-
* upto_phase (bool): if `True`, the global phase of the returned circuit may
|
1511
|
-
differ from the global phase of the given pauli network.
|
1512
|
-
* resynth_clifford_method (int): describes the strategy to synthesize the final
|
1513
|
-
Clifford operator. Allowed values are `0` (naive approach), `1` (qiskit
|
1514
|
-
greedy synthesis), `2` (rustiq isometry synthesis).
|
1515
|
-
|
1516
|
-
References:
|
1517
|
-
1. Timothée Goubault de Brugière and Simon Martiel,
|
1518
|
-
*Faster and shorter synthesis of Hamiltonian simulation circuits*,
|
1519
|
-
`arXiv:2404.03280 [quant-ph] <https://arxiv.org/abs/2404.03280>`_
|
1520
|
-
|
1521
|
-
"""
|
1522
|
-
|
1523
|
-
def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **options):
|
1524
|
-
if not isinstance(high_level_object, PauliEvolutionGate):
|
1525
|
-
# Don't do anything if a gate is called "evolution" but is not an
|
1526
|
-
# actual PauliEvolutionGate
|
1527
|
-
return None
|
1528
|
-
|
1529
|
-
algo = high_level_object.synthesis
|
1530
|
-
|
1531
|
-
if not isinstance(algo, ProductFormula):
|
1532
|
-
warnings.warn(
|
1533
|
-
"Cannot apply Rustiq if the evolution synthesis does not implement ``expand``. ",
|
1534
|
-
stacklevel=2,
|
1535
|
-
category=RuntimeWarning,
|
1536
|
-
)
|
1537
|
-
return None
|
1538
|
-
|
1539
|
-
if "preserve_order" in options:
|
1540
|
-
algo.preserve_order = options["preserve_order"]
|
1541
|
-
|
1542
|
-
num_qubits = high_level_object.num_qubits
|
1543
|
-
pauli_network = algo.expand(high_level_object)
|
1544
|
-
|
1545
|
-
optimize_count = options.get("optimize_count", True)
|
1546
|
-
preserve_order = options.get("preserve_order", True)
|
1547
|
-
upto_clifford = options.get("upto_clifford", False)
|
1548
|
-
upto_phase = options.get("upto_phase", False)
|
1549
|
-
resynth_clifford_method = options.get("resynth_clifford_method", 1)
|
1550
|
-
|
1551
|
-
return synth_pauli_network_rustiq(
|
1552
|
-
num_qubits=num_qubits,
|
1553
|
-
pauli_network=pauli_network,
|
1554
|
-
optimize_count=optimize_count,
|
1555
|
-
preserve_order=preserve_order,
|
1556
|
-
upto_clifford=upto_clifford,
|
1557
|
-
upto_phase=upto_phase,
|
1558
|
-
resynth_clifford_method=resynth_clifford_method,
|
1559
|
-
)
|