To set a non-zero electric field for a surface configuration calculation, one may impose Neumann boundary condition with a given value for the Hartree Difference Potential, see https://docs.quantumatk.com/manual/Types/NeumannBoundaryCondition/NeumannBoundaryCondition.html. That should be done in the script.
For example:
1. The electric filed E = 0.1 V/Angstrom can imposed as follows
device_poisson_solver = FastFourier2DSolver(
boundary_conditions=[[PeriodicBoundaryCondition(),PeriodicBoundaryCondition()],
[PeriodicBoundaryCondition(),PeriodicBoundaryCondition()],
[DirichletBoundaryCondition(),NeumannBoundaryCondition(-0.1*eV/Angstrom)]],
2. The electric filed E = -0.1 V/Angstrom can imposed as follows
device_poisson_solver = FastFourier2DSolver(
boundary_conditions=[[PeriodicBoundaryCondition(),PeriodicBoundaryCondition()],
[PeriodicBoundaryCondition(),PeriodicBoundaryCondition()],
[DirichletBoundaryCondition(),NeumannBoundaryCondition(0.1*eV/Angstrom)]],
3. For zero field, one may set NeumannBoundaryCondition(0.0*eV/Angstrom) or just NeumannBoundaryCondition()
Note that this is not equivalent to setting the left and right electrode voltages, as there is no right electrode in the one-probe, surface configuration. One can certainly create an electric field by setting a potential value in the vacuum by using the Dirichlet boundary condition with some given potential on the right boundary, see https://docs.quantumatk.com/manual/Types/NeumannBoundaryCondition/NeumannBoundaryCondition.html, computing the electric field in a post-processing manner from the Hartree Difference Potential in the vacuum.