Repository: Qiskit/qiskit (python)

Issue:
Typo: Change Block to Bloc
https://github.com/Qiskit/qiskit/blob/8121aaef61077221d2e612c2c9e54bbfcdb19d07/qiskit/primitives/__init__.py#L113

@kevinsung opened an issue [here](https://github.com/Qiskit/documentation/issues/1066) to change the spelling of Block to Bloc, for consistency.

Pull request description:
Change Block to Bloc for consistency
As pointed out by @kevinsung in the qiskit/documentation repo issue [here](https://github.com/Qiskit/documentation/issues/1066), the spelling is Bloc rather than Block. Closes #12130 


Patch:
diff --git a/qiskit/primitives/__init__.py b/qiskit/primitives/__init__.py
index dfc315676..0a36dbbb0 100644
--- a/qiskit/primitives/__init__.py
+++ b/qiskit/primitives/__init__.py
@@ -110,7 +110,7 @@ Overview of SamplerV2
 :class:`~BaseSamplerV2` is a primitive that samples outputs of quantum circuits.
 
 Following construction, a sampler is used by calling its :meth:`~.BaseSamplerV2.run` method
-with a list of pubs (Primitive Unified Blocks). Each pub contains values that, together,
+with a list of pubs (Primitive Unified Blocs). Each pub contains values that, together,
 define a computational unit of work for the sampler to complete:
 
 * A single :class:`~qiskit.circuit.QuantumCircuit`, possibly parameterized.
diff --git a/qiskit/transpiler/passes/scheduling/__init__.py b/qiskit/transpiler/passes/scheduling/__init__.py
index 6283faff0..0d120911b 100644
--- a/qiskit/transpiler/passes/scheduling/__init__.py
+++ b/qiskit/transpiler/passes/scheduling/__init__.py
@@ -20,7 +20,7 @@ from .time_unit_conversion import TimeUnitConversion
 from .padding import PadDelay, PadDynamicalDecoupling
 from .alignments import InstructionDurationCheck, ValidatePulseGates, ConstrainedReschedule
 
-# For backward compability
+# For backward compatibility
 from . import alignments as instruction_alignments
 
 # TODO Deprecated pass. Will be removed after deprecation period.
diff --git a/qiskit/transpiler/passes/scheduling/alap.py b/qiskit/transpiler/passes/scheduling/alap.py
index 9ee0f4988..ee2c9160c 100644
--- a/qiskit/transpiler/passes/scheduling/alap.py
+++ b/qiskit/transpiler/passes/scheduling/alap.py
@@ -32,8 +32,7 @@ class ALAPSchedule(BaseSchedulerTransform):
             "Instead, use :class:`~.ALAPScheduleAnalysis`, which is an "
             "analysis pass that requires a padding pass to later modify the circuit."
         ),
-        since="0.21.0",
-        pending=True,
+        since="1.1.0",
     )
     def __init__(self, *args, **kwargs):
         super().__init__(*args, **kwargs)
diff --git a/qiskit/transpiler/passes/scheduling/alignments/align_measures.py b/qiskit/transpiler/passes/scheduling/alignments/align_measures.py
index 668d65f6a..adbf5d89d 100644
--- a/qiskit/transpiler/passes/scheduling/alignments/align_measures.py
+++ b/qiskit/transpiler/passes/scheduling/alignments/align_measures.py
@@ -95,8 +95,7 @@ class AlignMeasures(TransformationPass):
             "Instead, use :class:`~.ConstrainedReschedule`, which performs the same function "
             "but also supports aligning to additional timing constraints."
         ),
-        since="0.21.0",
-        pending=True,
+        since="1.1.0",
     )
     def __init__(self, alignment: int = 1):
         """Create new pass.
diff --git a/qiskit/transpiler/passes/scheduling/asap.py b/qiskit/transpiler/passes/scheduling/asap.py
index cebc32af7..0ea56bb67 100644
--- a/qiskit/transpiler/passes/scheduling/asap.py
+++ b/qiskit/transpiler/passes/scheduling/asap.py
@@ -38,8 +38,7 @@ class ASAPSchedule(BaseSchedulerTransform):
             "Instead, use :class:`~.ASAPScheduleAnalysis`, which is an "
             "analysis pass that requires a padding pass to later modify the circuit."
         ),
-        since="0.21.0",
-        pending=True,
+        since="1.1.0",
     )
     def __init__(self, *args, **kwargs):
         super().__init__(*args, **kwargs)
diff --git a/qiskit/transpiler/passes/scheduling/dynamical_decoupling.py b/qiskit/transpiler/passes/scheduling/dynamical_decoupling.py
index 6883e4cdc..5b84b529e 100644
--- a/qiskit/transpiler/passes/scheduling/dynamical_decoupling.py
+++ b/qiskit/transpiler/passes/scheduling/dynamical_decoupling.py
@@ -109,8 +109,7 @@ class DynamicalDecoupling(TransformationPass):
             "Instead, use :class:`~.PadDynamicalDecoupling`, which performs the same "
             "function but requires scheduling and alignment analysis passes to run prior to it."
         ),
-        since="0.21.0",
-        pending=True,
+        since="1.1.0",
     )
     def __init__(
         self, durations, dd_sequence, qubits=None, spacing=None, skip_reset_qubits=True, target=None
diff --git a/releasenotes/notes/removed_deprecated_0.21-741d08a01a7ed527.yaml b/releasenotes/notes/removed_deprecated_0.21-741d08a01a7ed527.yaml
new file mode 100644
index 000000000..ebfbc01a6
--- /dev/null
+++ b/releasenotes/notes/removed_deprecated_0.21-741d08a01a7ed527.yaml
@@ -0,0 +1,21 @@
+---
+deprecations_transpiler:
+  - |
+    The transpilation pass ``qiskit.transpiler.passes.ALAPSchedule`` is now deprecated. It was pending for deprecation 
+    since Qiskit 0.37 (with Terra 0.21), released on June 2022. The pass is replaced by 
+    :class:`~.transpiler.passes.ALAPScheduleAnalysis`, which is an
+    analysis pass.
+  - |
+    The transpilation pass ``qiskit.transpiler.passes.ASAPSchedule`` is now deprecated. It was pending for deprecation 
+    since Qiskit 0.37 (with Terra 0.21), released on June 2022. It has been superseded by
+    :class:`~.ASAPScheduleAnalysis` and the new scheduling workflow.
+  - |
+    The transpilation pass ``qiskit.transpiler.passes.DynamicalDecoupling`` is now deprecated. It was pending for deprecation 
+    since Qiskit 0.37 (with Terra 0.21), released on June 2022.
+    Instead, use :class:`~.transpiler.passes.PadDynamicalDecoupling`, which performs the same
+    function but requires scheduling and alignment analysis passes to run prior to it.
+  - |
+    The transpilation pass ``qiskit.transpiler.passes.AlignMeasures`` is now deprecated. It was pending for deprecation 
+    since Qiskit 0.37 (with Terra 0.21), released on June 2022.
+    Instead, use :class:`~.ConstrainedReschedule`, which performs the same function 
+    and also supports aligning to additional timing constraints.


Test patch:
diff --git a/test/python/transpiler/legacy_scheduling/test_instruction_alignments.py b/test/python/transpiler/legacy_scheduling/test_instruction_alignments.py
index d15e2f0a6..c1df8adba 100644
--- a/test/python/transpiler/legacy_scheduling/test_instruction_alignments.py
+++ b/test/python/transpiler/legacy_scheduling/test_instruction_alignments.py
@@ -46,12 +46,13 @@ class TestAlignMeasures(QiskitTestCase):
         self.time_conversion_pass = TimeUnitConversion(inst_durations=instruction_durations)
         # reproduce old behavior of 0.20.0 before #7655
         # currently default write latency is 0
-        self.scheduling_pass = ALAPSchedule(
-            durations=instruction_durations,
-            clbit_write_latency=1600,
-            conditional_latency=0,
-        )
-        self.align_measure_pass = AlignMeasures(alignment=16)
+        with self.assertWarns(DeprecationWarning):
+            self.scheduling_pass = ALAPSchedule(
+                durations=instruction_durations,
+                clbit_write_latency=1600,
+                conditional_latency=0,
+            )
+            self.align_measure_pass = AlignMeasures(alignment=16)
 
     def test_t1_experiment_type(self):
         """Test T1 experiment type circuit.
diff --git a/test/python/transpiler/legacy_scheduling/test_scheduling_pass.py b/test/python/transpiler/legacy_scheduling/test_scheduling_pass.py
index fea814d1b..417ff9b42 100644
--- a/test/python/transpiler/legacy_scheduling/test_scheduling_pass.py
+++ b/test/python/transpiler/legacy_scheduling/test_scheduling_pass.py
@@ -43,10 +43,12 @@ class TestSchedulingPass(QiskitTestCase):
             [("h", 0, 200), ("cx", [0, 1], 700), ("measure", None, 1000)]
         )
 
-        pm = PassManager(ALAPSchedule(durations))
+        with self.assertWarns(DeprecationWarning):
+            pm = PassManager(ALAPSchedule(durations))
         alap_qc = pm.run(qc)
 
-        pm = PassManager(ASAPSchedule(durations))
+        with self.assertWarns(DeprecationWarning):
+            pm = PassManager(ASAPSchedule(durations))
         new_qc = pm.run(qc.reverse_ops())
         new_qc = new_qc.reverse_ops()
         new_qc.name = new_qc.name
@@ -83,7 +85,8 @@ class TestSchedulingPass(QiskitTestCase):
         qc.x(1).c_if(0, True)
 
         durations = InstructionDurations([("x", None, 200), ("measure", None, 1000)])
-        pm = PassManager(schedule_pass(durations))
+        with self.assertWarns(DeprecationWarning):
+            pm = PassManager(schedule_pass(durations))
         scheduled = pm.run(qc)
 
         expected = QuantumCircuit(2, 1)
@@ -123,7 +126,8 @@ class TestSchedulingPass(QiskitTestCase):
         qc.measure(1, 0)
 
         durations = InstructionDurations([("x", None, 200), ("measure", None, 1000)])
-        pm = PassManager(schedule_pass(durations))
+        with self.assertWarns(DeprecationWarning):
+            pm = PassManager(schedule_pass(durations))
         scheduled = pm.run(qc)
 
         expected = QuantumCircuit(2, 1)
@@ -170,7 +174,8 @@ class TestSchedulingPass(QiskitTestCase):
         qc.x(2).c_if(0, True)
 
         durations = InstructionDurations([("x", None, 200), ("measure", None, 1000)])
-        pm = PassManager(schedule_pass(durations))
+        with self.assertWarns(DeprecationWarning):
+            pm = PassManager(schedule_pass(durations))
         scheduled = pm.run(qc)
 
         expected = QuantumCircuit(3, 1)
@@ -210,7 +215,8 @@ class TestSchedulingPass(QiskitTestCase):
         qc.measure(1, 0)
 
         durations = InstructionDurations([("measure", [0], 1000), ("measure", [1], 700)])
-        pm = PassManager(schedule_pass(durations))
+        with self.assertWarns(DeprecationWarning):
+            pm = PassManager(schedule_pass(durations))
         scheduled = pm.run(qc)
 
         expected = QuantumCircuit(2, 1)
@@ -253,7 +259,8 @@ class TestSchedulingPass(QiskitTestCase):
         qc.measure(2, 0)
 
         durations = InstructionDurations([("x", None, 200), ("measure", None, 1000)])
-        pm = PassManager(schedule_pass(durations))
+        with self.assertWarns(DeprecationWarning):
+            pm = PassManager(schedule_pass(durations))
         scheduled = pm.run(qc)
 
         expected = QuantumCircuit(3, 1)
@@ -307,7 +314,8 @@ class TestSchedulingPass(QiskitTestCase):
         durations = InstructionDurations(
             [("x", [0], 200), ("x", [1], 400), ("measure", None, 1000)]
         )
-        pm = PassManager(ALAPSchedule(durations))
+        with self.assertWarns(DeprecationWarning):
+            pm = PassManager(ALAPSchedule(durations))
         qc_alap = pm.run(qc)
 
         alap_expected = QuantumCircuit(2, 2)
@@ -319,7 +327,8 @@ class TestSchedulingPass(QiskitTestCase):
 
         self.assertEqual(qc_alap, alap_expected)
 
-        pm = PassManager(ASAPSchedule(durations))
+        with self.assertWarns(DeprecationWarning):
+            pm = PassManager(ASAPSchedule(durations))
         qc_asap = pm.run(qc)
 
         asap_expected = QuantumCircuit(2, 2)
@@ -371,7 +380,8 @@ class TestSchedulingPass(QiskitTestCase):
         durations = InstructionDurations(
             [("x", [0], 200), ("x", [1], 400), ("measure", None, 1000)]
         )
-        pm = PassManager(ALAPSchedule(durations))
+        with self.assertWarns(DeprecationWarning):
+            pm = PassManager(ALAPSchedule(durations))
         qc_alap = pm.run(qc)
 
         alap_expected = QuantumCircuit(2, 2)
@@ -384,7 +394,8 @@ class TestSchedulingPass(QiskitTestCase):
 
         self.assertEqual(qc_alap, alap_expected)
 
-        pm = PassManager(ASAPSchedule(durations))
+        with self.assertWarns(DeprecationWarning):
+            pm = PassManager(ASAPSchedule(durations))
         qc_asap = pm.run(qc)
 
         asap_expected = QuantumCircuit(2, 2)
@@ -446,8 +457,9 @@ class TestSchedulingPass(QiskitTestCase):
         durations = InstructionDurations([("x", None, 200), ("measure", None, 1000)])
 
         # lock at the end edge
-        actual_asap = PassManager(ASAPSchedule(durations, clbit_write_latency=1000)).run(qc)
-        actual_alap = PassManager(ALAPSchedule(durations, clbit_write_latency=1000)).run(qc)
+        with self.assertWarns(DeprecationWarning):
+            actual_asap = PassManager(ASAPSchedule(durations, clbit_write_latency=1000)).run(qc)
+            actual_alap = PassManager(ALAPSchedule(durations, clbit_write_latency=1000)).run(qc)
 
         # start times of 2nd measure depends on ASAP/ALAP
         expected_asap = QuantumCircuit(3, 1)
@@ -495,12 +507,13 @@ class TestSchedulingPass(QiskitTestCase):
         qc.x(0).c_if(0, 1)
 
         durations = InstructionDurations([("x", None, 100), ("measure", None, 1000)])
-        actual_asap = PassManager(
-            ASAPSchedule(durations, clbit_write_latency=write_lat, conditional_latency=cond_lat)
-        ).run(qc)
-        actual_alap = PassManager(
-            ALAPSchedule(durations, clbit_write_latency=write_lat, conditional_latency=cond_lat)
-        ).run(qc)
+        with self.assertWarns(DeprecationWarning):
+            actual_asap = PassManager(
+                ASAPSchedule(durations, clbit_write_latency=write_lat, conditional_latency=cond_lat)
+            ).run(qc)
+            actual_alap = PassManager(
+                ALAPSchedule(durations, clbit_write_latency=write_lat, conditional_latency=cond_lat)
+            ).run(qc)
 
         expected = QuantumCircuit(1, 1)
         expected.measure(0, 0)
@@ -618,12 +631,13 @@ class TestSchedulingPass(QiskitTestCase):
             [("x", None, 100), ("measure", None, 1000), ("cx", None, 200)]
         )
 
-        actual_asap = PassManager(
-            ASAPSchedule(durations, clbit_write_latency=100, conditional_latency=200)
-        ).run(qc)
-        actual_alap = PassManager(
-            ALAPSchedule(durations, clbit_write_latency=100, conditional_latency=200)
-        ).run(qc)
+        with self.assertWarns(DeprecationWarning):
+            actual_asap = PassManager(
+                ASAPSchedule(durations, clbit_write_latency=100, conditional_latency=200)
+            ).run(qc)
+            actual_alap = PassManager(
+                ALAPSchedule(durations, clbit_write_latency=100, conditional_latency=200)
+            ).run(qc)
 
         expected_asap = QuantumCircuit(3, 1)
         expected_asap.delay(100, 0)
@@ -712,7 +726,8 @@ class TestSchedulingPass(QiskitTestCase):
         qc.x(1).c_if(0, True)
 
         durations = InstructionDurations([("x", None, 160)])
-        pm = PassManager(ASAPSchedule(durations))
+        with self.assertWarns(DeprecationWarning):
+            pm = PassManager(ASAPSchedule(durations))
         scheduled = pm.run(qc)
 
         expected = QuantumCircuit(2, 1)
@@ -735,7 +750,8 @@ class TestSchedulingPass(QiskitTestCase):
         qc = QuantumCircuit(2)
         qc.x(1)
 
-        pm = PassManager(schedule_pass(target=target))
+        with self.assertWarns(DeprecationWarning):
+            pm = PassManager(schedule_pass(target=target))
         scheduled = pm.run(qc)
 
         expected = QuantumCircuit(2)
@@ -768,32 +784,36 @@ class TestSchedulingPass(QiskitTestCase):
         # delays are not supported
 
         # No DD instructions nor delays are padded due to no delay support in the target
-        pm_xx = PassManager(
-            [
-                ALAPSchedule(target=target),
-                DynamicalDecoupling(durations=None, dd_sequence=[XGate(), XGate()], target=target),
-            ]
-        )
-        scheduled = pm_xx.run(qc)
-        self.assertEqual(qc, scheduled)
-
-        # Fails since Y is not supported in the target
-        with self.assertRaises(TranspilerError):
-            PassManager(
+        with self.assertWarns(DeprecationWarning):
+            pm_scheduler = PassManager(
                 [
                     ALAPSchedule(target=target),
                     DynamicalDecoupling(
-                        durations=None,
-                        dd_sequence=[XGate(), YGate(), XGate(), YGate()],
-                        target=target,
+                        durations=None, dd_sequence=[XGate(), XGate()], target=target
                     ),
                 ]
             )
+        scheduled = pm_scheduler.run(qc)
+        self.assertEqual(qc, scheduled)
+
+        # Fails since Y is not supported in the target
+        with self.assertWarns(DeprecationWarning):
+            with self.assertRaises(TranspilerError):
+                PassManager(
+                    [
+                        ALAPSchedule(target=target),
+                        DynamicalDecoupling(
+                            durations=None,
+                            dd_sequence=[XGate(), YGate(), XGate(), YGate()],
+                            target=target,
+                        ),
+                    ]
+                )
 
         # Add delay support to the target
         target.add_instruction(Delay(Parameter("t")), {(q,): None for q in range(3)})
         # No error but no DD on qubit 2 (just delay is padded) since X is not supported on it
-        scheduled = pm_xx.run(qc)
+        scheduled = pm_scheduler.run(qc)
 
         expected = QuantumCircuit(3)
         expected.delay(1000, [2])