Skip to content

InstructionDurations.from_backend(...) does not support BackendV2 #12760

@1ucian0

Description

@1ucian0

Environment

  • Qiskit version: 1.2.0.dev0+8f6714d
  • Python version: 3.8.19
  • Operating system: MacOs

What is happening?

While migrating test/python/transpiler/test_instruction_durations.py to BackendV2 (see #12660 for context), I realized that InstructionDurations.from_backend does not support BackendV2 instances.

How can we reproduce the issue?

from qiskit.providers.fake_provider import GenericBackendV2
from qiskit.transpiler import InstructionDurations

backend = GenericBackendV2(num_qubits=2, calibrate_instructions=True, seed=42)
InstructionDurations.from_backend(backend)
AttributeError: 'GenericBackendV2' object has no attribute 'properties'

What should happen?

Either this method (preferred option) or a potential InstructionDurations.from_backendV2 should support creating an InstructionDurations from a BackendV2, the current preferred way.

Any suggestions?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions