quchip.viz.device¶
Spectrum and eigenstate plots for each device.
Functions
|
Plot the bare-Hamiltonian eigenenergies of a single device. |
|
Plot the represented-basis probability weights of eigenstate n. |
- quchip.viz.device.plot_energy_levels(device, *, ax=None, color=None, linewidth=2.0)[source]¶
Plot the bare-Hamiltonian eigenenergies of a single device.
Each eigenvalue of
device.hamiltonian()shows as a horizontal bar with its index in the represented basis. The y-axis is energy in GHz. For aDuffingTransmon, the gaps show the anharmonicity directly. For aResonator, the gaps are exactly equal.- Parameters:
device (BaseDevice) – Device whose bare spectrum is plotted.
ax (matplotlib.axes.Axes, optional) – Existing axes to draw on. When
None, the function makes a new figure.color (str, optional) – Line colour for all levels. The default is the first
tab10colour.linewidth (float) – Width of each level bar.
- Returns:
The figure that holds the energy-ladder axes (
ax.figurewhen ax was given).- Return type:
Figure
Examples
>>> import quchip as qc >>> qubit = qc.DuffingTransmon(freq=5.0, anharmonicity=-0.3, levels=4) >>> qubit.plot_energy_levels()
- quchip.viz.device.plot_wavefunction(device, n, *, ax=None, color=None)[source]¶
Plot the represented-basis probability weights of eigenstate n.
Show the eigenvector probabilities in the device’s authored local coordinates. Circuit models can have more native basis coordinates than retained energy levels. The axis follows the actual length of the eigenvector.
- Parameters:
device (BaseDevice) – Device whose eigenstates are diagonalised.
n (int) – Eigenstate index (
0 <= n < device.levels).ax (matplotlib.axes.Axes, optional) – Existing axes to draw on. When
None, the function makes a new figure.color (str, optional) – Bar colour. The default is a
tab10cycle per index.
- Returns:
The figure that holds the bar-chart axes (
ax.figurewhen ax was given).- Return type:
Figure
- Raises:
IndexError – n is outside
[0, device.levels).
Examples
>>> import quchip as qc >>> transmon = qc.DuffingTransmon(freq=5.0, anharmonicity=-0.3, levels=4) >>> transmon.plot_wavefunction(n=1)