SpectrumData#

class scqubits.core.storage.SpectrumData(energy_table, system_params, param_name=None, param_vals=None, state_table=None, matrixelem_table=None, **kwargs)[source]#

Container holding energy and state data as a function of a particular parameter that is varied. Also stores all other system parameters used for generating the set, and provides method for writing data to file.

Parameters:
  • energy_table (ndarray) – energy eigenvalues stored for each param_vals point, [[evals for first param_val], [evals for second param_val], …]

  • system_params (Dict[str, Any]) – info about system parameters

  • param_name (Optional[str]) – name of parameter being varied

  • param_vals (Optional[ndarray]) – parameter values for which spectrum data are stored

  • state_table (Union[List[QutipEigenstates], np.ndarray, List[np.ndarray]]) – eigenstate data stored for each param_vals point, either as pure np.ndarray or list of qutip.qobj

  • matrixelem_table (Optional[ndarray]) – matrix element data stored for each param_vals point

Return type:

SerializableType

Methods

SpectrumData.__init__(energy_table, ...[, ...])

SpectrumData.add_data(**kwargs)

Adds one or several data sets to the DataStorage object.

SpectrumData.create_from_file(filename)

Read initdata and spectral data from file, and use those to create a new SpectrumData object.

SpectrumData.deserialize(io_data)

Take the given IOData and return an instance of the described class, initialized with the data stored in io_data.

SpectrumData.filewrite(filename)

Convenience method bound to the class.

SpectrumData.plot_evals_vs_paramvals([...])

Plots eigenvalues of as a function of one parameter, as stored in SpectrumData object.

SpectrumData.serialize()

Convert the content of the current class instance into IOData format.

SpectrumData.subtract_ground()

Subtract ground state energies from spectrum

add_data(**kwargs)#

Adds one or several data sets to the DataStorage object.

Parameters:

**kwargsdataname=data with data an array-like object. The data set will be accessible through <DataStorage>.dataname.

Return type:

None

classmethod create_from_file(filename)#

Read initdata and spectral data from file, and use those to create a new SpectrumData object.

Returns:

new SpectrumData object, initialized with data read from file

Return type:

SpectrumData

Parameters:

filename (str) –

classmethod deserialize(io_data)#

Take the given IOData and return an instance of the described class, initialized with the data stored in io_data.

Return type:

TypeVar(SerializableType, bound= Serializable)

Parameters:

io_data (IOData) –

filewrite(filename)#

Convenience method bound to the class. Simply accesses the write function.

Return type:

None

Parameters:

filename (str) –

plot_evals_vs_paramvals(which=-1, subtract_ground=False, label_list=None, **kwargs)[source]#

Plots eigenvalues of as a function of one parameter, as stored in SpectrumData object.

Parameters:
  • which (Union[int, List[int]]) – default: -1, signals to plot all eigenvalues; int>0: plot eigenvalues 0..int-1; list(int) plot the specific eigenvalues (indices listed)

  • subtract_ground (bool) – whether to subtract the ground state energy, default: False

  • label_list (Optional[List[str]]) – list of labels associated with the individual curves to be plotted

  • **kwargs – standard plotting option (see separate documentation)

Return type:

Tuple[Figure, Axes]

Returns:

Figure and Axes objects for further processing

serialize()#

Convert the content of the current class instance into IOData format.

Return type:

IOData

subtract_ground()[source]#

Subtract ground state energies from spectrum

Return type:

None