Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot apply dynamical decoupling on a circuit with parameterized global phase #10569

Closed
dieris opened this issue Aug 4, 2023 · 2 comments · Fixed by #10631
Closed

Cannot apply dynamical decoupling on a circuit with parameterized global phase #10569

dieris opened this issue Aug 4, 2023 · 2 comments · Fixed by #10631
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@dieris
Copy link
Contributor

dieris commented Aug 4, 2023

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?

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 Qiskit/qiskit-ibm-provider#689

@dieris dieris added the bug Something isn't working label Aug 4, 2023
@Cryoris Cryoris added the good first issue Good for newcomers label Aug 15, 2023
@Cryoris
Copy link
Contributor

Cryoris commented Aug 15, 2023

Thanks for reporting this. I'm labelling this as good first issue as it can be solved analogously to the referenced PR, Qiskit/qiskit-ibm-provider#689.

@Raghav-Bell
Copy link
Contributor

@Cryoris Please assign this issue to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
3 participants