Skip to content

Qubit stop time #8729

@ewoutvandenberg

Description

@ewoutvandenberg

Environment

Latest Qiskit Terra version (v.0.21.2)

What is happening?

In the qubit_stop_time function, the maximum stop time is returned when all qubits are flagged as completed (current line 4971). If one of the provided qubits only has delays on it, this condition is never satisfied and zero will be returned at the end of the function. The stop time of two qubits, one with gates and one with only delays, will therefore be zero.

How can we reproduce the issue?

See source code.

What should happen?

Not sure if the behavior described in the "What is happening" section is correct, the docstring says the function should "Return the stop time of the last instruction, excluding delays, over the supplied qubits."

Any suggestions?

Perhaps return the maximum stop time of all qubits marked as done at the end of the instruction loop, and zero if none of the qubits is marked as done. Using a set of completed qubits rather than a dictionary may make it easier to determine the length of completed qubits. A similar change may be needed in determining the qubit start time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions