-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Qubit stop time #8729
Labels
bug
Something isn't working
Comments
Please can you provide a minimal code example that shows this function not working as you expect, and what output you would expect to receive from it? |
import qiskit
circuit = qiskit.QuantumCircuit(2)
circuit.x(0)
durations = qiskit.transpiler.InstructionDurations([('x',(0,), 80, 'dt')])
transpiled = qiskit.transpile(circuit,
initial_layout=[0,1],
basis_gates=['x'],
optimization_level=0,
scheduling_method='asap',
instruction_durations = durations)
print(transpiled.qubit_stop_time(0)) # 80
print(transpiled.qubit_stop_time(1)) # 0
print(transpiled.qubit_stop_time(0,1)) # Should be 80? |
JustinWoodring
added a commit
to JustinWoodring/qiskit
that referenced
this issue
Oct 24, 2023
3 tasks
Here is a PR that addresses this issue, #11097. |
github-merge-queue bot
pushed a commit
that referenced
this issue
Feb 13, 2025
* Fix incorrect stop time bug #8729 * Apply suggestions from code review Minor update on the release note * Update qiskit/circuit/quantumcircuit.py Co-authored-by: Luciano Bello <bel@zurich.ibm.com> * Update releasenotes/notes/fix-incorrect-qubit-stop-time-d0e056f60a01dd52.yaml Co-authored-by: Luciano Bello <bel@zurich.ibm.com> --------- Co-authored-by: Toshinari Itoko <15028342+itoko@users.noreply.github.com> Co-authored-by: Luciano Bello <bel@zurich.ibm.com>
mergify bot
pushed a commit
that referenced
this issue
Feb 13, 2025
* Fix incorrect stop time bug #8729 * Apply suggestions from code review Minor update on the release note * Update qiskit/circuit/quantumcircuit.py Co-authored-by: Luciano Bello <bel@zurich.ibm.com> * Update releasenotes/notes/fix-incorrect-qubit-stop-time-d0e056f60a01dd52.yaml Co-authored-by: Luciano Bello <bel@zurich.ibm.com> --------- Co-authored-by: Toshinari Itoko <15028342+itoko@users.noreply.github.com> Co-authored-by: Luciano Bello <bel@zurich.ibm.com> (cherry picked from commit 6842268)
3 tasks
github-merge-queue bot
pushed a commit
that referenced
this issue
Feb 14, 2025
* Fix incorrect stop time bug #8729 * Apply suggestions from code review Minor update on the release note * Update qiskit/circuit/quantumcircuit.py Co-authored-by: Luciano Bello <bel@zurich.ibm.com> * Update releasenotes/notes/fix-incorrect-qubit-stop-time-d0e056f60a01dd52.yaml Co-authored-by: Luciano Bello <bel@zurich.ibm.com> --------- Co-authored-by: Toshinari Itoko <15028342+itoko@users.noreply.github.com> Co-authored-by: Luciano Bello <bel@zurich.ibm.com> (cherry picked from commit 6842268) Co-authored-by: Justin Woodring <jwoodrg@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The text was updated successfully, but these errors were encountered: