qiskit 1.3.3__cp39-abi3-macosx_11_0_arm64.whl → 1.4.1__cp39-abi3-macosx_11_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. qiskit/VERSION.txt +1 -1
  2. qiskit/__init__.py +1 -0
  3. qiskit/_accelerate.abi3.so +0 -0
  4. qiskit/circuit/bit.py +12 -0
  5. qiskit/circuit/classicalfunction/__init__.py +13 -1
  6. qiskit/circuit/classicalfunction/boolean_expression.py +10 -1
  7. qiskit/circuit/classicalfunction/classicalfunction.py +10 -1
  8. qiskit/circuit/classicalfunction/exceptions.py +7 -1
  9. qiskit/circuit/instruction.py +8 -2
  10. qiskit/circuit/library/generalized_gates/mcmt.py +5 -6
  11. qiskit/circuit/library/phase_oracle.py +24 -17
  12. qiskit/circuit/quantumcircuit.py +64 -1
  13. qiskit/circuit/register.py +13 -0
  14. qiskit/compiler/assembler.py +16 -8
  15. qiskit/dagcircuit/dagdependency_v2.py +4 -2
  16. qiskit/passmanager/passmanager.py +19 -1
  17. qiskit/primitives/backend_estimator_v2.py +17 -0
  18. qiskit/primitives/backend_sampler_v2.py +15 -0
  19. qiskit/providers/backend_compat.py +46 -11
  20. qiskit/providers/basic_provider/basic_simulator.py +15 -3
  21. qiskit/providers/exceptions.py +23 -2
  22. qiskit/providers/models/backendproperties.py +19 -1
  23. qiskit/providers/models/backendstatus.py +10 -0
  24. qiskit/providers/models/jobstatus.py +11 -0
  25. qiskit/pulse/schedule.py +1 -1
  26. qiskit/pulse/utils.py +1 -1
  27. qiskit/qpy/binary_io/value.py +14 -0
  28. qiskit/result/result.py +109 -20
  29. qiskit/synthesis/evolution/product_formula.py +1 -2
  30. qiskit/synthesis/evolution/qdrift.py +1 -2
  31. qiskit/synthesis/evolution/suzuki_trotter.py +1 -2
  32. qiskit/transpiler/passes/calibration/rzx_templates.py +7 -0
  33. qiskit/transpiler/passes/layout/apply_layout.py +1 -0
  34. qiskit/transpiler/passes/layout/dense_layout.py +12 -0
  35. qiskit/transpiler/passes/layout/vf2_layout.py +11 -0
  36. qiskit/transpiler/passes/layout/vf2_post_layout.py +22 -0
  37. qiskit/transpiler/passes/optimization/normalize_rx_angle.py +8 -0
  38. qiskit/transpiler/passes/routing/star_prerouting.py +17 -2
  39. qiskit/transpiler/passes/synthesis/unitary_synthesis.py +11 -0
  40. qiskit/transpiler/passmanager_config.py +11 -0
  41. qiskit/transpiler/preset_passmanagers/builtin_plugins.py +188 -118
  42. qiskit/transpiler/preset_passmanagers/common.py +133 -83
  43. qiskit/transpiler/preset_passmanagers/generate_preset_pass_manager.py +29 -3
  44. qiskit/transpiler/target.py +41 -9
  45. qiskit/visualization/gate_map.py +50 -0
  46. qiskit/visualization/pulse_v2/interface.py +0 -2
  47. qiskit/visualization/timeline/core.py +9 -0
  48. qiskit/visualization/timeline/interface.py +7 -3
  49. {qiskit-1.3.3.dist-info → qiskit-1.4.1.dist-info}/METADATA +1 -1
  50. {qiskit-1.3.3.dist-info → qiskit-1.4.1.dist-info}/RECORD +54 -54
  51. {qiskit-1.3.3.dist-info → qiskit-1.4.1.dist-info}/WHEEL +1 -1
  52. {qiskit-1.3.3.dist-info → qiskit-1.4.1.dist-info}/LICENSE.txt +0 -0
  53. {qiskit-1.3.3.dist-info → qiskit-1.4.1.dist-info}/entry_points.txt +0 -0
  54. {qiskit-1.3.3.dist-info → qiskit-1.4.1.dist-info}/top_level.txt +0 -0
@@ -14,6 +14,7 @@
14
14
  """Common preset passmanager generators."""
15
15
 
16
16
  import collections
17
+ import warnings
17
18
  from typing import Optional
18
19
 
19
20
  from qiskit.circuit.equivalence_library import SessionEquivalenceLibrary as sel
@@ -53,7 +54,7 @@ from qiskit.transpiler.passes.layout.vf2_post_layout import VF2PostLayoutStopRea
53
54
  from qiskit.transpiler.exceptions import TranspilerError
54
55
  from qiskit.transpiler.layout import Layout
55
56
  from qiskit.utils.deprecate_pulse import deprecate_pulse_arg
56
-
57
+ from qiskit.utils.deprecation import deprecate_arg
57
58
 
58
59
  _ControlFlowState = collections.namedtuple("_ControlFlowState", ("working", "not_working"))
59
60
 
@@ -275,6 +276,16 @@ def _apply_post_layout_condition(property_set):
275
276
  )
276
277
 
277
278
 
279
+ @deprecate_arg(
280
+ name="backend_properties",
281
+ since="1.4",
282
+ package_name="Qiskit",
283
+ removal_timeline="in Qiskit 2.0",
284
+ additional_msg="The BackendProperties data structure has been deprecated and will be "
285
+ "removed in Qiskit 2.0. The required `target` input argument should be used "
286
+ "instead. You can use Target.from_configuration() to build the target from the properties "
287
+ "object, but in 2.0 you will need to generate a target directly.",
288
+ )
278
289
  def generate_routing_passmanager(
279
290
  routing_pass,
280
291
  target,
@@ -352,20 +363,33 @@ def generate_routing_passmanager(
352
363
 
353
364
  is_vf2_fully_bounded = vf2_call_limit and vf2_max_trials
354
365
  if (target is not None or backend_properties is not None) and is_vf2_fully_bounded:
355
- routing.append(
356
- ConditionalController(
357
- VF2PostLayout(
358
- target,
359
- coupling_map,
360
- backend_properties,
361
- seed_transpiler,
362
- call_limit=vf2_call_limit,
363
- max_trials=vf2_max_trials,
364
- strict_direction=False,
365
- ),
366
- condition=_run_post_layout_condition,
366
+ with warnings.catch_warnings():
367
+ warnings.filterwarnings(
368
+ "ignore",
369
+ category=DeprecationWarning,
370
+ message=".*argument ``properties`` is deprecated as of Qiskit 1.4",
371
+ module="qiskit",
372
+ )
373
+ warnings.filterwarnings(
374
+ "ignore",
375
+ category=DeprecationWarning,
376
+ message=".*argument ``coupling_map`` is deprecated as of Qiskit 1.4",
377
+ module="qiskit",
378
+ )
379
+ routing.append(
380
+ ConditionalController(
381
+ VF2PostLayout(
382
+ target,
383
+ coupling_map,
384
+ backend_properties,
385
+ seed_transpiler,
386
+ call_limit=vf2_call_limit,
387
+ max_trials=vf2_max_trials,
388
+ strict_direction=False,
389
+ ),
390
+ condition=_run_post_layout_condition,
391
+ )
367
392
  )
368
- )
369
393
  routing.append(ConditionalController(ApplyLayout(), condition=_apply_post_layout_condition))
370
394
 
371
395
  def filter_fn(node):
@@ -409,6 +433,16 @@ def generate_pre_op_passmanager(target=None, coupling_map=None, remove_reset_in_
409
433
  return pre_opt
410
434
 
411
435
 
436
+ @deprecate_arg(
437
+ name="backend_properties",
438
+ since="1.4",
439
+ package_name="Qiskit",
440
+ removal_timeline="in Qiskit 2.0",
441
+ additional_msg="The BackendProperties data structure has been deprecated and will be "
442
+ "removed in Qiskit 2.0. The required `target` input argument should be used "
443
+ "instead. You can use Target.from_configuration() to build the target from the properties "
444
+ "object, but in 2.0 you will need to generate a target directly.",
445
+ )
412
446
  def generate_translation_passmanager(
413
447
  target,
414
448
  basis_gates=None,
@@ -455,76 +489,92 @@ def generate_translation_passmanager(
455
489
  TranspilerError: If the ``method`` kwarg is not a valid value
456
490
  """
457
491
  if method == "translator":
458
- unroll = [
459
- # Use unitary synthesis for basis aware decomposition of
460
- # UnitaryGates before custom unrolling
461
- UnitarySynthesis(
462
- basis_gates,
463
- approximation_degree=approximation_degree,
464
- coupling_map=coupling_map,
465
- backend_props=backend_props,
466
- plugin_config=unitary_synthesis_plugin_config,
467
- method=unitary_synthesis_method,
468
- target=target,
469
- ),
470
- HighLevelSynthesis(
471
- hls_config=hls_config,
472
- coupling_map=coupling_map,
473
- target=target,
474
- use_qubit_indices=True,
475
- equivalence_library=sel,
476
- basis_gates=basis_gates,
477
- qubits_initially_zero=qubits_initially_zero,
478
- ),
479
- BasisTranslator(sel, basis_gates, target),
480
- ]
492
+ with warnings.catch_warnings():
493
+ warnings.filterwarnings(
494
+ "ignore",
495
+ category=DeprecationWarning,
496
+ message=".*argument ``backend_props`` is deprecated as of Qiskit 1.4",
497
+ module="qiskit",
498
+ )
499
+ unroll = [
500
+ # Use unitary synthesis for basis aware decomposition of
501
+ # UnitaryGates before custom unrolling
502
+ UnitarySynthesis(
503
+ basis_gates,
504
+ approximation_degree=approximation_degree,
505
+ coupling_map=coupling_map,
506
+ backend_props=backend_props,
507
+ plugin_config=unitary_synthesis_plugin_config,
508
+ method=unitary_synthesis_method,
509
+ target=target,
510
+ ),
511
+ HighLevelSynthesis(
512
+ hls_config=hls_config,
513
+ coupling_map=coupling_map,
514
+ target=target,
515
+ use_qubit_indices=True,
516
+ equivalence_library=sel,
517
+ basis_gates=basis_gates,
518
+ qubits_initially_zero=qubits_initially_zero,
519
+ ),
520
+ BasisTranslator(sel, basis_gates, target),
521
+ ]
481
522
  elif method == "synthesis":
482
- unroll = [
483
- # # Use unitary synthesis for basis aware decomposition of
484
- # UnitaryGates > 2q before collection
485
- UnitarySynthesis(
486
- basis_gates,
487
- approximation_degree=approximation_degree,
488
- coupling_map=coupling_map,
489
- backend_props=backend_props,
490
- plugin_config=unitary_synthesis_plugin_config,
491
- method=unitary_synthesis_method,
492
- min_qubits=3,
493
- target=target,
494
- ),
495
- HighLevelSynthesis(
496
- hls_config=hls_config,
497
- coupling_map=coupling_map,
498
- target=target,
499
- use_qubit_indices=True,
500
- basis_gates=basis_gates,
501
- min_qubits=3,
502
- qubits_initially_zero=qubits_initially_zero,
503
- ),
504
- Unroll3qOrMore(target=target, basis_gates=basis_gates),
505
- Collect2qBlocks(),
506
- Collect1qRuns(),
507
- ConsolidateBlocks(
508
- basis_gates=basis_gates, target=target, approximation_degree=approximation_degree
509
- ),
510
- UnitarySynthesis(
511
- basis_gates=basis_gates,
512
- approximation_degree=approximation_degree,
513
- coupling_map=coupling_map,
514
- backend_props=backend_props,
515
- plugin_config=unitary_synthesis_plugin_config,
516
- method=unitary_synthesis_method,
517
- target=target,
518
- ),
519
- HighLevelSynthesis(
520
- hls_config=hls_config,
521
- coupling_map=coupling_map,
522
- target=target,
523
- use_qubit_indices=True,
524
- basis_gates=basis_gates,
525
- qubits_initially_zero=qubits_initially_zero,
526
- ),
527
- ]
523
+ with warnings.catch_warnings():
524
+ warnings.filterwarnings(
525
+ "ignore",
526
+ category=DeprecationWarning,
527
+ message=".*argument ``backend_props`` is deprecated as of Qiskit 1.4",
528
+ module="qiskit",
529
+ )
530
+ unroll = [
531
+ # Use unitary synthesis for basis aware decomposition of
532
+ # UnitaryGates > 2q before collection
533
+ UnitarySynthesis(
534
+ basis_gates,
535
+ approximation_degree=approximation_degree,
536
+ coupling_map=coupling_map,
537
+ backend_props=backend_props,
538
+ plugin_config=unitary_synthesis_plugin_config,
539
+ method=unitary_synthesis_method,
540
+ min_qubits=3,
541
+ target=target,
542
+ ),
543
+ HighLevelSynthesis(
544
+ hls_config=hls_config,
545
+ coupling_map=coupling_map,
546
+ target=target,
547
+ use_qubit_indices=True,
548
+ basis_gates=basis_gates,
549
+ min_qubits=3,
550
+ qubits_initially_zero=qubits_initially_zero,
551
+ ),
552
+ Unroll3qOrMore(target=target, basis_gates=basis_gates),
553
+ Collect2qBlocks(),
554
+ Collect1qRuns(),
555
+ ConsolidateBlocks(
556
+ basis_gates=basis_gates,
557
+ target=target,
558
+ approximation_degree=approximation_degree,
559
+ ),
560
+ UnitarySynthesis(
561
+ basis_gates=basis_gates,
562
+ approximation_degree=approximation_degree,
563
+ coupling_map=coupling_map,
564
+ backend_props=backend_props,
565
+ plugin_config=unitary_synthesis_plugin_config,
566
+ method=unitary_synthesis_method,
567
+ target=target,
568
+ ),
569
+ HighLevelSynthesis(
570
+ hls_config=hls_config,
571
+ coupling_map=coupling_map,
572
+ target=target,
573
+ use_qubit_indices=True,
574
+ basis_gates=basis_gates,
575
+ qubits_initially_zero=qubits_initially_zero,
576
+ ),
577
+ ]
528
578
  else:
529
579
  raise TranspilerError(f"Invalid translation method {method}.")
530
580
  return PassManager(unroll)
@@ -344,13 +344,34 @@ def generate_preset_pass_manager(
344
344
  # preserve the former behavior of transpile.
345
345
  backend_properties = _parse_backend_properties(backend_properties, backend)
346
346
  with warnings.catch_warnings():
347
- # TODO: inst_map will be removed in 2.0
347
+ # TODO: inst_map and backend_properties will be removed in 2.0
348
348
  warnings.filterwarnings(
349
349
  "ignore",
350
350
  category=DeprecationWarning,
351
351
  message=".*``inst_map`` is deprecated as of Qiskit 1.3.*",
352
352
  module="qiskit",
353
353
  )
354
+ warnings.filterwarnings(
355
+ "ignore",
356
+ category=DeprecationWarning,
357
+ message=".* ``backend_properties`` is deprecated as of Qiskit 1.4",
358
+ module="qiskit",
359
+ )
360
+ warnings.filterwarnings(
361
+ "ignore",
362
+ category=DeprecationWarning,
363
+ message=".*``qiskit.providers.exceptions.BackendPropertyError``",
364
+ )
365
+ # TODO: This is a temporary usage of deprecated backend_properties in
366
+ # Target.from_configuration. Probably the logic needs to be restructured
367
+ # in a more target-centric transpiler
368
+ # https://github.com/Qiskit/qiskit/issues/9256
369
+ warnings.filterwarnings(
370
+ "ignore",
371
+ category=DeprecationWarning,
372
+ message=r".+qiskit\.transpiler\.target\.Target\.from_configuration.+",
373
+ module="qiskit",
374
+ )
354
375
  # Build target from constraints.
355
376
  target = Target.from_configuration(
356
377
  basis_gates=basis_gates,
@@ -403,7 +424,6 @@ def generate_preset_pass_manager(
403
424
  initial_layout = _parse_initial_layout(initial_layout)
404
425
  approximation_degree = _parse_approximation_degree(approximation_degree)
405
426
  seed_transpiler = _parse_seed_transpiler(seed_transpiler)
406
-
407
427
  pm_options = {
408
428
  "target": target,
409
429
  "basis_gates": basis_gates,
@@ -428,12 +448,18 @@ def generate_preset_pass_manager(
428
448
  }
429
449
 
430
450
  with warnings.catch_warnings():
431
- # inst_map is deprecated in the PassManagerConfig initializer
451
+ # inst_map and backend_properties are deprecated in the PassManagerConfig initializer
432
452
  warnings.filterwarnings(
433
453
  "ignore",
434
454
  category=DeprecationWarning,
435
455
  message=".*argument ``inst_map`` is deprecated as of Qiskit 1.3",
436
456
  )
457
+ warnings.filterwarnings(
458
+ "ignore",
459
+ category=DeprecationWarning,
460
+ message=".*argument ``backend_properties`` is deprecated as of Qiskit 1.4",
461
+ module="qiskit",
462
+ )
437
463
  if backend is not None:
438
464
  pm_options["_skip_target"] = _skip_target
439
465
  pm_config = PassManagerConfig.from_backend(backend, **pm_options)
@@ -56,9 +56,10 @@ from qiskit.exceptions import QiskitError
56
56
  # full target
57
57
  from qiskit.providers.backend import QubitProperties # pylint: disable=unused-import
58
58
  from qiskit.providers.models.backendproperties import BackendProperties
59
- from qiskit.utils import deprecate_func
59
+ from qiskit.utils import deprecate_func, deprecate_arg
60
60
  from qiskit.utils.deprecate_pulse import deprecate_pulse_dependency, deprecate_pulse_arg
61
61
 
62
+
62
63
  logger = logging.getLogger(__name__)
63
64
 
64
65
 
@@ -656,28 +657,43 @@ class Target(BaseTarget):
656
657
  self,
657
658
  operation_name: str,
658
659
  qargs: tuple[int, ...],
660
+ operation_params: list[float] | float | None = None,
659
661
  ) -> bool:
660
- """Return whether the instruction (operation + qubits) defines a calibration.
662
+ """Return whether the instruction (operation + operation_params + qubits) defines
663
+ a calibration.
661
664
 
662
665
  Args:
663
666
  operation_name: The name of the operation for the instruction.
664
- qargs: The tuple of qubit indices for the instruction.
667
+ qargs: The qubit indices for the instruction.
668
+ operation_params: The parameters for the Instruction. In case
669
+ of multi-parameter gates, the order of parameters in the tuple
670
+ must match the order of the gate parameters.
665
671
 
666
672
  Returns:
667
673
  Returns ``True`` if the calibration is supported and ``False`` if it isn't.
668
674
  """
669
- return self._has_calibration(operation_name, qargs)
675
+ return self._has_calibration(operation_name, qargs, operation_params)
670
676
 
671
677
  def _has_calibration(
672
678
  self,
673
679
  operation_name: str,
674
680
  qargs: tuple[int, ...],
681
+ operation_params: list[float] | float | None = None,
675
682
  ) -> bool:
676
- qargs = tuple(qargs)
683
+ if operation_params is not None and not isinstance(operation_params, list):
684
+ operation_params = [operation_params]
685
+
677
686
  if operation_name not in self._gate_map:
678
687
  return False
688
+
679
689
  if qargs not in self._gate_map[operation_name]:
680
690
  return False
691
+
692
+ if operation_params is not None and not (
693
+ operation_params == self._gate_name_map[operation_name].params
694
+ ):
695
+ return False
696
+
681
697
  return getattr(self._gate_map[operation_name][qargs], "_calibration", None) is not None
682
698
 
683
699
  @deprecate_pulse_dependency
@@ -686,6 +702,7 @@ class Target(BaseTarget):
686
702
  operation_name: str,
687
703
  qargs: tuple[int, ...],
688
704
  *args: ParameterValueType,
705
+ operation_params: list[float] | float | None = None,
689
706
  **kwargs: ParameterValueType,
690
707
  ) -> Schedule | ScheduleBlock:
691
708
  """Get calibrated pulse schedule for the instruction.
@@ -695,25 +712,32 @@ class Target(BaseTarget):
695
712
 
696
713
  Args:
697
714
  operation_name: The name of the operation for the instruction.
698
- qargs: The tuple of qubit indices for the instruction.
715
+ qargs: The qubit indices for the instruction.
699
716
  args: Parameter values to build schedule if any.
717
+ operation_params: The parameters for the Instruction. In case
718
+ of multi-parameter gate, the order of parameters in the tuple
719
+ must match the order of the gate parameters.
700
720
  kwargs: Parameter values with name to build schedule if any.
701
721
 
702
722
  Returns:
703
723
  Calibrated pulse schedule of corresponding instruction.
704
724
  """
705
- return self._get_calibration(operation_name, qargs, *args, *kwargs)
725
+ return self._get_calibration(
726
+ operation_name, qargs, *args, operation_params=operation_params, **kwargs
727
+ )
706
728
 
707
729
  def _get_calibration(
708
730
  self,
709
731
  operation_name: str,
710
732
  qargs: tuple[int, ...],
711
733
  *args: ParameterValueType,
734
+ operation_params: list[float] | float | None = None,
712
735
  **kwargs: ParameterValueType,
713
736
  ) -> Schedule | ScheduleBlock:
714
- if not self._has_calibration(operation_name, qargs):
737
+ if not self._has_calibration(operation_name, qargs, operation_params):
715
738
  raise KeyError(
716
- f"Calibration of instruction {operation_name} for qubit {qargs} is not defined."
739
+ f"Calibration of instruction: `{operation_name}`, with params: "
740
+ f"`{operation_params}` for qubit: {qargs} is not defined."
717
741
  )
718
742
  cal_entry = getattr(self._gate_map[operation_name][qargs], "_calibration")
719
743
  return cal_entry.get_schedule(*args, **kwargs)
@@ -971,6 +995,14 @@ class Target(BaseTarget):
971
995
 
972
996
  @classmethod
973
997
  @deprecate_pulse_arg("inst_map")
998
+ @deprecate_arg(
999
+ name="backend_properties",
1000
+ since="1.4",
1001
+ package_name="Qiskit",
1002
+ removal_timeline="in Qiskit 2.0",
1003
+ additional_msg="To add instructions with specific properties "
1004
+ "use Target.add_instruction(instruction, properties, name).",
1005
+ )
974
1006
  def from_configuration(
975
1007
  cls,
976
1008
  basis_gates: list[str],
@@ -13,6 +13,7 @@
13
13
  """A module for visualizing device coupling maps"""
14
14
 
15
15
  import math
16
+ import warnings
16
17
  from typing import List
17
18
 
18
19
  import numpy as np
@@ -21,6 +22,7 @@ from rustworkx.visualization import graphviz_draw
21
22
 
22
23
  from qiskit.exceptions import QiskitError
23
24
  from qiskit.utils import optionals as _optionals
25
+ from qiskit.providers import BackendV2
24
26
  from qiskit.providers.exceptions import BackendPropertyError
25
27
  from qiskit.transpiler.coupling import CouplingMap
26
28
  from .exceptions import VisualizationError
@@ -50,6 +52,12 @@ def plot_gate_map(
50
52
  ):
51
53
  """Plots the gate map of a device.
52
54
 
55
+ .. deprecated:: 1.4
56
+ The function ``plot_gate_map`` will stop supporting inputs of type
57
+ :class:`.BackendV1` in the `backend` parameter in a future release no
58
+ earlier than 2.0. :class:`.BackendV1` is deprecated and implementations should
59
+ move to :class:`.BackendV2`.
60
+
53
61
  Args:
54
62
  backend (Backend): The backend instance that will be used to plot the device
55
63
  gate map.
@@ -92,6 +100,15 @@ def plot_gate_map(
92
100
 
93
101
  plot_gate_map(backend)
94
102
  """
103
+ if not isinstance(backend, BackendV2):
104
+ warnings.warn(
105
+ "The function `plot_gate_map` will stop supporting inputs of "
106
+ f"type `BackendV1` ( {backend} ) in the `backend` parameter in a future "
107
+ "release no earlier than 2.0. `BackendV1` is deprecated and implementations "
108
+ "should move to `BackendV2`.",
109
+ category=DeprecationWarning,
110
+ stacklevel=2,
111
+ )
95
112
  qubit_coordinates_map = {}
96
113
 
97
114
  qubit_coordinates_map[5] = [[1, 0], [0, 1], [1, 1], [1, 2], [2, 1]]
@@ -1145,6 +1162,12 @@ def plot_circuit_layout(circuit, backend, view="virtual", qubit_coordinates=None
1145
1162
  """Plot the layout of a circuit transpiled for a given
1146
1163
  target backend.
1147
1164
 
1165
+ .. deprecated:: 1.4
1166
+ The function ``plot_circuit_layout`` will stop supporting inputs of type
1167
+ :class:`.BackendV1` in the `backend` parameter in a future release no
1168
+ earlier than 2.0. :class:`.BackendV1` is deprecated and implementations should
1169
+ move to :class:`.BackendV2`.
1170
+
1148
1171
  Args:
1149
1172
  circuit (QuantumCircuit): Input quantum circuit.
1150
1173
  backend (Backend): Target backend.
@@ -1187,6 +1210,17 @@ def plot_circuit_layout(circuit, backend, view="virtual", qubit_coordinates=None
1187
1210
  new_circ_lv3 = transpile(ghz, backend=backend, optimization_level=3)
1188
1211
  plot_circuit_layout(new_circ_lv3, backend)
1189
1212
  """
1213
+
1214
+ if not isinstance(backend, BackendV2):
1215
+ warnings.warn(
1216
+ "The function `plot_circuit_layout` will stop supporting inputs of "
1217
+ f"type `BackendV1` ( {backend} ) in the `backend` parameter in a future "
1218
+ "release no earlier than 2.0. `BackendV1` is deprecated and implementations "
1219
+ "should move to `BackendV2`.",
1220
+ category=DeprecationWarning,
1221
+ stacklevel=2,
1222
+ )
1223
+
1190
1224
  if circuit._layout is None:
1191
1225
  raise QiskitError("Circuit has no layout. Perhaps it has not been transpiled.")
1192
1226
 
@@ -1254,6 +1288,12 @@ def plot_circuit_layout(circuit, backend, view="virtual", qubit_coordinates=None
1254
1288
  def plot_error_map(backend, figsize=(15, 12), show_title=True, qubit_coordinates=None):
1255
1289
  """Plots the error map of a given backend.
1256
1290
 
1291
+ .. deprecated:: 1.4
1292
+ The function ``plot_error_map`` will stop supporting inputs of type
1293
+ :class:`.BackendV1` in the `backend` parameter in a future release no
1294
+ earlier than 2.0. :class:`.BackendV1` is deprecated and implementations should
1295
+ move to :class:`.BackendV2`.
1296
+
1257
1297
  Args:
1258
1298
  backend (Backend): Given backend.
1259
1299
  figsize (tuple): Figure size in inches.
@@ -1282,6 +1322,16 @@ def plot_error_map(backend, figsize=(15, 12), show_title=True, qubit_coordinates
1282
1322
  backend = GenericBackendV2(num_qubits=5)
1283
1323
  plot_error_map(backend)
1284
1324
  """
1325
+ if not isinstance(backend, BackendV2):
1326
+ warnings.warn(
1327
+ "The function `plot_error_map` will stop supporting inputs of "
1328
+ f"type `BackendV1` ( {backend} ) in the `backend` parameter in a future "
1329
+ "release no earlier than 2.0. `BackendV1` is deprecated and implementations "
1330
+ "should move to `BackendV2`.",
1331
+ category=DeprecationWarning,
1332
+ stacklevel=2,
1333
+ )
1334
+
1285
1335
  import matplotlib
1286
1336
  import matplotlib.pyplot as plt
1287
1337
  from matplotlib import gridspec, ticker
@@ -27,12 +27,10 @@ from qiskit.pulse.channels import Channel
27
27
  from qiskit.visualization.exceptions import VisualizationError
28
28
  from qiskit.visualization.pulse_v2 import core, device_info, stylesheet, types
29
29
  from qiskit.exceptions import MissingOptionalLibraryError
30
- from qiskit.utils import deprecate_arg
31
30
  from qiskit.utils.deprecate_pulse import deprecate_pulse_dependency
32
31
 
33
32
 
34
33
  @deprecate_pulse_dependency(moving_to_dynamics=True)
35
- @deprecate_arg("show_barrier", new_alias="plot_barrier", since="1.1.0", pending=True)
36
34
  def draw(
37
35
  program: Union[Waveform, SymbolicPulse, Schedule, ScheduleBlock],
38
36
  style: Optional[Dict[str, Any]] = None,
@@ -142,6 +142,15 @@ class DrawerCanvas:
142
142
  def load_program(self, program: circuit.QuantumCircuit, target: Target | None = None):
143
143
  """Load quantum circuit and create drawing..
144
144
 
145
+ .. deprecated:: 1.3
146
+ Visualization of unscheduled circuits with the timeline drawer has been
147
+ deprecated in Qiskit 1.3.
148
+ This circuit should be transpiled with a scheduler, despite having instructions
149
+ with explicit durations.
150
+
151
+ .. deprecated:: 1.3
152
+ Targets with duration-less operations are going to error in Qiskit 2.0.
153
+
145
154
  Args:
146
155
  program: Scheduled circuit object to draw.
147
156
  target: The target the circuit is scheduled for. This contains backend information
@@ -30,8 +30,8 @@ from qiskit.visualization.timeline import types, core, stylesheet
30
30
  from qiskit.utils import deprecate_arg
31
31
 
32
32
 
33
- @deprecate_arg("show_idle", new_alias="idle_wires", since="1.1.0", pending=True)
34
- @deprecate_arg("show_barriers", new_alias="plot_barriers", since="1.1.0", pending=True)
33
+ @deprecate_arg("show_idle", new_alias="idle_wires", since="1.4")
34
+ @deprecate_arg("show_barriers", new_alias="plot_barriers", since="1.4")
35
35
  def draw(
36
36
  program: circuit.QuantumCircuit,
37
37
  style: Optional[Dict[str, Any]] = None,
@@ -52,6 +52,10 @@ def draw(
52
52
  ):
53
53
  r"""Generate visualization data for scheduled circuit programs.
54
54
 
55
+ .. deprecated:: 1.3
56
+ The ``target`` parameter needs to be specified in Qiskit 2.0 in order to get the
57
+ instruction durations.
58
+
55
59
  Args:
56
60
  program: Program to visualize. This program should be a `QuantumCircuit` which is
57
61
  transpiled with a scheduling_method, thus containing gate time information.
@@ -372,7 +376,7 @@ def draw(
372
376
  warnings.warn(
373
377
  "Target is not specified. In Qiskit 2.0.0 this will be required to get the duration of "
374
378
  "instructions.",
375
- PendingDeprecationWarning,
379
+ DeprecationWarning,
376
380
  stacklevel=2,
377
381
  )
378
382
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: qiskit
3
- Version: 1.3.3
3
+ Version: 1.4.1
4
4
  Summary: An open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
5
5
  Author-email: Qiskit Development Team <qiskit@us.ibm.com>
6
6
  License: Apache 2.0