Parameters¶
- class scqubits.core.namedslots_array.Parameters(paramvals_by_name, paramnames_list=None)[source]¶
Convenience class for maintaining multiple parameter sets: names and values of each parameter set, along with an ordering among sets. Used in ParameterSweep as ._parameters. Can access in several ways: Parameters[<name str>] = parameter values under this name Parameters[<index int>] = parameter values saved as the index-th set Parameters[<slice> or tuple(int)] = slice over the list of parameter sets Mostly meant for internal use inside ParameterSweep.
- paramvals_by_name:
dictionary giving names of and values of parameter sets (note problem with ordering in python dictionaries
- paramnames_list:
optional list of same names as in dictionary to set ordering
Methods
Parameters.__init__
(paramvals_by_name[, ...])Parameters.create_reduced
(...[, fixed_values])Creates and returns a reduced Parameters object reflecting the fixing of a subset of parameters.
Parameters.create_sliced
(np_indices[, ...])Create and return a sliced Parameters object according to numpy slicing information.
Parameters.meshgrids_by_paramname
([indexing])Creates and returns returns a dictionary containing the meshgrids of the parameter lists.
Parameters.ndim
()Attributes
Returns list of the number of parameter values for each parameter set.
Returns a dictionary specifying for each parameter name the number of parameter values.
Return list of all parameter values sets.
Return a list of range objects suitable for looping over each parameter set.
- Parameters:
paramvals_by_name (Dict[str, ndarray])
paramnames_list (List[str] | None)
- property counts: Tuple[int, ...]¶
Returns list of the number of parameter values for each parameter set.
- property counts_by_name: Dict[str, int]¶
Returns a dictionary specifying for each parameter name the number of parameter values.
- create_reduced(fixed_parametername_list, fixed_values=None)[source]¶
Creates and returns a reduced Parameters object reflecting the fixing of a subset of parameters.
- Parameters:
fixed_parametername_list (
List
[str
]) – names of parameters to be fixedfixed_values (
Optional
[List
[float
]]) – list of values to which parameters are fixed, optional (default: use the 0-th element of the array of each fixed parameter)
- Return type:
- Returns:
Parameters object with all parameters; fixed ones only including one value
- create_sliced(np_indices, remove_fixed=True)[source]¶
Create and return a sliced Parameters object according to numpy slicing information.
- Parameters:
np_indices (
Union
[int
,integer
,slice
,Tuple
[int
],List
[int
],Tuple
[int
,integer
],List
[integer
],Any
,Tuple
[Union
[int
,integer
,slice
,Tuple
[int
],List
[int
],Tuple
[int
,integer
],List
[integer
],Any
],...
]]) – numpy slicing entriesremove_fixed (
bool
) – if True, do not include fixed parameters in the returned Parameters object
- Return type:
- Returns:
Parameters object with either fixed parameters removed or including only the fixed value
- meshgrids_by_paramname(indexing='ij')[source]¶
Creates and returns returns a dictionary containing the meshgrids of the parameter lists. All meshgrids are instances of the NamedSlotNdarray
- Parameters:
indexing ({'ij', 'xy'}) – Matrix (‘ij’, default) or cartesian (‘xy’) or indexing of output. This argument will be passed to the np.meshgrid() directly
- Return type:
OrderedDict
[str
,NamedSlotsNdarray
]- Returns:
An ordered dictionary or a list containing the meshgrids
- property paramvals_list: List[ndarray]¶
Return list of all parameter values sets.
- property ranges: List[Iterable]¶
Return a list of range objects suitable for looping over each parameter set.