CurrentDensity — Class for representing the current density for a given configuration and calculator.
Constructor for the CurrentDensity object.
The configuration to calculate the current density of.
Type: DeviceConfiguration with attached calculator.
Default:
None
The kpoints to integrate over.
Type: MonkhorstPackGrid
Default:
MonkhorstPackGrid(nx,ny), where nx, ny is the sampling used for the self consistent calculation.
The energies to integrate over.
Type: List with PhysicalQuanties of type energy.
Default:
An energy range that covers the bias window as specified by the DoubleContourIntegralParameters on the calculator attached to the configuration.
The weight of each energy point. The keyword Current gives an energy dependent weight, f_R(E) -f_L(E), corresponding to the current integral. Left/Right gives an energy independent weight of 1, for current carrying states from Left/Right.
Type: Current | Left | Right | List of floats
Default:
Current
The spin for which the current density should be calculated.
Type: Spin.Sum | Spin.Up | Spin.Down
Default:
Spin.Sum
The electrode temperatures to be used the current calculation.
Type: Must be given as 2 temperatures - for example, [100, 200]*Kelvin.
Default:
The temperature used for the self-consistent calculation.
The SelfEnergyCalculator to be used for the current density.
Type: DirectSelfEnergy() | RecursionSelfEnergy() | KrylovSelfEnergy()
Default:
DirectSelfEnergy()
Specifies the choice for the energy zero.
Type: AverageFermiLevel | AbsoluteEnergy.
Default:
AverageFermiLevel
Small energy, used to move the self energy calculation away from the real axis. This is only relevant for recursion-style self-energy calculators.
Type: PhysicalQuantity with type energy.
Default:
1.0e-6*eV
A CurrentDensity object provides the following methods:
electrodeFermiLevels(): Return the electrodes Fermi levels in absolute energies.
electrodeFermiTemperatures(): Return the electrodes Fermi temperatures.
energies(): Return the energies used for this current density .
energyWeights(): Return the energy weights used for this current density .
energyZero(): Return the energy zero used for the energy scale in this current density.
evaluate(x, y, z): Evaluate in the point x,y,z
findFingerPrint(): Return the finger print of the object.
gridCoordinate(i, j, k): Return the grid coordinate for a given grid index.
infinitesimal(): Return the infinitesimal used for calculating the current density.
nlprint(stream): Print a string containing an ASCII representation of the data.
scale(scale): Scale the field with a double.
shape(): Query function for getting the shape of the data.
spin(): Return the spins.
toArray(): Return the values of the grid as a numpy array slicing off any units.
unit(): Get the unit of the data in the grids.
unitCell(): Return the unit cell for the grids.
volumeElement(): Get the volume element of the grid.
Load a current density object and plot the current density along z, integrated over the x,y plane
# Read current density from a file
cd = nlread('filename.nc',CurrentDensity)[0]
# Calculate the volume element and x,y integration area
dX, dY, dZ = cd.volumeElement()
dAXY = numpy.linalg.norm( numpy.cross(dX,dY) )
# Calculate the current density along z integrated over x,y
shape = cd.shape()
cd_z = [ cd[2,:,:,i].sum() * dAXY for i in range(shape[3]) ]
# Plot the data
import pylab
pylab.figure()
dz = dZ.norm()
z = numpy.arange(shape[3])*dz.inUnitsOf(Bohr)
pylab.plot(z,cd_z)
pylab.show()
Calculate the current density from right to left going states at the Fermi level. Plot the current density in the x-z plane as a contour plot.
# Calculate the current density at the fermi level from right to left going states
cd = CurrentDensity(
configuration,
energies = [0.0]*eV,
energy_weights = Right,
kpoints=MonkhorstPackGrid(1,11),
)
# Calculate the volume element
dX, dY, dZ = cd.volumeElement()
dx = dX.norm()
dy = dY.norm()
dz = dZ.norm()
# Calculate the current density in the xz plane integrated over y
cd_xz = numpy.apply_over_axes(numpy.sum, cd[2,:,:,:] ,[2]).flatten()
# Make 2-d arrays for contour plot of the data
shape = cd.shape()
x = dx.inUnitsOf(Ang)*numpy.arange(shape[1])
z = dz.inUnitsOf(Ang)*numpy.arange(shape[3])
Z, X = numpy.meshgrid(z,x)
F = numpy.array(cd_xz).reshape(numpy.shape(Z))
#plot the current density in the (z,x) plane
import pylab
pylab.xlabel('z (Angstrom)',fontsize=12,family='sans-serif')
pylab.ylabel('x (Angstrom)',fontsize=12,family='sans-serif')
pylab.contourf(Z, X, F)
pylab.colorbar()
pylab.savefig('cd.png',dpi=100)
pylab.show()

is the lesser greens function from left/right dependent on the
current direction[44], and
is an energy
weight given by the left,
, and right,
, Fermi occupations.
The positive current direction is from left to right (corresponding to electron propagation from right to left).
Through the energy_weights keyword, it is possible to obtain a spectral resolution
of left and right going states. This is particular useful when using the current
density to analyze zero bias calculations. Setting the energy weights to
Right is identical to setting the energy_weights to 1 for all
states, since a positive
number corresponds to calculating right to left going modes (positive current). Setting the energy weights to
Left is identical to setting the energy_weights to -1 for all
states, since a negative
number corresponds to calculating left to right going modes (negative current).
The current density does not include the non-local potential correction[44] and spill in contributions from the electrodes. Thus, the area integrated current density is not constant along z, but has a small fluctuating component from the non-local potential and larger errors near the electrodes from spill in components.