SpectrumLookupMixin#
- class scqubits.core.spec_lookup.SpectrumLookupMixin(*args, **kwds)[source]#
SpectrumLookupMixin is used as a mix-in class by ParameterSweep. It makes various spectrum and spectrum lookup related methods directly available at the ParameterSweep level.
Methods
SpectrumLookupMixin.__init__(*args, **kwargs)Checks whether the indices provided fix all the parameters.
Return ndarray of bare eigenstates for given subsystems and parameter index.
SpectrumLookupMixin.bare_eigenvals(subsys[, ...])Return NamedSlotsNdarray of bare eigenenergies for given subsystem, usually to be used with preslicing.
SpectrumLookupMixin.bare_index(dressed_index)For given dressed index, look up the corresponding bare index.
SpectrumLookupMixin.bare_productstate(bare_index)Return the bare product state specified by bare_index.
SpectrumLookupMixin.dressed_index(bare_labels)For given bare product state return the corresponding dressed-state index.
SpectrumLookupMixin.eigensys([param_indices])Return the list of dressed eigenvectors
SpectrumLookupMixin.eigenvals([param_indices])Return the array of dressed eigenenergies - primarily for running the sweep
Look up dressed energy most closely corresponding to the given bare-state labels
Look up the dressed eigenenergy belonging to the given dressed index, usually to be used with pre-slicing
For each parameter value of the parameter sweep, generate the map between bare states and dressed states.
SpectrumLookupMixin.set_npindextuple([...])- rtype
Tuple[Union[int,slice,Tuple[int],List[int]],...]
Attributes
hilbertspace- all_params_fixed(param_indices)[source]#
Checks whether the indices provided fix all the parameters.
- Parameters
param_indices (
Union[slice,tuple]) – Tuple or slice fixing all or a subset of the parameters.- Return type
bool- Returns
True if all parameters are being fixed by param_indices.
- bare_eigenstates(subsys, param_indices=None)[source]#
Return ndarray of bare eigenstates for given subsystems and parameter index. Eigenstates are expressed in the basis internal to the subsystems. Usually to be with pre-slicing.
- Return type
- Parameters
subsys (Union[QubitBaseClass, Oscillator, KerrOscillator, GenericQubit]) –
param_indices (Optional[Tuple[int, ...]]) –
- bare_eigenvals(subsys, param_indices=None)[source]#
Return NamedSlotsNdarray of bare eigenenergies for given subsystem, usually to be used with preslicing.
- Parameters
subsys (
Union[QubitBaseClass, Oscillator, KerrOscillator, GenericQubit]) – Hilbert space subsystem for which bare eigendata is to be looked upparam_indices (
Optional[Tuple[int,...]]) – position indices of parameter values in question
- Return type
- Returns
bare eigenenergies for the specified subsystem and the external parameter fixed to the value indicated by its index
- bare_index(dressed_index, param_indices=None)[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.
- Parameters
dressed_index (int) –
param_indices (Optional[Tuple[int, ...]]) –
- bare_productstate(bare_index)[source]#
Return the bare product state specified by bare_index. Note: no parameter dependence here, since the Hamiltonian is always represented in the bare product eigenbasis.
- Parameters
bare_index (
Tuple[int,...]) –- Return type
Qobj- Returns
ket in full Hilbert space
- dressed_index(bare_labels, param_indices=None)[source]#
For given bare product state return the corresponding dressed-state index.
- Parameters
bare_labels (
Tuple[int,...]) – bare_labels = (index, index2, …)param_indices (
Union[int,slice,Tuple[int],List[int],Tuple[Union[int,slice,Tuple[int],List[int]],...],None]) – indices of parameter values of interest
- Return type
Union[ndarray,int,None]- Returns
dressed state index closest to the specified bare state
- eigensys(param_indices=None)[source]#
Return the list of dressed eigenvectors
- Parameters
param_indices (
Optional[Tuple[int,...]]) – position indices of parameter values in question- Return type
ndarray- Returns
dressed eigensystem for the external parameter fixed to the value indicated by the provided index
- eigenvals(param_indices=None)[source]#
Return the array of dressed eigenenergies - primarily for running the sweep
- Parameters
question (position indices of parameter values in) –
param_indices (Optional[Tuple[int, ...]]) –
- Return type
ndarray- Returns
dressed eigenenergies for the external parameters fixed to the values indicated by the provided indices
- energy_by_bare_index(bare_tuple, subtract_ground=False, param_indices=None)[source]#
Look up dressed energy most closely corresponding to the given bare-state labels
- Parameters
bare_tuple (
Tuple[int,...]) – bare state indicessubtract_ground (
bool) – whether to subtract the ground state energyparam_indices (
Union[int,slice,Tuple[int],List[int],Tuple[Union[int,slice,Tuple[int],List[int]],...],None]) – indices specifying the set of parameters
- Return type
- Returns
dressed energies, if lookup successful, otherwise nan;
- energy_by_dressed_index(dressed_index, subtract_ground=False, param_indices=None)[source]#
Look up the dressed eigenenergy belonging to the given dressed index, usually to be used with pre-slicing
- Parameters
dressed_index (
int) – index of dressed state of interestsubtract_ground (
bool) – whether to subtract the ground state energyparam_indices (
Optional[Tuple[int,...]]) – specifies the desired choice of parameter values
- Return type
float- Returns
dressed energy
- generate_lookup()[source]#
For each parameter value of the parameter sweep, generate the map between bare states and dressed states.
- Return type
- Returns
each list item is a list of dressed indices whose order corresponds to the ordering of bare indices (as stored in .canonical_bare_labels, thus establishing the mapping)