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 parametersparam_name (
str
) – name of parameter being variedparam_vals (
ndarray
) – parameter values for which spectrum data are storedstate_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 (
ndarray
) – matrix element data stored for each param_vals point
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.
Plots eigenvalues of as a function of one parameter, as stored in
SpectrumData
object.Convert the content of the current class instance into IOData format.
Subtract ground state energies from spectrum.
- add_data(**kwargs)¶
Adds one or several data sets to the DataStorage object.
- Parameters:
**kwargs –
dataname=data
withdata
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:
- 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: Falselabel_list (
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: