# Visualizing Program Traces The Nexus Console can display traces for jobs run on emulators that support runtime tracing. The viewer currently shows only the first shot of each emulation run. The trace shows which operations ran on each qubit and when. Use it to estimate how efficiently your program might run on hardware, spot unexpected behavior, and identify opportunities for improvement. Compare traces from different implementations of the same quantum-classical algorithm to see how many qubits each uses, how effectively it parallelizes operations across qubits, and how long each shot takes. ## Open a trace Open the execution job in the Nexus Console. In the **Runtime Trace** column, select **View** next to the job item to open its trace in a new tab. To inspect another trace, return to the job and select **View** for that item. Select the download icon next to **View** to save the trace as a JSON file. ```{image} images/runtime-trace-action.png :alt: The Nexus execution job item list with View and download buttons in the Runtime Trace column. :width: 100% ``` ## Explore the timeline Each horizontal wire represents a qubit, and time runs from left to right. Colored segments show gates, resets, and measurements. Lines connect the two wires involved in a two-qubit gate. Hover over a segment to see its timing and details, including the measurement outcome when the trace records one. The viewer shows gates native to the emulated system. In a Helios trace, for example, `Rxy` is a single-qubit rotation about an axis in the XY plane, and `Rzz` is a two-qubit ZZ rotation. Guppy exposes these as `phased_x` and `zz_phase`. See the [Guppy Helios gate definitions](https://docs.quantinuum.com/guppy/api/generated/guppylang.std.qsystem.helios.html). The walkthrough shows how to inspect an operation, zoom into the timeline, find shortcuts, compress idle time, and reorder or rename qubits. ```{raw} html ``` - Drag the plot to pan. Use **Zoom in**, **Zoom out**, or **Select to zoom** in the toolbar. Double-click the plot to reset both axes. - Open **Plot controls** to see shot statistics and use **Operations** to hide or show operation types. - Open **Shortcuts & gestures** in the toolbar for axis-specific zoom shortcuts. ## Inspect a busy trace - In **Plot controls → Idle time**, enable **Compress globally idle time** to shrink gaps where all qubits are idle. **Idle width** sets their displayed width. Tooltips still show the original timing. - Right-click a qubit label to see its statistics or give it a name for the current view. - In **Plot controls → Wire controls**, use **Wire spacing** to adjust the vertical layout. Under **Qubit order**, choose **Reduce 2qb gate distances** to bring frequently interacting qubits closer together across the trace. - Choose **Manual** to drag wires by their labels. Hold **Shift** while clicking to select a block of wires. **Alt/Option + drag** over a time range to reduce two-qubit gate distances within that range. Use **Cmd/Ctrl + Z** to undo a reorder.