EigenmodePhonon¶
-
class
sisl.physics.phonon.
EigenmodePhonon
(state, c, parent=None, **info)[source]¶ Eigenmodes of phonons with eigenvectors and eigenvalues.
This holds routines that enable the calculation of (projected) density of states.
Attributes
The data-type of the state (in str)
Data-type for the state
Eigenmode values in units of \(\hbar \omega\) [eV]
Eigenmodes (states)
Returns the shape of the state
Methods
DOS
(self, E[, distribution])Calculate DOS for provided energies, E.
PDOS
(self, E[, distribution])Calculate PDOS for provided energies, E.
__init__
(self, state, c[, parent])Define a state container with a given set of states and coefficients for the states
align
(self, other[, copy])Align other.state with the angles for this state, a copy of other is returned with rotated elements
asCoefficient
(self)asState
(self)change_gauge
(self, gauge)In-place change of the gauge of the mode coefficients
copy
(self)Return a copy (only the coefficients and states are copied),
parent
andinfo
are passed by referencedegenerate
(self, eps)Find degenerate coefficients with a specified precision
displacement
(self)Calculate displacements for the modes
inner
(self[, right, diagonal, align])Return the inner product by \(\mathbf M_{ij} = \langle\psi_i|\psi'_j\rangle\)
iter
(self[, asarray])An iterator looping over the states in this system
norm
(self)Return a vector with the norm of each state \(\sqrt{\langle\psi|\psi\rangle}\)
norm2
(self[, sum])Return a vector with the norm of each state \(\langle\psi|\psi\rangle\)
normalize
(self)Return a normalized state where each state has \(|\psi|^2=1\)
occupation
(self[, distribution])Calculate the occupations for the states according to a distribution function
outer
(self[, idx])Return the outer product for the indices idx (or all if
None
) by \(\sum_i|\psi_i\rangle c_i\langle\psi_i|\)phase
(self[, method, return_indices])Calculate the Euler angle (phase) for the elements of the state, in the range \(]-\pi;\pi]\)
rotate
(self[, phi, individual])Rotate all states (in-place) to rotate the largest component to be along the angle phi
sort
(self[, ascending])Sort and return a new
StateC
by sorting the coefficients (default to ascending)sub
(self, idx)Return a new state with only the specified states
velocity
(self[, eps])Calculate velocity for the modes
-
DOS
(self, E, distribution='gaussian')[source]¶ Calculate DOS for provided energies, E.
This routine calls
sisl.physics.phonon.DOS
with appropriate arguments and returns the DOS.See
DOS
for argument details.
-
PDOS
(self, E, distribution='gaussian')[source]¶ Calculate PDOS for provided energies, E.
This routine calls
PDOS
with appropriate arguments and returns the PDOS.See
PDOS
for argument details.
-
align
(self, other, copy=False)¶ Align other.state with the angles for this state, a copy of other is returned with rotated elements
States will be rotated by \(\pi\) provided the phase difference between the states are above \(|\Delta\theta| > \pi/2\).
- Parameters
- otherState
the other state to align onto this state
- copybool, optional
sometimes no states require rotation, if this is the case this flag determines whether other will be copied or not
-
asCoefficient
(self)¶
-
asState
(self)¶
-
c
¶
-
change_gauge
(self, gauge)¶ In-place change of the gauge of the mode coefficients
The two gauges are related through:
\[\tilde C_j = e^{i\mathbf k\mathbf r_j} C_j\]where \(C_j\) belongs to the gauge
R
and \(\tilde C_j\) is in the gauger
.- Parameters
- gauge{‘R’, ‘r’}
specify the new gauge for the mode coefficients
-
copy
(self)¶ Return a copy (only the coefficients and states are copied),
parent
andinfo
are passed by reference
-
degenerate
(self, eps)¶ Find degenerate coefficients with a specified precision
- Parameters
- epsfloat
the precision above which coefficients are not considered degenerate
- Returns
- list of numpy.ndarraya list of indices
-
displacement
(self)[source]¶ Calculate displacements for the modes
This routine calls displacements with appropriate arguments and returns the real space displacements for the modes.
Note that the coefficients associated with the
ModeCPhonon
must correspond to the frequencies of the modes.See
displacement
for details.
-
property
dkind
¶ The data-type of the state (in str)
-
property
dtype
¶ Data-type for the state
-
property
hw
¶ Eigenmode values in units of \(\hbar \omega\) [eV]
-
info
¶
-
inner
(self, right=None, diagonal=True, align=True)¶ Return the inner product by \(\mathbf M_{ij} = \langle\psi_i|\psi'_j\rangle\)
- Parameters
- rightState, optional
the right object to calculate the inner product with, if not passed it will do the inner product with itself. This object will always be the left \(\langle\psi_i|\)
- diagonalbool, optional
only return the diagonal matrix \(\mathbf M_{ii}\).
- alignbool, optional
first align right with the angles for this state (see
align
)
- Returns
- numpy.ndarray
a matrix with the sum of outer state products
Notes
This does not take into account a possible overlap matrix when non-orthogonal basis sets are used.
-
iter
(self, asarray=False)¶ An iterator looping over the states in this system
- Parameters
- asarraybool, optional
if true the yielded values are the state vectors, i.e. a numpy array. Otherwise an equivalent object is yielded.
- Yields
- stateState
a state only containing individual elements, if asarray is false
- statenumpy.ndarray
a state only containing individual elements, if asarray is true
-
property
mode
¶ Eigenmodes (states)
-
norm
(self)¶ Return a vector with the norm of each state \(\sqrt{\langle\psi|\psi\rangle}\)
- Returns
- numpy.ndarray
the normalization for each state
-
norm2
(self, sum=True)¶ Return a vector with the norm of each state \(\langle\psi|\psi\rangle\)
- Parameters
- sumbool, optional
if true the summed site square is returned (a vector). For false a matrix with normalization squared per site is returned.
- Returns
- numpy.ndarray
the normalization for each state
Notes
This does not take into account a possible overlap matrix when non-orthogonal basis sets are used.
-
normalize
(self)¶ Return a normalized state where each state has \(|\psi|^2=1\)
This is roughly equivalent to:
>>> state = StateC(np.arange(10), 1) >>> n = state.norm() >>> norm_state = StateC(state.state / n.reshape(-1, 1), state.c.copy()) >>> norm_state.c[0] == 1
- Returns
- statea new state with all states normalized, otherwise equal to this
-
occupation
(self, distribution='bose_einstein')[source]¶ Calculate the occupations for the states according to a distribution function
- Parameters
- distributionstr or func, optional
distribution used to find occupations
- Returns
- numpy.ndarray
len(self)
with occupation values
-
outer
(self, idx=None)¶ Return the outer product for the indices idx (or all if
None
) by \(\sum_i|\psi_i\rangle c_i\langle\psi_i|\)- Parameters
- idxint or array_like, optional
only perform an outer product of the specified indices, otherwise all states are used
- Returns
- numpy.ndarraya matrix with the sum of outer state products
-
parent
¶
-
phase
(self, method='max', return_indices=False)¶ Calculate the Euler angle (phase) for the elements of the state, in the range \(]-\pi;\pi]\)
- Parameters
- method{‘max’, ‘all’}
for max, the phase for the element which has the largest absolute magnitude is returned, for all, all phases are calculated
- return_indicesbool, optional
return indices for the elements used when
method=='max'
-
rotate
(self, phi=0.0, individual=False)¶ Rotate all states (in-place) to rotate the largest component to be along the angle phi
The states will be rotated according to:
\[S' = S / S^\dagger_{\phi-\mathrm{max}} \exp (i \phi),\]where \(S^\dagger_{\phi-\mathrm{max}}\) is the phase of the component with the largest amplitude and \(\phi\) is the angle to align on.
- Parameters
- phifloat, optional
angle to align the state at (in radians), 0 is the positive real axis
- individualbool, optional
whether the rotation is per state, or a single maximum component is chosen.
-
property
shape
¶ Returns the shape of the state
-
sort
(self, ascending=True)¶ Sort and return a new
StateC
by sorting the coefficients (default to ascending)- Parameters
- ascendingbool, optional
sort the contained elements ascending, else they will be sorted descending
-
state
¶
-
sub
(self, idx)¶ Return a new state with only the specified states
- Parameters
- idxint or array_like
indices that are retained in the returned object
- Returns
- StateCa new object with a subset of the states
-
velocity
(self, eps=1e-07)¶ Calculate velocity for the modes
This routine calls
velocity
with appropriate arguments and returns the velocity for the modes.Note that the coefficients associated with the
ModeCPhonon
must correspond to the energies of the modes.See
velocity
for details.- Parameters
- epsfloat, optional
precision used to find degenerate modes.
Notes
The eigenvectors for the modes may have changed after calling this routine. This is because of the velocity un-folding for degenerate modes. I.e. calling
displacement
and/orPDOS
after this method may change the result.
-