wavefunction
- sisl.physics.electron.wavefunction(v, grid, geometry=None, k=None, spinor=0, spin=None, eta=None)[source]
Add the wave-function (Orbital.psi) component of each orbital to the grid
This routine calculates the real-space wave-function components in the specified grid.
This is an in-place operation that adds to the current values in the grid.
It may be instructive to check that an eigenstate is normalized:
>>> grid = Grid(...) >>> wavefunction(state, grid) >>> (np.absolute(grid.grid) ** 2).sum() * grid.dvolume == 1.
Note: To calculate
in a unit-cell different from the originating geometry, simply pass a grid with a unit-cell smaller than the originating supercell.The wavefunctions are calculated in real-space via:
While for non-colinear/spin-orbit calculations the wavefunctions are determined from the spinor component (spinor)
where
spinor in [0, 1]
determines or , respectively.Notes
Currently this method only works for v being coefficients of the
gauge="lattice"
method. In case you are passing a v with the incorrect gauge you will find a phase-shift according to:where
is the orbital index and is the orbital position.- Parameters:
v (
ndarray
) – coefficients for the orbital expansion on the real-space grid. If v is a complex array then the grid must be complex as well. The coefficients must be using the lattice gauge.grid (
Grid
) – grid on which the wavefunction will be plotted. If multiple eigenstates are in this object, they will be summed.geometry (
Geometry
, optional) – geometry where the orbitals are defined. This geometry’s orbital count must match the number of elements in v. If this isNone
the geometry associated with grid will be used instead.k (
ndarray
, optional) – k-point associated with wavefunction, by default the inherent k-point used to calculate the eigenstate will be used (generally shouldn’t be used unless theEigenstateElectron
object has not been created viaeigenstate
).spinor (
int
, optional) – the spinor for non-colinear/spin-orbit calculations. This is only used if the eigenstate object has been created from a parent object with aSpin
object contained, and if the spin-configuration is non-colinear or spin-orbit coupling. Default to the first spinor component.spin (Spin | None) – specification of the spin configuration of the orbital coefficients. This only has influence for non-colinear wavefunctions where spinor choice is important.
eta (
bool
, optional) – Display a console progressbar.