Repository: Qiskit/qiskit (python)

Issue:
Replace references to master with references to main in maintainers_guide.rst
There are several mentions of the ``master`` branch in the file ``docs/maintainers_guide.rst`` which is no longer a branch in the repository and has been presumably supplanted by ``main``. Suggesting replacing these mentions of ``master`` with mentions to ``main``.

Pull request description:
Replaced references to master with references to main in docs/maintainers_guide.rst
Replaced references to master with references to main in docs/maintainers_guide.rst (#11196)

* Added a release notes file

* Substituted mentions of the master branch with mentions to main in the file docs/maintainers_guide.rst

<!--
⚠️ 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.
- [x] I have updated the documentation accordingly.
- [x] I have read the CONTRIBUTING document.
-->

### Summary
fixes #11196 (occurrences of master are replaced with occurrences of main)


### Details and comments
There is currently only a main branch, so mentions of master seem to intend to refer to the main branch. The text in docs/maintainers_guide.rst has been adjusted accordingly so that all mentions of master are now mentions of main.



Patch:
diff --git a/docs/maintainers_guide.rst b/docs/maintainers_guide.rst
index e8c771253..ed2a6b508 100644
--- a/docs/maintainers_guide.rst
+++ b/docs/maintainers_guide.rst
@@ -11,7 +11,7 @@ Stable Branch Policy
 ====================
 
 The stable branch is intended to be a safe source of fixes for high-impact
-bugs and security issues that have been fixed on master since a
+bugs and security issues that have been fixed on ``main`` since a
 release. When reviewing a stable branch PR, we must balance the risk
 of any given patch with the value that it will provide to users of the
 stable branch. Only a limited class of changes are appropriate for
@@ -29,8 +29,8 @@ change:
     also refactors a lot of code, it's probably worth thinking about
     what a less risky fix might look like.
 -   Whether the fix is already on ``main``: a change must be a backport of
-    a change already merged onto master, unless the change simply does
-    not make sense on master.
+    a change already merged onto ``main``, unless the change simply does
+    not make sense on ``main``.
 
 
 Backporting
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>`__.


Test patch:
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()