About the bias voltage sweep, it's really simple: just change the line
voltages=[0.0,0.1,0.2,0.3]*Volt
to include the voltages you want, e.g.
voltages=[0.0,0.1,0.2,0.3,0.4,0.5,0.6]*Volt
or whatever! :)
The functionality delivered with the script ivcurve.py is not really intended as a full fledged one-stop solution, but rather as a template, to show how it can be done. So, for instance, if you have already converged zero bias calculations, and you want to avoid re-running the 0.0 V case and restart at 0.1 V, you should modify that script (slightly).
I'm sorry, I didn't actually understand the second question in that post...
Ok, I modifed the ivcurve.py script ever so slightly to add the functionality to initialize the first calculation from an existing checkpoint file. The script is attached.
The only change is a new keyword to runIVcurve called initialize_from, which should be an scf object that the first calculation will be initialized from. So, if I have an existing converged zero bias calculation in a file called "zerobias.nc", I would use the NEW ivcurve.py this way:
import ivcurve
voltages=[0.1,0.2,0.3]*Volt
zerobias_scf = restoreSelfConsistentCalculation("zerobias.nc")
ivcurve.runIVcurve (
twoprobe_configuration,
two_probe_method,
runtime_parameters,
voltages,
vnl_filename='myfile.vnl', sample_name='mysample',
current_k_point_sampling = (1,1),
current_number_of_points = 100,
initialize_from = zerobias_scf
)
iv = ivcurve.extractIVcurveFromVNLFile('myfile.vnl','mysample')
ivcurve.plotIVCurve(iv,'iv.png')
Note that this is not a complete script; you should add it to whatever script defines the two_probe_method and twoprobe_configuration (just noticed the asymmetry of those variable names! but that's how VNL does it...).
Actually, this version of the script allows for perhaps an even nicer way to take advantage of the VNL generated scripts...!
Instead of the above, where you should remove the executeSelfConsistentCalculation() statement from the VNL-generated script, we can let VNL set up the zero bias calculation, and use that. So, we would keep the VNL-generated script intact (don't add any analysis options to it!), and just append these lines to the end:
import ivcurve
voltages=[0.1,0.2,0.3]*Volt
# Insert zero-bias current into VNL file
vnl_filename='myfile.vnl'
sample_name='mysample'
if processIsMaster():
f = VNLFile(vnl_filename)
f.addToSample(0.*Ampere,sample_name,'Current at 0.0 V bias')
ivcurve.runIVcurve (
twoprobe_configuration,
two_probe_method,
runtime_parameters,
voltages,
vnl_filename=vnl_filename, sample_name=sample_name,
current_k_point_sampling = (1,1),
current_number_of_points = 100,
initialize_from = scf
)
iv = ivcurve.extractIVcurveFromVNLFile('myfile.vnl','mysample')
ivcurve.plotIVCurve(iv,'iv.png')
Don't forget to change the filenames, k-points, etc to fit your specific system.
Note the insertion of the zero-bias current into the VNL file, otherwise we don't get a current calculation for zero bias!
There are end-less variations to scripts like this, which is the power of NanoLanguage, although it does require a bit of programming knowledge to take advantage of it.
Setting up the gated voltage sweep requires some careful considerations about defining the surface atoms. See the manual (http://quantumwise.com/documents/manuals/ATK-2008.10/ref.gatedtwoprobemethod.html) for more details.
Once that is done, you can wrap the self-consistent calculation in a loop over voltages:
surface_atoms = (0,0)
current_k_point_sampling = (4,4)
current_number_of_points = 200
print 'Gate voltage (V)\tCurrent (A)'
print '---------------------'
for voltage in [0.0,0.2,0.4]:
gated_method = GatedTwoProbeMethod(
two_probe_method = two_probe_method,
gate_voltage = voltage*Volt,
surface_atoms = surface_atoms
)
scf = executeSelfConsistentCalculation(
twoprobe_configuration,
method = gated_method
)
current = calculateCurrent(
scf,
brillouin_zone_integration_parameters = brillouinZoneIntegrationParameters(current_k_point_sampling),
number_of_points = current_number_of_points
)
print voltage,'\t\t',current.inUnitsOf(Ampere)
The two_probe_method and twoprobe_configuration should be defined earlier in the script (append the code above to your VNL-generated script and it should be fine; just remove the executeSelfConsistentCalculation() part).
Don't forget to change the variables current_k_point_sampling and current_number_of_points to fit your system!