
The gDFTB tool for molecular electronics 215
the natural requirement that deep inside the contacts the effective potential for the Kohn–
Sham equations must correspond to the bulk electrochemical potentials. Therefore, at
the boundaries between the device region and the contacts, the potential must match the
intrinsic effective bulk potential (which originates from any equilibrium charge density)
shifted by the applied bias. At the device-contacts interfaces, C
/S
, the potential must
satisfy
V
2
S
r
C
/S
=V
2
C
bulk
r
C
/S
+V
(35)
where V
is the applied external potential to the -contact. The decoupling of Equa-
tions (33) and (34), which at first may seem arbitrary, is actually a good approximation
since the reference density is taken as that of the neutral atoms and therefore can-
cels with the ionic charges. On the contrary, the excess density produces a long-range
Coulomb field that should respect the boundary conditions imposed by the device. For
example, the charge which accumulates on the contact surfaces must be consistent with
the applied bias.
Within the gDFTB approach, the Poisson equation is solved in real space using
a three-dimensional multi-grid algorithm applied to a general linear, non-separable,
elliptical PDE. The Poisson equation is just a particular case of this kind of equation,
which has the general form
i
c
ii
r
2
Vr
x
2
i
+c
i
r
Vr
x
i
+crVr = r (36)
where Vr is the unknown solution potential. The previous equation simply reduces to
the Poisson equation if the coefficients are taken such that c
i
r =cr =0 and c
ii
r =
−1/4 at all the points r of the three-dimensional box in which the equation itself
is discretized. The general equation (36) has a great flexibility. Indeed, the possibility
of setting the coefficients to different values in different regions of the solution space
is the fundamental feature which allows us to impose Dirichlet boundary conditions
on arbitrary shaped three-dimensional surfaces, such as planar or cylindrical gates, and
handles easily even four terminal geometries.
A Dirichlet boundary condition simply consists of imposing a value for the solu-
tion potential on a defined spatial region. Consequently, such a boundary condition
can be set by imposing in the spatial region occupied by the metallic gate contact,
c
ii
r = c
i
r =0 cr = 1 and Vr = r/cr. The charge density r is in turn
suitably initialized to the appropriate value, for instance, of an external gate field. The
region occupied by the gate can obviously have any arbitrary shape, since the boundary
condition is simply reduced to the initialization of a numerical function on a subset of
points on which the equation has been discretized.
In the remaining regions of the solution box, where the metallic gate is not present, the
coefficient are suitably initialized in order to obtain the effective Poisson Equation 34,
and, at the same time, the charge density is evaluated starting from the atomic charge
fluctuations projected on the real-space mesh.
Once the computation of V
2
el
r is done, it is projected back into the local orbital basis.
The mesh is usually chosen as a trade-off between accuracy and computational speed.
However, the ansatz (5) for the atomic charge density gives quite smooth functions and
usually convergent results are obtained with a mesh spacing of 0.5 atomic units.