Author Topic: There is an error in calculating I-V curves and voltage drops.  (Read 4604 times)

0 Members and 1 Guest are viewing this topic.

Offline Jin-Kyu Choi

  • Regular QuantumATK user
  • **
  • Posts: 24
  • Country: kr
  • Reputation: 0
    • View Profile
Hello, I'm Jin-Kyu Choi from Chonnam National University, South Korea.

To calculate I-V curves, I followed the description in the "Minitutorial" from Quantumwise web (http://www.quantumwise.com/publications/tutorials/mini-tutorials/98-i-v-curve-and-voltage-drop).

Because I had a memory deficiency trouble, I modified the self-consistent calculation script as below (I've got an advise about it from the Forum 2 days ago http://quantumwise.com/forum/index.php?topic=1358.0):

nlprint(device_configuration)
for voltage in [0., 0.4, 0.8]*Volt: 
    device_configuration.setCalculator(
        calculator(electrode_voltages=(-0.5*voltage,0.5*voltage)),
        initial_state=device_configuration
    )
    device_configuration.update()
    nlsave("lih2li_iv_scf_bias_%g.nc" % voltage.inUnitsOf(Volt), device_configuration)


After that, I tried to calculate the trasmission spectrum and voltage drop for each case by using the script as in "Calculating the analysis quantities" part from the Tutorial.
Then I've got an error message as follows:

Traceback (most recent call last):
  File "c:\docume~1\wolfnf~1\locals~1\temp\8823705931732971.py", line 32, in <module>
    voltage_drop = potential - zero_bias_potential
NameError: name 'zero_bias_potential' is not defined


Here is the part of input scrip related to the error of 'zero_bias_potential':

    if float(bias)!=0.:
        voltage_drop = potential - zero_bias_potential
        nlsave(analysis_filename, voltage_drop, object_id="Voltage drop %s" % bias)
    else:
        zero_bias_potential = potential


I think it is needed to modify the line about defining the "zero_bias_potential" in the input scrip. Could anybody help me?
Thank you.
« Last Edit: November 25, 2011, 02:25 by Jin-Kyu Choi »

Offline Nordland

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 812
  • Reputation: 18
    • View Profile
Re: There is an error in calculating I-V curves and voltage drops.
« Reply #1 on: November 25, 2011, 09:08 »
This script is flawed in the sense, that it requires that the zero bias calculation is first in the netcdf file. What I would recommend to fix it, is something along the lines:
Code
biases = [float(conf.calculator().electrodeVoltages()[1]-conf.calculator().electrodeVoltages()[0]) for conf in configurations ]
This will read all the biases into a list.
Code
configurations = [configurations[i] for i in numpy.argsort(biases)]
This will resort the configurations according the biases and the rest of the script should work. Add these two lines just below the nlread
Code
# Read all configurations from NetCDF file
configurations = nlread(scf_filename, DeviceConfiguration)
biases = [float(conf.calculator().electrodeVoltages()[1]-conf.calculator().electrodeVoltages()[0]) for conf in configurations ]
configurations = [configurations[i] for i in numpy.argsort(biases)]
I hope this works - I haven't tried it yet, but it should work :)

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: There is an error in calculating I-V curves and voltage drops.
« Reply #2 on: November 25, 2011, 14:06 »
Thanks, Nordland - I have modified the online tutorial to include your improvement.