Example: NEGF with bias
***********************

"Download NEGF_bias.run"

   #! /bin/sh

   # This example shows how to use the NEGF key when including a bias potential
   # between the electrodes. It starts of with the usual tight-binding run,
   # followed by an SGF one. The alignment run is omitted. Finally, there is a loop
   # over bias potentials. Here the scale feature of the FuzzyPotential is used.
   # The current is appended to a text file, which one could plot eg. with gnuplot.

   # Note: Setting up a NEGF calculation is quite hard without the GUI.

   AMS_JOBNAME=tight-binding $AMSBIN/ams <<eor

   Task SinglePoint 

   System
     Atoms
         Li   0.0 0.0 0.0  region=1
         Li 2.876 0.0 0.0  region=2
         Li 5.752 0.0 0.0  region=3
     End
     Lattice
      8.628 0.0 0.0
     End
   End

   Engine Band 
     TITLE tight-binding

     KSpace
       Quality VeryGood
     End

     SoftConfinement
       Quality Basic
     End

     Basis
       Type DZ
       Core Large
     End

     StoreHamiltonian2
   EndEngine
   eor


   $AMSBIN/sgf   <<eor
   TITLE Test for NEGF inputs
   SAVE SIGMA
   SURFACEGF
      RKFFileName tight-binding.results/band.rkf
      SCMCode
      KT 0.001
      ContourQuality normal
   END
   eor

   mv SigmaSCM Sigma.kf

   REPORT=Li-CuAg.report
   touch $REPORT

   for bias in -0.01 0.01
   do


   AMS_JOBNAME=negf $AMSBIN/ams <<eor

   Task SinglePoint

   System
     ATOMS
         Li  -15.818  0.0 0.0 region=1L
         Li  -12.942  0.0 0.0 region=2L
         Li  -10.066  0.0 0.0 region=3L
         Li   -7.19   0.0 0.0 region=1C
         Li   -4.314  0.0 0.0 region=2C
         Cu   -0.7   -1.0 0.0 region=C
         Ag    0.7    1.0 0.0 region=C
         Li    4.314  0.0 0.0 region=3C
         Li    7.19   0.0 0.0 region=4C
         Li   10.066  0.0 0.0 region=1R
         Li   12.942  0.0 0.0 region=2R
         Li   15.818  0.0 0.0 region=3R
     END
   End

   Engine Band 
     TITLE bias=$bias

     SoftConfinement
       Quality Basic
     End

     Basis
       Type DZ
       Core Large
     End

     NEGF
       LeadFile tight-binding.results/band.rkf
       SGFFile Sigma.kf
       EMin -5.0
       EMax 5.0
       NE 200
       ApplyShift2 False
       BiasPotential $bias
     End

     FuzzyPotential
     scale $bias
     1   0.5
     2   0.5
     3   0.5
     4   0.5
     5   0.5
     6   0.2
     7   -0.2
     8   -0.5
     9   -0.5
     10  -0.5
     11  -0.5
     12  -0.5
     end
   EndEngine

   eor

   current=`$AMSBIN/amsreport negf.results/band.rkf 'NEGF%current'`
   echo "NEGFREPORT: Bias=$bias, Current=$current" >> $REPORT

   echo "start of transmission (bias=$bias)"
   cat Transmission_*.plt
   echo "end of transmission"

   rm Transmission_*.plt

   rm -r negf.results

   done

   echo "Start of report"
   cat $REPORT
   echo "End of report"


