CircuitPlot

class scqubits.core.circuit_plotting.CircuitPlot[source]

Methods

CircuitPlot.__init__()

CircuitPlot.generate_wf_plot_data([which, ...])

Returns treated wave function of the current Circuit instance for the specified variables.

CircuitPlot.plot_potential(**kwargs)

Returns the plot of the potential for the circuit instance.

CircuitPlot.plot_wavefunction([which, mode, ...])

Returns the plot of the wavefunction in the requested variables.

CircuitPlot.potential_energy(**kwargs)

Returns the full potential of the circuit evaluated in a grid of points as chosen by the user or using default variable ranges.

generate_wf_plot_data(which=0, mode='abs-sqr', var_indices=(1,), eigensys=None, change_discrete_charge_to_phi=True, grids_dict=None)[source]

Returns treated wave function of the current Circuit instance for the specified variables.

Parameters:
  • which (int) – integer to choose which wave function to plot

  • mode (str) – “abs”, “real”, “imag”, “abs-sqr” - decides which part of the wave function is plotted.

  • var_indices (Tuple[int]) – A tuple containing the indices of the variables chosen to plot the wave function in. Should not have more than 2 entries.

  • eigensys (ndarray) – eigenvalues and eigenstates of the Circuit instance; if not provided, calling this method will perform a diagonalization to obtain these.

  • extended_variable_basis (str) – The basis in which the extended variables are plotted. Can be either “phi” or “charge”.

  • periodic_variable_basis (str) – The basis in which the periodic variables are plotted. Can be either “phi” or “charge”.

  • grids_dict (Dict[int, Grid1d]) – A dictionary which pairs var indices with the requested grids used to create the plot.

  • change_discrete_charge_to_phi (bool)

plot_potential(**kwargs)[source]

Returns the plot of the potential for the circuit instance. Make sure to not set more than two variables in the instance.potential to a Numpy array, as the the code cannot plot with more than 3 dimensions.

Parameters:

θ<index> – value(s) for the variable \(\theta_i\) occurring in the potential.

Return type:

Tuple[Figure, Axes]

Returns:

Returns a axes and figure for further editing.

plot_wavefunction(which=0, mode='abs-sqr', var_indices=(1,), esys=None, change_discrete_charge_to_phi=True, zero_calibrate=True, grids_dict={}, **kwargs)[source]

Returns the plot of the wavefunction in the requested variables. At most 2 numbers of variables for wavefunction can be specified as plotting axis. If the number of plotting variables for wave function is smaller than the number of variables in the circuit, the marginal probability distribution of the state with respect to the specified variables is plotted. This means the norm square of the wave function is integrated over the rest of the variables and is then plotted.

Parameters:
  • which – integer to choose which wave function to plot

  • mode (str) – “abs”, “real”, “imag”, “abs-sqr” - decides which part of the wave function is plotted, by default “abs-sqr”

  • var_indices (Tuple[int]) – A tuple containing the indices of the variables chosen to plot the wave function in. It should not have more than 2 entries.

  • esys (Tuple[ndarray, ndarray]) – The object returned by the method .eigensys, is used to avoid the re-evaluation of the eigen systems if already evaluated.

  • change_discrete_charge_to_phi (bool) – If True, the wave function is plotted in the phi basis for the periodic variables. If False, the wave function is plotted in the charge basis for the periodic variables.

  • zero_calibrate (bool, optional) – if True, colors are adjusted to use zero wavefunction amplitude as the neutral color in the palette

  • grids_dict (Dict[int, Grid1d]) – A dictionary which pairs var indices with the grids used to create the plot. The way to specify the grids is as follows: 1. For extended variables, the grids should be of type discretization.Grid1d. 2. When the discretized phi basis is used for the extended variable, the grids used in the diagonalization is used to plot the wave function instead of the grids specified here. 3. For periodic variables, only if change_discrete_charge_to_phi is True, the grid specified here will used for plotting. The grid is specified as an integer which is the number of points in the grid. The grid has a minimum and maximum value of -pi and pi respectively. 4. If the grid is not specified for a variable that requires a grid for plotting (i.e. extended variable with harmonic oscillator basis, or periodic variable with change_discrete_charge_to_phi set to True), the default grid is used.

  • **kwargs – plotting parameters

Return type:

Tuple[Figure, Axes]

Returns:

Returns a axes and figure for further editing.

potential_energy(**kwargs)[source]

Returns the full potential of the circuit evaluated in a grid of points as chosen by the user or using default variable ranges.

Parameters:

θ<index> – value(s) for variable :math:` heta_i` in the potential.

Return type:

ndarray