|
| __init__ (self, k, eival=None, eivec=None, paramval=None, grid_index=None, opts=None) |
|
| obsids (self) |
|
| __str__ (self) |
|
| hash_id (self, length=6, precision='%.12e') |
|
| file_id (self) |
|
| stitch_with (self, k, eival, eivec, targetenergy_old, targetenergy_new, inplace=False, accuracy=0.01) |
|
| update (self, new_ddp) |
|
| extend_by (self, k, eival, eivec, paramval=None, obsvals=None, obsids=None, char=None, llindex=None, bindex=None, accuracy=1e-6) |
|
| extend (self, *args, **kwds) |
|
| set_observables (self, obsvals, obsids=None) |
|
| calculate_observables (self, params, obs, obs_prop=None, overlap_eivec=None, magn=None) |
|
| add_observable (self, obsvals=None, obsid=None) |
|
| reset_observable (self, obsid=None, value=np.nan) |
|
| delete_eivec (self) |
|
| build_tuple_index_cache (self) |
|
| get_index (self, val) |
|
| get_index_with_llindex (self, val, llindex) |
|
| get_ubindex (self) |
|
| get_eival (self, val) |
|
| get_eival0 (self) |
|
| get_char (self, val) |
|
| get_all_char (self) |
|
| get_observable (self, obs, val=None) |
|
| set_observable_value (self, obs, bandval, obsval) |
|
| subset (self, sel) |
|
| subset_inplace (self, sel) |
|
| select_llindex (self, ll) |
|
| select_bindex (self, b) |
|
| select_obs (self, obs, val, accuracy=None) |
|
| select_eival (self, val) |
|
| select_char (self, which, inplace=False) |
|
| sort_by_eival (self, inplace=False, reverse=False) |
|
| sort_by_obs (self, obs, inplace=False) |
|
| set_eivec_phase (self, accuracy=1e-6, inplace=False) |
|
| get_eivec_coeff (self, norbitals, accuracy=1e-6, ll_full=False, ny=None) |
|
| set_char (self, chardata, eival=None, llindex=None, eival_accuracy=1e-6) |
|
| set_bindex (self, bindexdata, eival=None, llindex=None, aligned_with_e0=False) |
|
| set_llindex (self, llindex) |
|
| set_eivec (self, eivec, val=None, strict=False) |
|
| filter_transitions (self, ee, broadening=None, ampmin=100, inplace=False) |
|
| to_binary_file (self, filename) |
|
| from_binary_file (self, save_eivec=False) |
|
| __getitem__ (self, i) |
| Compatibility / legacy functions; remove later.
|
|
| __len__ (self) |
|
| __str__ (self) |
|
Container class for eigenvalue and eigenstate properties for a single k or B point.
Attributes:
k Float or Vector instance. Momentum value.
paramval None, float or Vector instance. 'Parameter' value, currently
used only as magnetic field value.
neig Integer. Number of eigenvalues stored at this point.
dim Integer. Dimensionality, i.e., the size of the eigenvectors.
eival Numpy array or length neig. The eigenvalues in meV.
eivec Numpy array of shape (dim, neig). The eigenvectors belonging
to the eigenvectors. May be set to None to save memory
consumption.
obsids List of strings. These contain the observable ids for the
observables that are stored in obsvals.
obsvals Numpy array of shape (nobs, neig), where nobs = len(obsids).
The array contains the observable values for the eigenstates.
bindex Numpy array of length neig with integer elements. The band
indices belonging to the eigenstates.
llindex Numpy array of length neig with integer elements, or None. The
Landau-level indices belonging to the eigenstates.
char Numpy array of length neig with string elements, or None. The
band characters of the eigenstates.
transitions TransitionsData instance or None. Stores data for optical
transitions. See transitions.py.
wffigure Integer, string, or matplotlib Figure object. Identifier for
a matplotlib figure. None is used for absence of a figure. The
value is a list if separate figures are made for each state.
current_step Integer. Progress for this instance in the calculation model.
ham Sparse matrix (or tuple of matrices) for Hamiltonian(s)
evaluated for this instance's parameters.
grid_index Integer. Position of this instance in the flattened
VectorGrid. Used for priority ordering during diagonalization.
tuple_index Dict instance. Stores a mapping of band indices to array
indices.
kdotpy.diagonalization.diagdata.DiagDataPoint.add_observable |
( |
| self, |
|
|
| obsvals = None, |
|
|
| obsid = None ) |
Add the values and id of an observable.
Arguments:
obsvals Numpy array or None. If set, the observable values that will be
added. This array must have length neig. If None, add "NaN"
values.
obsid String or None. If set, add this observable id. If None, add an
empty string as observable id for the new observable.
Reimplemented from kdotpy.types.DiagDataPoint.
kdotpy.diagonalization.diagdata.DiagDataPoint.calculate_observables |
( |
| self, |
|
|
| params, |
|
|
| obs, |
|
|
| obs_prop = None, |
|
|
| overlap_eivec = None, |
|
|
| magn = None ) |
Calculate observables.
Arguments:
params PhysParams instance. Needed to calculate the observables, see
observables.py.
obs List of strings. The observables that will be calculated.
obs_prop ObservableList instance containing all observable properties.
overlap_eivec None or a dict instance, whose keys are the band labels
and values are the eigenvectors (numpy arrays). If set,
calculate overlap observables. If None, no overlap
observables are calculated.
magn Float, Vector instance, or None. If not None, the magnetic
field strength
Note:
Eigenvectors are required, i.e., self.eivec must not be None.
Reimplemented from kdotpy.types.DiagDataPoint.
kdotpy.diagonalization.diagdata.DiagDataPoint.from_binary_file |
( |
| self, |
|
|
| save_eivec = False ) |
Load eigenvectors from the binary file in self.binary_file
Argument:
save_eivec True or False. Whether to store the loaded eigenvectors
in self.eivec. If False, self.eivec will be reset to None
(assuming the eigenvector data from self.binary_file is
valid), even if it was an array before calling this
function.
Returns:
eivec Numpy array or None. If successful, return a Numpy array
of shape (dim, neig). On failure, return None.
kdotpy.diagonalization.diagdata.DiagDataPoint.get_eivec_coeff |
( |
| self, |
|
|
| norbitals, |
|
|
| accuracy = 1e-6, |
|
|
| ll_full = False, |
|
|
| ny = None ) |
Get complex coefficients for each orbital, for each eigenvector
The coefficients are extracted for each orbital as the eigenvector
component where the absolute value is maximal. If this happens at
multiple locations, then choose the value at the largest index
(equivalent to largest z value).
Arguments:
norbitals 6 or 8. The number of orbitals.
accuracy Float. The 'fuzziness' of determining which values are
considered maximal. This is a relative number in terms of
the maximal absolute value.
ll_full True or False. If True, take a section of the eigenvector
corresponding to the Landau level with the largest weight.
If False (default), use the full eigenvector.
ny None or integer. The size in the 'y direction'; for LL mode,
this value serves as number of LLs in the basis. Required to
be set if ll_full is True, otherwise it is ignored.
Returns:
coeff Numpy array of shape (neig, norbitals) and type complex.
Reimplemented from kdotpy.types.DiagDataPoint.
kdotpy.diagonalization.diagdata.DiagDataPoint.get_index |
( |
| self, |
|
|
| val ) |
Get index (position of eigenstate) in the data arrays.
Argument:
val If an integer, return this value. If a float, return the index of
the nearest eigenvalue. If a string, return the index of the state
with this character label. If a 1-tuple, return the index of the
state with this band index. If a 2-tuple, return the index of the
state with this LL index and band index.
Returns:
Integer index (from 0 to neig-1) or None if there is no match.
Reimplemented from kdotpy.types.DiagDataPoint.
kdotpy.diagonalization.diagdata.DiagDataPoint.get_observable |
( |
| self, |
|
|
| obs, |
|
|
| val = None ) |
Get observable values
Arguments:
obs Integer, string, or None. If integer, take the n-th observable. If
a string, take the observable with that obsid. If None, take all
observables.
val None or a value that self.get_index() can handle. If set, then
return the observable value(s) for that state. If None, return
values for all states.
Returns:
A float (if both obs and val are None) or an array of floats (1- or
2-dimensional (as approriate for the inputs). The value None may be
returned on error, i.e., if obs is not a valid observable and/or if val
does not refer to a valid state.
Reimplemented from kdotpy.types.DiagDataPoint.
kdotpy.diagonalization.diagdata.DiagDataPoint.select_obs |
( |
| self, |
|
|
| obs, |
|
|
| val, |
|
|
| accuracy = None ) |
Select states by observable value.
Arguments:
obs String. The observable id.
val Number, 2-tuple, or list. If a number, match the value
exactly or approximately. If a 2-tuple treat the two values
(numeric or None) as lower and upper bound for a search
interval. If a list, match any value in the list.
accuracy None or positive float. Test equality with this accuracy. If
None, match exactly. This only applies to testing equalities,
i.e., if val is a number.
Returns:
A new DiagDataPoint instance.
Reimplemented from kdotpy.types.DiagDataPoint.
kdotpy.diagonalization.diagdata.DiagDataPoint.set_bindex |
( |
| self, |
|
|
| bindexdata, |
|
|
| eival = None, |
|
|
| llindex = None, |
|
|
| aligned_with_e0 = False ) |
Set band indices.
Arguments:
bindexdata List or array of integers. The band indices.
eival List/array or None. If None, set bindexdata to self.bindex
as is. If a list or array of numbers, then match these
values to the eigenvalues (self.eival).
llindex Integer or None. If set, match only states with this LL
index. Only works if eival is not None.
aligned_with_e0 True or False. Whether the band indices were aligned
with the zero energy. This should be set to True if the
band indices were set directly from e0, or is the band
indices are obtained from a BandAlignPoint with
aligned_with_e0 set to True.
Returns:
The present DiagDataPoint instance.
Reimplemented from kdotpy.types.DiagDataPoint.
kdotpy.diagonalization.diagdata.DiagDataPoint.set_char |
( |
| self, |
|
|
| chardata, |
|
|
| eival = None, |
|
|
| llindex = None, |
|
|
| eival_accuracy = 1e-6 ) |
Set band characters.
Arguments:
chardata List or array of strings. The character data. If a DiagDataPoint
is given, extract all arguments in a recursive call.
eival List/array or None. If None, set chardata to self.char as is.
If a list or array of numbers, then match these values to the
eigenvalues (self.eival).
llindex Integer or None. If set, match only states with this LL
index. Only works if eival is not None.
Returns:
The present DiagDataPoint instance.
Reimplemented from kdotpy.types.DiagDataPoint.
kdotpy.diagonalization.diagdata.DiagDataPoint.set_eivec |
( |
| self, |
|
|
| eivec, |
|
|
| val = None, |
|
|
| strict = False ) |
Set eigenvectors.
Arguments:
eivec Numpy array or DiagDataPoint instance. If an array, this is the
eigenvector data that will be set to self.eivec. If a
DiagDataPoint instance, copy the eigenvector data from there.
val None or list/array of values that match using self.get_index().
If set, the specified input data is applied to the matching
states. If none, then the data is applied as is.
strict True or False. If True, discard the result (i.e., set self.eivec
to None) if any eigenvector is left undefined. If False
(default), only raise a warning in this case.
Returns:
The present DiagDataPoint instance.
Reimplemented from kdotpy.types.DiagDataPoint.
kdotpy.diagonalization.diagdata.DiagDataPoint.set_observable_value |
( |
| self, |
|
|
| obs, |
|
|
| bandval, |
|
|
| obsval ) |
Set observable values to specific states.
Arguments:
obs Integer or string. Observable index or id, respectively.
bandval Float or integer number or a list or array. If numeric, look
for state using self.getindex(). If a list or array, look for
multiple states using self.getindex().
obsval Float or array. The observable value(s). If an array, the shape
must be set appropriately.
Reimplemented from kdotpy.types.DiagDataPoint.
kdotpy.diagonalization.diagdata.DiagDataPoint.stitch_with |
( |
| self, |
|
|
| k, |
|
|
| eival, |
|
|
| eivec, |
|
|
| targetenergy_old, |
|
|
| targetenergy_new, |
|
|
| inplace = False, |
|
|
| accuracy = 0.01 ) |
Stitch together multiple diagonalization solutions.
Overlapping duplicate eigenvalues are recalculated by weighted mean.
From duplicate eigenvectors, the one with the eigenvalue closer to its
its target value (higher weight) is chosen.
Arguments:
k, ... See DiagDataPoint class info. The data that is added.
targetenergies Target energies that have been used to calculate
solutions. Used to calculate weights.
inplace Replace eigenvectors of current DiagDataPoint instance
if True, otherwise return a new instance (default).
accuracy Estimate of solver precision. Used to determine
degeneracy of states.
Note:
Currently only supports bare diagonalization results without
observables, ll indices, etc. as those quantities are usually not yet
calculated. This DiagDataPoint is expected to be sorted by eival.
Reimplemented from kdotpy.types.DiagDataPoint.