qiskit 1.3.3__cp39-abi3-win32.whl → 1.4.1__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 -0
- qiskit/_accelerate.pyd +0 -0
- qiskit/circuit/bit.py +12 -0
- qiskit/circuit/classicalfunction/__init__.py +13 -1
- qiskit/circuit/classicalfunction/boolean_expression.py +10 -1
- qiskit/circuit/classicalfunction/classicalfunction.py +10 -1
- qiskit/circuit/classicalfunction/exceptions.py +7 -1
- qiskit/circuit/instruction.py +8 -2
- qiskit/circuit/library/generalized_gates/mcmt.py +5 -6
- qiskit/circuit/library/phase_oracle.py +24 -17
- qiskit/circuit/quantumcircuit.py +64 -1
- qiskit/circuit/register.py +13 -0
- qiskit/compiler/assembler.py +16 -8
- qiskit/dagcircuit/dagdependency_v2.py +4 -2
- qiskit/passmanager/passmanager.py +19 -1
- qiskit/primitives/backend_estimator_v2.py +17 -0
- qiskit/primitives/backend_sampler_v2.py +15 -0
- qiskit/providers/backend_compat.py +46 -11
- qiskit/providers/basic_provider/basic_simulator.py +15 -3
- qiskit/providers/exceptions.py +23 -2
- qiskit/providers/models/backendproperties.py +19 -1
- qiskit/providers/models/backendstatus.py +10 -0
- qiskit/providers/models/jobstatus.py +11 -0
- qiskit/pulse/schedule.py +1 -1
- qiskit/pulse/utils.py +1 -1
- qiskit/qpy/binary_io/value.py +14 -0
- qiskit/result/result.py +109 -20
- qiskit/synthesis/evolution/product_formula.py +1 -2
- qiskit/synthesis/evolution/qdrift.py +1 -2
- qiskit/synthesis/evolution/suzuki_trotter.py +1 -2
- qiskit/transpiler/passes/calibration/rzx_templates.py +7 -0
- qiskit/transpiler/passes/layout/apply_layout.py +1 -0
- qiskit/transpiler/passes/layout/dense_layout.py +12 -0
- qiskit/transpiler/passes/layout/vf2_layout.py +11 -0
- qiskit/transpiler/passes/layout/vf2_post_layout.py +22 -0
- qiskit/transpiler/passes/optimization/normalize_rx_angle.py +8 -0
- qiskit/transpiler/passes/routing/star_prerouting.py +17 -2
- qiskit/transpiler/passes/synthesis/unitary_synthesis.py +11 -0
- qiskit/transpiler/passmanager_config.py +11 -0
- qiskit/transpiler/preset_passmanagers/builtin_plugins.py +188 -118
- qiskit/transpiler/preset_passmanagers/common.py +133 -83
- qiskit/transpiler/preset_passmanagers/generate_preset_pass_manager.py +29 -3
- qiskit/transpiler/target.py +41 -9
- qiskit/visualization/gate_map.py +50 -0
- qiskit/visualization/pulse_v2/interface.py +0 -2
- qiskit/visualization/timeline/core.py +9 -0
- qiskit/visualization/timeline/interface.py +7 -3
- {qiskit-1.3.3.dist-info → qiskit-1.4.1.dist-info}/METADATA +1 -1
- {qiskit-1.3.3.dist-info → qiskit-1.4.1.dist-info}/RECORD +54 -54
- {qiskit-1.3.3.dist-info → qiskit-1.4.1.dist-info}/WHEEL +1 -1
- {qiskit-1.3.3.dist-info → qiskit-1.4.1.dist-info}/LICENSE.txt +0 -0
- {qiskit-1.3.3.dist-info → qiskit-1.4.1.dist-info}/entry_points.txt +0 -0
- {qiskit-1.3.3.dist-info → qiskit-1.4.1.dist-info}/top_level.txt +0 -0
@@ -18,11 +18,22 @@ import warnings
|
|
18
18
|
from qiskit.transpiler.coupling import CouplingMap
|
19
19
|
from qiskit.transpiler.instruction_durations import InstructionDurations
|
20
20
|
from qiskit.utils.deprecate_pulse import deprecate_pulse_arg
|
21
|
+
from qiskit.utils.deprecation import deprecate_arg
|
21
22
|
|
22
23
|
|
23
24
|
class PassManagerConfig:
|
24
25
|
"""Pass Manager Configuration."""
|
25
26
|
|
27
|
+
@deprecate_arg(
|
28
|
+
name="backend_properties",
|
29
|
+
since="1.4",
|
30
|
+
package_name="Qiskit",
|
31
|
+
removal_timeline="in Qiskit 2.0",
|
32
|
+
additional_msg="The BackendProperties data structure has been deprecated and will be "
|
33
|
+
"removed in Qiskit 2.0. The `target` input argument should be used instead. "
|
34
|
+
"You can use Target.from_configuration() to build the target from the properties "
|
35
|
+
"object, but in 2.0 you will need to generate a target directly.",
|
36
|
+
)
|
26
37
|
@deprecate_pulse_arg("inst_map", predicate=lambda inst_map: inst_map is not None)
|
27
38
|
def __init__(
|
28
39
|
self,
|
@@ -201,18 +201,25 @@ class BasisTranslatorPassManager(PassManagerStagePlugin):
|
|
201
201
|
"""Plugin class for translation stage with :class:`~.BasisTranslator`"""
|
202
202
|
|
203
203
|
def pass_manager(self, pass_manager_config, optimization_level=None) -> PassManager:
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
204
|
+
with warnings.catch_warnings():
|
205
|
+
warnings.filterwarnings(
|
206
|
+
"ignore",
|
207
|
+
category=DeprecationWarning,
|
208
|
+
message=".*argument ``backend_properties`` is deprecated as of Qiskit 1.4",
|
209
|
+
module="qiskit",
|
210
|
+
)
|
211
|
+
return common.generate_translation_passmanager(
|
212
|
+
pass_manager_config.target,
|
213
|
+
basis_gates=pass_manager_config.basis_gates,
|
214
|
+
method="translator",
|
215
|
+
approximation_degree=pass_manager_config.approximation_degree,
|
216
|
+
coupling_map=pass_manager_config.coupling_map,
|
217
|
+
backend_props=pass_manager_config.backend_properties,
|
218
|
+
unitary_synthesis_method=pass_manager_config.unitary_synthesis_method,
|
219
|
+
unitary_synthesis_plugin_config=pass_manager_config.unitary_synthesis_plugin_config,
|
220
|
+
hls_config=pass_manager_config.hls_config,
|
221
|
+
qubits_initially_zero=pass_manager_config.qubits_initially_zero,
|
222
|
+
)
|
216
223
|
|
217
224
|
|
218
225
|
class UnitarySynthesisPassManager(PassManagerStagePlugin):
|
@@ -457,17 +464,24 @@ class SabreSwapPassManager(PassManagerStagePlugin):
|
|
457
464
|
seed=seed_transpiler,
|
458
465
|
trials=trial_count,
|
459
466
|
)
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
467
|
+
with warnings.catch_warnings():
|
468
|
+
warnings.filterwarnings(
|
469
|
+
"ignore",
|
470
|
+
category=DeprecationWarning,
|
471
|
+
message=".*argument ``backend_properties`` is deprecated as of Qiskit 1.4",
|
472
|
+
module="qiskit",
|
473
|
+
)
|
474
|
+
return common.generate_routing_passmanager(
|
475
|
+
routing_pass,
|
476
|
+
target,
|
477
|
+
coupling_map,
|
478
|
+
vf2_call_limit=vf2_call_limit,
|
479
|
+
vf2_max_trials=vf2_max_trials,
|
480
|
+
backend_properties=backend_properties,
|
481
|
+
seed_transpiler=-1,
|
482
|
+
check_trivial=True,
|
483
|
+
use_barrier_before_measurement=True,
|
484
|
+
)
|
471
485
|
if optimization_level == 2:
|
472
486
|
trial_count = _get_trial_count(20)
|
473
487
|
|
@@ -477,16 +491,23 @@ class SabreSwapPassManager(PassManagerStagePlugin):
|
|
477
491
|
seed=seed_transpiler,
|
478
492
|
trials=trial_count,
|
479
493
|
)
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
494
|
+
with warnings.catch_warnings():
|
495
|
+
warnings.filterwarnings(
|
496
|
+
"ignore",
|
497
|
+
category=DeprecationWarning,
|
498
|
+
message=".*argument ``backend_properties`` is deprecated as of Qiskit 1.4",
|
499
|
+
module="qiskit",
|
500
|
+
)
|
501
|
+
return common.generate_routing_passmanager(
|
502
|
+
routing_pass,
|
503
|
+
target,
|
504
|
+
coupling_map=coupling_map,
|
505
|
+
vf2_call_limit=vf2_call_limit,
|
506
|
+
vf2_max_trials=vf2_max_trials,
|
507
|
+
backend_properties=backend_properties,
|
508
|
+
seed_transpiler=-1,
|
509
|
+
use_barrier_before_measurement=True,
|
510
|
+
)
|
490
511
|
if optimization_level == 3:
|
491
512
|
trial_count = _get_trial_count(20)
|
492
513
|
routing_pass = SabreSwap(
|
@@ -495,16 +516,23 @@ class SabreSwapPassManager(PassManagerStagePlugin):
|
|
495
516
|
seed=seed_transpiler,
|
496
517
|
trials=trial_count,
|
497
518
|
)
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
519
|
+
with warnings.catch_warnings():
|
520
|
+
warnings.filterwarnings(
|
521
|
+
"ignore",
|
522
|
+
category=DeprecationWarning,
|
523
|
+
message=".*argument ``backend_properties`` is deprecated as of Qiskit 1.4",
|
524
|
+
module="qiskit",
|
525
|
+
)
|
526
|
+
return common.generate_routing_passmanager(
|
527
|
+
routing_pass,
|
528
|
+
target,
|
529
|
+
coupling_map=coupling_map,
|
530
|
+
vf2_call_limit=vf2_call_limit,
|
531
|
+
vf2_max_trials=vf2_max_trials,
|
532
|
+
backend_properties=backend_properties,
|
533
|
+
seed_transpiler=-1,
|
534
|
+
use_barrier_before_measurement=True,
|
535
|
+
)
|
508
536
|
raise TranspilerError(f"Invalid optimization level specified: {optimization_level}")
|
509
537
|
|
510
538
|
|
@@ -596,30 +624,37 @@ class OptimizationPassManager(PassManagerStagePlugin):
|
|
596
624
|
]
|
597
625
|
elif optimization_level == 3:
|
598
626
|
# Steps for optimization level 3
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
627
|
+
with warnings.catch_warnings():
|
628
|
+
warnings.filterwarnings(
|
629
|
+
"ignore",
|
630
|
+
category=DeprecationWarning,
|
631
|
+
message=".*argument ``backend_props`` is deprecated as of Qiskit 1.4",
|
632
|
+
module="qiskit",
|
633
|
+
)
|
634
|
+
_opt = [
|
635
|
+
ConsolidateBlocks(
|
636
|
+
basis_gates=pass_manager_config.basis_gates,
|
637
|
+
target=pass_manager_config.target,
|
638
|
+
approximation_degree=pass_manager_config.approximation_degree,
|
639
|
+
),
|
640
|
+
UnitarySynthesis(
|
641
|
+
pass_manager_config.basis_gates,
|
642
|
+
approximation_degree=pass_manager_config.approximation_degree,
|
643
|
+
coupling_map=pass_manager_config.coupling_map,
|
644
|
+
backend_props=pass_manager_config.backend_properties,
|
645
|
+
method=pass_manager_config.unitary_synthesis_method,
|
646
|
+
plugin_config=pass_manager_config.unitary_synthesis_plugin_config,
|
647
|
+
target=pass_manager_config.target,
|
648
|
+
),
|
649
|
+
RemoveIdentityEquivalent(
|
650
|
+
approximation_degree=pass_manager_config.approximation_degree,
|
651
|
+
target=pass_manager_config.target,
|
652
|
+
),
|
653
|
+
Optimize1qGatesDecomposition(
|
654
|
+
basis=pass_manager_config.basis_gates, target=pass_manager_config.target
|
655
|
+
),
|
656
|
+
CommutativeCancellation(target=pass_manager_config.target),
|
657
|
+
]
|
623
658
|
|
624
659
|
def _opt_control(property_set):
|
625
660
|
return not property_set["optimization_loop_minimum_point"]
|
@@ -642,24 +677,31 @@ class OptimizationPassManager(PassManagerStagePlugin):
|
|
642
677
|
if optimization_level == 3:
|
643
678
|
optimization.append(_minimum_point_check)
|
644
679
|
elif optimization_level == 2:
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
680
|
+
with warnings.catch_warnings():
|
681
|
+
warnings.filterwarnings(
|
682
|
+
"ignore",
|
683
|
+
category=DeprecationWarning,
|
684
|
+
message=".*argument ``backend_props`` is deprecated as of Qiskit 1.4",
|
685
|
+
module="qiskit",
|
686
|
+
)
|
687
|
+
optimization.append(
|
688
|
+
[
|
689
|
+
ConsolidateBlocks(
|
690
|
+
basis_gates=pass_manager_config.basis_gates,
|
691
|
+
target=pass_manager_config.target,
|
692
|
+
approximation_degree=pass_manager_config.approximation_degree,
|
693
|
+
),
|
694
|
+
UnitarySynthesis(
|
695
|
+
pass_manager_config.basis_gates,
|
696
|
+
approximation_degree=pass_manager_config.approximation_degree,
|
697
|
+
coupling_map=pass_manager_config.coupling_map,
|
698
|
+
backend_props=pass_manager_config.backend_properties,
|
699
|
+
method=pass_manager_config.unitary_synthesis_method,
|
700
|
+
plugin_config=pass_manager_config.unitary_synthesis_plugin_config,
|
701
|
+
target=pass_manager_config.target,
|
702
|
+
),
|
703
|
+
]
|
704
|
+
)
|
663
705
|
optimization.append(_depth_check + _size_check)
|
664
706
|
else:
|
665
707
|
optimization.append(_depth_check + _size_check)
|
@@ -788,14 +830,21 @@ class DefaultLayoutPassManager(PassManagerStagePlugin):
|
|
788
830
|
condition=_choose_layout_condition,
|
789
831
|
)
|
790
832
|
)
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
833
|
+
with warnings.catch_warnings():
|
834
|
+
warnings.filterwarnings(
|
835
|
+
"ignore",
|
836
|
+
category=DeprecationWarning,
|
837
|
+
message=".*argument ``properties`` is deprecated as of Qiskit 1.4",
|
838
|
+
module="qiskit",
|
839
|
+
)
|
840
|
+
choose_layout_1 = VF2Layout(
|
841
|
+
coupling_map=pass_manager_config.coupling_map,
|
842
|
+
seed=-1,
|
843
|
+
call_limit=int(5e4), # Set call limit to ~100ms with rustworkx 0.10.2
|
844
|
+
properties=pass_manager_config.backend_properties,
|
845
|
+
target=pass_manager_config.target,
|
846
|
+
max_trials=2500, # Limits layout scoring to < 600ms on ~400 qubit devices
|
847
|
+
)
|
799
848
|
layout.append(ConditionalController(choose_layout_1, condition=_layout_not_perfect))
|
800
849
|
|
801
850
|
trial_count = _get_trial_count(5)
|
@@ -821,14 +870,21 @@ class DefaultLayoutPassManager(PassManagerStagePlugin):
|
|
821
870
|
)
|
822
871
|
)
|
823
872
|
elif optimization_level == 2:
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
873
|
+
with warnings.catch_warnings():
|
874
|
+
warnings.filterwarnings(
|
875
|
+
"ignore",
|
876
|
+
category=DeprecationWarning,
|
877
|
+
message=".*argument ``properties`` is deprecated as of Qiskit 1.4",
|
878
|
+
module="qiskit",
|
879
|
+
)
|
880
|
+
choose_layout_0 = VF2Layout(
|
881
|
+
coupling_map=pass_manager_config.coupling_map,
|
882
|
+
seed=-1,
|
883
|
+
call_limit=int(5e6), # Set call limit to ~10s with rustworkx 0.10.2
|
884
|
+
properties=pass_manager_config.backend_properties,
|
885
|
+
target=pass_manager_config.target,
|
886
|
+
max_trials=2500, # Limits layout scoring to < 600ms on ~400 qubit devices
|
887
|
+
)
|
832
888
|
layout.append(
|
833
889
|
ConditionalController(choose_layout_0, condition=_choose_layout_condition)
|
834
890
|
)
|
@@ -856,14 +912,21 @@ class DefaultLayoutPassManager(PassManagerStagePlugin):
|
|
856
912
|
)
|
857
913
|
)
|
858
914
|
elif optimization_level == 3:
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
915
|
+
with warnings.catch_warnings():
|
916
|
+
warnings.filterwarnings(
|
917
|
+
"ignore",
|
918
|
+
category=DeprecationWarning,
|
919
|
+
message=".*argument ``properties`` is deprecated as of Qiskit 1.4",
|
920
|
+
module="qiskit",
|
921
|
+
)
|
922
|
+
choose_layout_0 = VF2Layout(
|
923
|
+
coupling_map=pass_manager_config.coupling_map,
|
924
|
+
seed=-1,
|
925
|
+
call_limit=int(3e7), # Set call limit to ~60s with rustworkx 0.10.2
|
926
|
+
properties=pass_manager_config.backend_properties,
|
927
|
+
target=pass_manager_config.target,
|
928
|
+
max_trials=250000, # Limits layout scoring to < 60s on ~400 qubit devices
|
929
|
+
)
|
867
930
|
layout.append(
|
868
931
|
ConditionalController(choose_layout_0, condition=_choose_layout_condition)
|
869
932
|
)
|
@@ -937,16 +1000,23 @@ class DenseLayoutPassManager(PassManagerStagePlugin):
|
|
937
1000
|
|
938
1001
|
layout = PassManager()
|
939
1002
|
layout.append(_given_layout)
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
1003
|
+
with warnings.catch_warnings():
|
1004
|
+
warnings.filterwarnings(
|
1005
|
+
"ignore",
|
1006
|
+
category=DeprecationWarning,
|
1007
|
+
message=".*argument ``backend_prop`` is deprecated as of Qiskit 1.4",
|
1008
|
+
module="qiskit",
|
1009
|
+
)
|
1010
|
+
layout.append(
|
1011
|
+
ConditionalController(
|
1012
|
+
DenseLayout(
|
1013
|
+
coupling_map=pass_manager_config.coupling_map,
|
1014
|
+
backend_prop=pass_manager_config.backend_properties,
|
1015
|
+
target=pass_manager_config.target,
|
1016
|
+
),
|
1017
|
+
condition=_choose_layout_condition,
|
1018
|
+
)
|
948
1019
|
)
|
949
|
-
)
|
950
1020
|
layout += common.generate_embed_passmanager(coupling_map)
|
951
1021
|
return layout
|
952
1022
|
|