Repository: Qiskit/qiskit (python)

Issue:
Cannot apply dynamical decoupling on a circuit with parameterized global phase
### Environment

- **Qiskit Terra version**: 0.25 
- **Python version**: 3.11
- **Operating system**: Windows


### What is happening?

Dynamical decoupling cannot be applied on a circuit with a parameterized global phase, due to a failing `_mod_2pi` wrapping 

### How can we reproduce the issue?

```python
from qiskit.transpiler.passes import ALAPScheduleAnalysis, PadDynamicalDecoupling
from qiskit.transpiler import PassManager, InstructionDurations
from qiskit.circuit.library import XGate
from qiskit.circuit import Parameter
durations = InstructionDurations.from_backend(backend)

qc = QuantumCircuit(1,1)
qc.sx(0)
qc.delay(1600, 0)
qc.sx(0)
qc.global_phase=Parameter('a')

pm = PassManager([ALAPScheduleAnalysis(durations), PadDynamicalDecoupling(durations, [XGate(), XGate()])])
pm.run(qc)
```

errors in
https://github.com/Qiskit/qiskit-terra/blob/c29e938c2ba1c359a0a3268679c68f3237b2c1b7/qiskit/transpiler/passes/scheduling/dynamical_decoupling.py#L260
with:
`TypeError: unsupported operand type(s) for %: 'ParameterExpression' and 'float'`

### What should happen?

Run the DD transpiler pass successfully

### Any suggestions?

Don't wrap global phase if parameterized, see same issue in https://github.com/Qiskit/qiskit-ibm-provider/pull/689

Pull request:
 Removed 2pi wrapping for global phase parameter
It fixes #10569
<!--
⚠️ If you do not respect this template, your pull request will be closed.
⚠️ Your pull request title should be short detailed and understandable for all.
⚠️ Also, please add a release note file using reno if the change needs to be
  documented in the release notes.
⚠️ If your pull request fixes an open issue, please link to the issue.

- [ ] I have added the tests to cover my changes.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the CONTRIBUTING document.
-->

### Summary
Removed `_mod_2pi` function.


### Details and comments
It is similiar to Qiskit/qiskit-ibm-provider#689




Patch:
diff --git a/qiskit/dagcircuit/dagcircuit.py b/qiskit/dagcircuit/dagcircuit.py
index 6ecc1f08e..126f19f1b 100644
--- a/qiskit/dagcircuit/dagcircuit.py
+++ b/qiskit/dagcircuit/dagcircuit.py
@@ -23,7 +23,6 @@ directly from the graph.
 from collections import OrderedDict, defaultdict, deque, namedtuple
 import copy
 import math
-import warnings
 from typing import Dict, Generator, Any, List
 
 import numpy as np
@@ -657,16 +656,8 @@ class DAGCircuit:
             DAGCircuitError: if a leaf node is connected to multiple outputs
 
         """
-        if qargs is None:
-            _warn_none_args()
-            qargs = ()
-        else:
-            qargs = tuple(qargs)
-        if cargs is None:
-            _warn_none_args()
-            cargs = ()
-        else:
-            cargs = tuple(cargs)
+        qargs = tuple(qargs)
+        cargs = tuple(cargs)
 
         if self._operation_may_have_bits(op):
             # This is the slow path; most of the time, this won't happen.
@@ -710,16 +701,8 @@ class DAGCircuit:
         Raises:
             DAGCircuitError: if initial nodes connected to multiple out edges
         """
-        if qargs is None:
-            _warn_none_args()
-            qargs = ()
-        else:
-            qargs = tuple(qargs)
-        if cargs is None:
-            _warn_none_args()
-            cargs = ()
-        else:
-            cargs = tuple(cargs)
+        qargs = tuple(qargs)
+        cargs = tuple(cargs)
 
         if self._operation_may_have_bits(op):
             # This is the slow path; most of the time, this won't happen.
@@ -2116,12 +2099,3 @@ class DAGCircuit:
         from qiskit.visualization.dag_visualization import dag_drawer
 
         return dag_drawer(dag=self, scale=scale, filename=filename, style=style)
-
-
-def _warn_none_args():
-    warnings.warn(
-        "Passing 'None' as the qubits or clbits of an operation to 'DAGCircuit' methods"
-        " is deprecated since Qiskit 0.45 and will be removed in Qiskit 1.0.  Instead, pass '()'.",
-        DeprecationWarning,
-        stacklevel=3,
-    )
diff --git a/qiskit/transpiler/passes/scheduling/dynamical_decoupling.py b/qiskit/transpiler/passes/scheduling/dynamical_decoupling.py
index 87bbdbff9..cf8477278 100644
--- a/qiskit/transpiler/passes/scheduling/dynamical_decoupling.py
+++ b/qiskit/transpiler/passes/scheduling/dynamical_decoupling.py
@@ -274,7 +274,7 @@ class DynamicalDecoupling(TransformationPass):
                 if gate is not None:
                     new_dag.apply_operation_back(gate, [dag_qubit], check=False)
 
-            new_dag.global_phase = _mod_2pi(new_dag.global_phase + sequence_gphase)
+            new_dag.global_phase = new_dag.global_phase + sequence_gphase
 
         return new_dag
 
@@ -283,11 +283,3 @@ class DynamicalDecoupling(TransformationPass):
         if self._target is None or self._target.instruction_supported(gate.name, qargs=(qarg,)):
             return True
         return False
-
-
-def _mod_2pi(angle: float, atol: float = 0):
-    """Wrap angle into interval [-π,π). If within atol of the endpoint, clamp to -π"""
-    wrapped = (angle + np.pi) % (2 * np.pi) - np.pi
-    if abs(wrapped - np.pi) < atol:
-        wrapped = -np.pi
-    return wrapped
diff --git a/qiskit/transpiler/passes/scheduling/padding/dynamical_decoupling.py b/qiskit/transpiler/passes/scheduling/padding/dynamical_decoupling.py
index 2d4114f3c..913713356 100644
--- a/qiskit/transpiler/passes/scheduling/padding/dynamical_decoupling.py
+++ b/qiskit/transpiler/passes/scheduling/padding/dynamical_decoupling.py
@@ -394,8 +394,7 @@ class PadDynamicalDecoupling(BasePadding):
                 gate_length = self._dd_sequence_lengths[qubit][dd_ind]
                 self._apply_scheduled_op(dag, idle_after, gate, qubit)
                 idle_after += gate_length
-
-        dag.global_phase = self._mod_2pi(dag.global_phase + sequence_gphase)
+        dag.global_phase = dag.global_phase + sequence_gphase
 
     @staticmethod
     def _resolve_params(gate: Gate) -> tuple:
@@ -407,11 +406,3 @@ class PadDynamicalDecoupling(BasePadding):
             else:
                 params.append(p)
         return tuple(params)
-
-    @staticmethod
-    def _mod_2pi(angle: float, atol: float = 0):
-        """Wrap angle into interval [-π,π). If within atol of the endpoint, clamp to -π"""
-        wrapped = (angle + np.pi) % (2 * np.pi) - np.pi
-        if abs(wrapped - np.pi) < atol:
-            wrapped = -np.pi
-        return wrapped
diff --git a/releasenotes/notes/fix-param-global-phase-31547267f6124552.yaml b/releasenotes/notes/fix-param-global-phase-31547267f6124552.yaml
new file mode 100644
index 000000000..13048f626
--- /dev/null
+++ b/releasenotes/notes/fix-param-global-phase-31547267f6124552.yaml
@@ -0,0 +1,7 @@
+---
+fixes:
+  - |
+    Fixed compatibility of :class:`.DynamicalDecoupling` and
+    :class:`.PadDynamicalDecoupling` with circuits that have a parameterized
+    global phase.
+    Fixed `#10569 <https://github.com/Qiskit/qiskit-terra/issues/10569>`__.
diff --git a/releasenotes/notes/remove-dag-none-be220777dc246803.yaml b/releasenotes/notes/remove-dag-none-be220777dc246803.yaml
new file mode 100644
index 000000000..44fbd7d13
--- /dev/null
+++ b/releasenotes/notes/remove-dag-none-be220777dc246803.yaml
@@ -0,0 +1,6 @@
+---
+upgrade:
+  - |
+    It is no longer allowable to pass ``None`` as the ``qargs`` or ``cargs`` parameters in
+    :meth:`.DAGCircuit.apply_operation_back` and :meth:`~.DAGCircuit.apply_operation_front`.  If you
+    want to explicitly pass an empty argument, use the empty tuple ``()`` instead.


Test patch:
diff --git a/test/python/dagcircuit/test_dagcircuit.py b/test/python/dagcircuit/test_dagcircuit.py
index 9d73ac5a1..b539ff3d5 100644
--- a/test/python/dagcircuit/test_dagcircuit.py
+++ b/test/python/dagcircuit/test_dagcircuit.py
@@ -487,18 +487,6 @@ class TestDagApplyOperation(QiskitTestCase):
         self.assertEqual(len(list(self.dag.nodes())), 16)
         self.assertEqual(len(list(self.dag.edges())), 17)
 
-    def test_apply_operation_rejects_none(self):
-        """Test that the ``apply_operation_*`` methods warn when given ``None``."""
-        noop = Instruction("noop", 0, 0, [])
-        with self.assertWarnsRegex(DeprecationWarning, "Passing 'None'"):
-            self.dag.apply_operation_back(noop, None, ())
-        with self.assertWarnsRegex(DeprecationWarning, "Passing 'None'"):
-            self.dag.apply_operation_back(noop, (), None)
-        with self.assertWarnsRegex(DeprecationWarning, "Passing 'None'"):
-            self.dag.apply_operation_front(noop, None, ())
-        with self.assertWarnsRegex(DeprecationWarning, "Passing 'None'"):
-            self.dag.apply_operation_front(noop, (), None)
-
     def test_edges(self):
         """Test that DAGCircuit.edges() behaves as expected with ops."""
         x_gate = XGate().c_if(*self.condition)
diff --git a/test/python/transpiler/test_dynamical_decoupling.py b/test/python/transpiler/test_dynamical_decoupling.py
index b74091dd7..e53fb9b02 100644
--- a/test/python/transpiler/test_dynamical_decoupling.py
+++ b/test/python/transpiler/test_dynamical_decoupling.py
@@ -1031,6 +1031,25 @@ class TestPadDynamicalDecoupling(QiskitTestCase):
         expected.delay(200, [0])
         self.assertEqual(expected, scheduled)
 
+    def test_paramaterized_global_phase(self):
+        """Test paramaterized global phase in DD circuit.
+        See:https://github.com/Qiskit/qiskit-terra/issues/10569
+        """
+        dd_sequence = [XGate(), YGate()] * 2
+        qc = QuantumCircuit(1, 1)
+        qc.h(0)
+        qc.delay(1700, 0)
+        qc.y(0)
+        qc.global_phase = Parameter("a")
+        pm = PassManager(
+            [
+                ALAPScheduleAnalysis(self.durations),
+                PadDynamicalDecoupling(self.durations, dd_sequence),
+            ]
+        )
+
+        self.assertEqual(qc.global_phase + np.pi, pm.run(qc).global_phase)
+
 
 if __name__ == "__main__":
     unittest.main()