You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context and Motivation
In the current implementation of Qiskit, the transpilation process can often take significant time, especially for large quantum circuits targeting complex backends. Users typically experience uncertainty about the progress of the transpilation process, as the output provides no real-time updates or estimates of completion time. This lack of feedback can lead to a frustrating user experience, particularly when debugging or optimizing transpilation workflows.
By integrating a progress bar such as TQDM into the transpiler passes, users can gain better visibility into the progress of transpilation. This would:
Improve Usability: Provide real-time feedback on the progress of individual passes and the overall transpilation process.
Enhance Debugging: Help users identify bottlenecks in specific passes by showing their durations.
Increase Productivity: Allow users to estimate completion time for long-running transpilation tasks, enabling better resource allocation.
Proposed Implementation
TQDM Integration: Add TQDM progress bars within the transpiler to visually track the progress of individual passes and the overall pass manager flow.
Configurable Output: Allow users to enable or disable the progress bar via a parameter in the PassManager object, e.g., show_progress=True.
Detailed Information:
Display the name of the current pass being executed.
Show the percentage of completion for the overall pass manager flow.
Optionally, include the estimated time remaining.
Example Usage
fromqiskitimportQuantumCircuitfromqiskit.transpilerimportPassManagerfromqiskit.providers.fake_providerimportFakeGuadalupefromqiskit.transpiler.passesimportUnroll3qOrMore, CXDirection, LayoutSelection# Create a circuitcircuit=QuantumCircuit(4)
circuit.h(0)
circuit.cx(0, 1)
circuit.cx(1, 2)
circuit.measure_all()
# Choose backendbackend=FakeGuadalupe()
# Create a Pass Manager with progress tracking enabledpasses= [
Unroll3qOrMore(),
CXDirection(backend.properties()),
LayoutSelection()
]
pass_manager=PassManager(passes, show_progress=True)
# Run the circuit through the Pass Manageroptimized_circuit=pass_manager.run(circuit)
Impact
This feature would significantly enhance the developer and user experience for Qiskit, particularly for those working with large-scale circuits or conducting extensive performance optimizations. Adding a progress bar aligns with modern usability expectations for long-running computational processes and demonstrates Qiskit’s commitment to developer-friendly tools.
The text was updated successfully, but these errors were encountered:
Users typically experience uncertainty about the progress of the transpilation process, as the output provides no real-time updates or estimates of completion time.
The compiler doesn't know these things either - it's not calculable, and any estimate would be a completely wild stab in the dark. There's no real measure of "how much work is left", in most cases. We generally don't even know how many tasks are left: many optimisations run in a loop until a fixed point is hit, so the number of iterations is indeterminate; some passes only run if a precondition is violated by the optimisation loop, which can't be known ahead of time.
You can observe passes completing by passing an arbitrary Python callable to the callback argument of PassManager.run, so if you wanted, you could print out each pass name as it completed, but PassManager can't tell you reliably at any point how many more passes there are to run (dynamically deciding when passes need to be inserted is part of its job).
What should we add?
Context and Motivation
In the current implementation of Qiskit, the transpilation process can often take significant time, especially for large quantum circuits targeting complex backends. Users typically experience uncertainty about the progress of the transpilation process, as the output provides no real-time updates or estimates of completion time. This lack of feedback can lead to a frustrating user experience, particularly when debugging or optimizing transpilation workflows.
By integrating a progress bar such as TQDM into the transpiler passes, users can gain better visibility into the progress of transpilation. This would:
Proposed Implementation
Example Usage
Output Example:
Impact
This feature would significantly enhance the developer and user experience for Qiskit, particularly for those working with large-scale circuits or conducting extensive performance optimizations. Adding a progress bar aligns with modern usability expectations for long-running computational processes and demonstrates Qiskit’s commitment to developer-friendly tools.
The text was updated successfully, but these errors were encountered: