quchip.viz.chip¶
Chip topology (pyvis) and dressed-spectrum (matplotlib) plots.
Functions
|
Plot dressed chip eigenenergies relative to the ground state. |
|
Write an interactive HTML chip topology and return its path. |
- quchip.viz.chip.plot_graph(chip, path='chip_topology.html', *, full=True, exclude=None, layout='force_atlas', height='800px', width='100%')[source]¶
Write an interactive HTML chip topology and return its path.
The rendered graph is a standalone, offline-capable HTML file: devices are drawn as dots and drives as diamonds, with couplings, control wiring, and crosstalk distinguished by edge colour and dash pattern. Node colours are auto-assigned per class (
DuffingTransmon,Resonator,ChargeDrive, …) so new device/drive kinds are visually distinct without user intervention.Layouts:
"force_atlas"(default) —force_atlas_2basedphysics with larger/heavier computational devices so the register sits centrally and auxiliary couplers/drives orbit."hierarchical"— pyvishrepulsionon explicit levels (computational devices → other devices/couplings → drives), useful for chips with many auxiliary drives or cross-resonance lines.
exclude takes priority over full; passing
full=Falsewith no exclude hides drives and crosstalk (chip-only view). Every coupling is rendered as its own junction node splitting the device-device edge (so an edge-pump control has a node to attach to); excluding couplings also removes any edge-pump controls that would otherwise dangle (see_collect_topology()).- Parameters:
chip (Chip) – The chip to visualise.
path (str) – Destination
.htmlpath. Returned for convenience.full (bool) – If
False, hide drives and crosstalk unless exclude is given.exclude (set of str, optional) – Any of
{"coupling", "drive", "crosstalk"}to hide entirely.layout (str) –
"force_atlas"or"hierarchical".height (str) – CSS dimensions forwarded to
pyvis.network.Network.width (str) – CSS dimensions forwarded to
pyvis.network.Network.
- Returns:
path, unchanged — returned for convenience so the call can be chained into whatever opens/serves the file.
- Return type:
- Raises:
ImportError –
pyvisis not installed.ValueError – layout is not one of
"force_atlas"or"hierarchical".
- quchip.viz.chip.plot_energy_levels(chip, *, ax=None, max_states=None)[source]¶
Plot dressed chip eigenenergies relative to the ground state.
Each level is rendered as a horizontal bar annotated with its dressed represented-basis tuple label
|n_1 n_2 ...>— the per-device bare-basis assignment selected by the chip’s dressing analysis (seechip.analysis). The y-axis is energy in GHz; the ground state is shifted to zero.- Parameters:
- Returns:
The figure holding the energy-ladder axes (
ax.figurewhen ax was given).- Return type:
Figure
Examples
>>> import quchip as qc >>> from quchip.viz.chip import plot_energy_levels >>> qb0 = qc.DuffingTransmon(freq=5.0, anharmonicity=-0.3, levels=3) >>> qb1 = qc.DuffingTransmon(freq=5.2, anharmonicity=-0.3, levels=3) >>> chip = qc.Chip([qb0, qb1], [qc.Capacitive(qb0, qb1, g=0.005)]) >>> fig = plot_energy_levels(chip, max_states=6)