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

An error is raised when the scheduled circuit with PadDynamicalDecoupling pass from qiskit_ibm_runtime.transpiler.passes.scheduling is drawn  #1736

Open
DikshantDulal opened this issue Jun 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@DikshantDulal
Copy link

DikshantDulal commented Jun 10, 2024

Describe the bug
When drawing the scheduled circuit with PadDynamicalDecoupling pass from qiskit_ibm_runtime.transpiler.passes.scheduling , an error is returned that says

TypeError                                 Traceback (most recent call last)
Cell In[2], [line 1](vscode-notebook-cell:?execution_count=2&line=1)
----> [1](vscode-notebook-cell:?execution_count=2&line=1) draw(dd_pm_ibm_runtime.run(t_qc), style=IQXStandard(**my_style), show_idle=False, show_delays=False)

TypeError: can only concatenate tuple (not "int") to tuple

Steps to reproduce

from qiskit.circuit.random import random_circuit
from qiskit_ibm_runtime.fake_provider import FakeOsaka
from qiskit import transpile

from qiskit.transpiler import PassManager
from qiskit.visualization.timeline import draw, IQXStandard
from qiskit.circuit.library.standard_gates import XGate


fake_backend = FakeOsaka()
num_qubits = 6
depth = 4
seed = 42
qc = random_circuit(num_qubits,depth,measure=False, seed=seed)
qc.measure_all()
t_qc = transpile(qc, backend=fake_backend, optimization_level=3, scheduling_method='alap')    
dd_sequence = [XGate(), XGate()]


from qiskit_ibm_runtime.transpiler.passes.scheduling import ALAPScheduleAnalysis as alap_ibm_runtime
from qiskit_ibm_runtime.transpiler.passes.scheduling import PadDynamicalDecoupling as pad_dd_ibm_runtime


dd_pm_ibm_runtime = PassManager(
    [
        alap_ibm_runtime(fake_backend.instruction_durations),
        pad_dd_ibm_runtime(durations=fake_backend.instruction_durations, dd_sequences=dd_sequence),
    ]
)


my_style = {
    'formatter.general.fig_width': 40,
    'formatter.general.fig_unit_height': 1,
}

draw(dd_pm_ibm_runtime.run(t_qc), style=IQXStandard(**my_style), show_idle=False, show_delays=False)

Expected behavior
The expected behaviour should be to draw the circuit without raising any error like when PadDynamicalDecoupling is called from qiskit.transpiler. The following code draws the scheduled circuit.

from qiskit.transpiler.passes.scheduling import ALAPScheduleAnalysis as alap_qiskit
from qiskit.transpiler.passes.scheduling import PadDynamicalDecoupling as pad_dd_qiskit

dd_pm_qiskit = PassManager(
    [
        alap_qiskit(fake_backend.instruction_durations),
        pad_dd_qiskit(durations=fake_backend.instruction_durations, dd_sequence=dd_sequence),
    ]
)

draw(dd_pm_qiskit.run(t_qc), style=IQXStandard(**my_style), show_idle=False, show_delays=False)

Suggested solutions

Additional Information

  • qiskit-ibm-runtime version: 0.23.0
  • Python version: Python 3.10.14
  • Operating system: Macbook pro with macOS Sonoma (V 14.5) and Apple M1 pro chip
@DikshantDulal DikshantDulal added the bug Something isn't working label Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant