I dragged the .py file to job manager following the operation of ATK2010.02 manual. The code of .py file is the same with the manual as follow
from NanoLanguage import *
#read in the old configuration
device_configuration = nlread("LiH2.nc",DeviceConfiguration)[0]
calculator = device_configuration.calculator()
# Define sample biases
voltage_list = numpy.linspace(0.1,1.0,10)
for voltage in voltage_list:
# Set the calculator and use the old scf state as starting input.
device_configuration.setCalculator(
calculator(electrode_voltages=(-0.5*voltage,0.5*voltage)*Volt ),
initial_state=device_configuration
)
#Analysis
filename = 'lih2li.nc'
electrostatic_potential = ElectrostaticDifferencePotential(device_configuration)
nlsave(filename, electrostatic_potential, object_id='pot'+str(voltage))
transmission_spectrum = TransmissionSpectrum(
configuration=device_configuration,
energies=numpy.linspace(-5,5,200)*eV,
)
nlsave(filename, transmission_spectrum,object_id='trans'+str(voltage))
molecular_energy_spectrum = MolecularEnergySpectrum(
configuration=device_configuration,
energy_zero_parameter=FermiLevel,
projection_list=ProjectionList([Hydrogen])
)
nlsave(filename, molecular_energy_spectrum,object_id='mpsh'+str(voltage) )
In the above code, I just changed the nc filename. After completion of calculation I had dropped the file lih2li.nc onto the NC file drop zone of the VNL Custom Analyzer tool. Then the following error appeared in the log window.
Traceback (most recent call last):
File ".\zipdir\NL\GUI\Core\Runner.py", line 220, in run
File ".\zipdir\NL\GUI\Tools\CustomAnalyzer\Analyzers\IVCurve.py", line 40, in analyzer
File ".\zipdir\NL\Analysis\TransmissionSpectrum.py", line 341, in current
File ".\zipdir\NL\IO\NLLogger.py", line 66, in write
IOError: [Errno 9] Bad file descriptor
I also wants to know why this error occurred like zhangfuchun and how to get the correct plot of IV curve.