SpectrumLookup Class¶
SpectrumLookup¶
- class scqubits.core.spec_lookup.SpectrumLookup(framework, dressed_specdata, bare_specdata_list, auto_run=True)[source]¶
The SpectrumLookup is an integral building block of the HilbertSpace and ParameterSweep classes. In both cases it provides a convenient way to translate back and forth between labelling of eigenstates and eigenenergies via the indices of the dressed spectrum j = 0, 1, 2, … on one hand, and the bare product-state labels of the form (0,0,0), (0,0,1), (0,1,0),… (here for the example of three subsys_list). The lookup table stored in a SpectrumLookup instance should be generated by calling <HilbertSpace>.generate_lookup() in the case of a HilbertSpace object. For ParameterSweep objects, the lookup table is generated automatically upon init, or manually via <ParameterSweep>.run().
- Parameters
framework (
Union
[ParameterSweep
,HilbertSpace
,None
]) –dressed_specdata (
SpectrumData
) – dressed spectral data needed for generating the lookup mappingbare_specdata_list (
List
[SpectrumData
]) – bare spectral data needed for generating the lookup mappingauto_run (
bool
) – boolean variable that determines whether the lookup data is immediately generated upon initialization
- bare_eigenenergies(subsys, param_index=0)[source]¶
Return list of bare eigenenergies for given subsystem.
- Parameters
subsys (
QuantumSystem
) – Hilbert space subsystem for which bare eigendata is to be looked upparam_index (
int
) – position index of parameter value in question
- Return type
ndarray
- Returns
bare eigenenergies for the specified subsystem and the external parameter fixed to the value indicated by its index
- bare_eigenstates(subsys, param_index=0)[source]¶
Return ndarray of bare eigenstates for given subsystem and parameter index. Eigenstates are expressed in the basis internal to the subsystem.
- Return type
ndarray
- bare_index(dressed_index, param_index=0)[source]¶
For given dressed index, look up the corresponding bare index.
- Return type
Optional
[Tuple
[int
,...
]]- Returns
Bare state specification in tuple form. Example: (1,0,3) means subsystem 1 is in bare state 1, subsystem 2 in bare state 0, and subsystem 3 in bare state 3.
- bare_productstate(bare_index)[source]¶
Return the bare product state specified by bare_index.
- Parameters
bare_index (
Tuple
[int
,...
]) –- Return type
Qobj
- Returns
ket in full Hilbert space
- 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
- classmethod deserialize(io_data)[source]¶
Take the given IOData and return an instance of the described class, initialized with the data stored in io_data.
- Return type
- dressed_eigenenergies(param_index=0)[source]¶
Return the array of dressed eigenenergies
- Parameters
question (position index of parameter value in) –
- Return type
ndarray
- Returns
dressed eigenenergies for the external parameter fixed to the value indicated by the provided index
- dressed_eigenstates(param_index=0)[source]¶
Return the list of dressed eigenvectors
- Parameters
param_index (
int
) – position index of parameter value in question, if called from within ParameterSweep- Return type
List
[QutipEigenstates
]- Returns
dressed eigenvectors for the external parameter fixed to the value indicated by the provided index
- dressed_index(bare_labels, param_index=0)[source]¶
For given bare product state return the corresponding dressed-state index.
- Parameters
bare_labels (
Tuple
[int
,...
]) – bare_labels = (index, index2, …)param_index (
int
) – index of parameter value of interest
- Return type
Optional
[int
]- Returns
dressed state index closest to the specified bare state
- energy_bare_index(bare_tuple, param_index=0)[source]¶
Look up dressed energy most closely corresponding to the given bare-state labels
- Parameters
bare_tuple (
Tuple
[int
,...
]) – bare state indicesparam_index (
int
) – index specifying the position in the self.param_vals array
- Return type
Optional
[float
]- Returns
dressed energy, if lookup successful
- energy_dressed_index(dressed_index, param_index=0)[source]¶
Look up the dressed eigenenergy belonging to the given dressed index.
- Parameters
dressed_index (
int
) – index of dressed state of interestparam_index (
int
) – relevant if used in the context of a ParameterSweep
- Return type
float
- Returns
dressed energy
- filewrite(filename)¶
Convenience method bound to the class. Simply accesses the write function.
- Return type
None