Author Topic: An error about voltage drop  (Read 4513 times)

0 Members and 1 Guest are viewing this topic.

Offline Crystal2016

  • Regular QuantumATK user
  • **
  • Posts: 8
  • Country: cn
  • Reputation: 0
    • View Profile
An error about voltage drop
« on: July 16, 2016, 14:23 »
Dear sir, I am trying to calculate the voltage drop for Li-h2, following the tutorial given in link: http://www.quantumwise.com/documents/tutorials/latest/ATKTutorialDevice/index.html/chap.iv.html, I calculate the Transmission Spectrum and Electrostatic Difference Potential under 0V and 1V, but it always appears an index error: list index out of range (refers to voltage_drop = potential[1]-potential[0]). And then, I correct the .py as follows: firstly, I calculates the Transmission Spectrum and Electrostatic Difference Potential under 0V and saves in a.nc, then calculate them under 1V and saves in b.nc, finally I calculate the voltage drop using the following script:
Code
# Read the configurations
configuration_list_a = nlread('a.nc', DeviceConfiguration)
configuration_list_b = nlread('b.nc', DeviceConfiguration)

#calculate the electrostatic potentials
potential_0V = ElectrostaticDifferencePotential(configuration_list_a[0])
potential_1V = ElectrostaticDifferencePotential(configuration_list_b[0])

# Calculate the voltage drop.
voltage_drop = potential_1V-potential_0V

# Save the voltage drop to voltage_drop.nc
nlsave('voltage_drop.nc', voltage_drop, object_id='drop1V')
I get the same contour plot, but the colorbar is different, mine is in a range of -0.041-0.0015, what’s wrong with me?

Offline Jess Wellendorff

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 933
  • Country: dk
  • Reputation: 29
    • View Profile
Re: An error about voltage drop
« Reply #1 on: July 18, 2016, 08:46 »
Which version of ATK are you using?

Offline Crystal2016

  • Regular QuantumATK user
  • **
  • Posts: 8
  • Country: cn
  • Reputation: 0
    • View Profile
Re: An error about voltage drop
« Reply #2 on: July 18, 2016, 08:59 »
13.8.1

Offline Jess Wellendorff

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 933
  • Country: dk
  • Reputation: 29
    • View Profile
Re: An error about voltage drop
« Reply #3 on: July 19, 2016, 08:25 »
Did you try to increase the scale of the color bar, such that it extends from -1 V to 0.0 V ? You should be able to use the Properties menu for this.

Offline Crystal2016

  • Regular QuantumATK user
  • **
  • Posts: 8
  • Country: cn
  • Reputation: 0
    • View Profile
Re: An error about voltage drop
« Reply #4 on: July 20, 2016, 09:23 »
Thank you for your reply. I have tried to increase the scale of the colar bar using the Properties menu, but the plot changes as follows:

Offline Jess Wellendorff

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 933
  • Country: dk
  • Reputation: 29
    • View Profile
Re: An error about voltage drop
« Reply #5 on: July 21, 2016, 08:39 »
OK, please upload the scripts you have used. Need to take a look at them...

Offline Crystal2016

  • Regular QuantumATK user
  • **
  • Posts: 8
  • Country: cn
  • Reputation: 0
    • View Profile
Re: An error about voltage drop
« Reply #6 on: July 22, 2016, 05:03 »
Ok, firstly, I calculates the Transmission Spectrum and Electrostatic Difference Potential under 0V and saves in a.nc, then calculate them under 1V and saves in b.nc, finally I calculate the voltage drop. The attachments are a.py, b.py and voltage_drop.py.

Offline Crystal2016

  • Regular QuantumATK user
  • **
  • Posts: 8
  • Country: cn
  • Reputation: 0
    • View Profile
Re: An error about voltage drop
« Reply #7 on: July 22, 2016, 11:45 »
Hi,Jess. I know the reason, the unit of my color bar may be Ha, if I convert it to eV, I can get the same scale. But i meet another question when i make a 1-d plot of the voltage drop according to the manual operation: http://quantumwise.com/documents/tutorials/latest/MolecularDevice/index.html/chap.iv.html,   an Error appears in program operation.
« Last Edit: July 22, 2016, 11:48 by Crystal2016 »

Offline Jess Wellendorff

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 933
  • Country: dk
  • Reputation: 29
    • View Profile
Re: An error about voltage drop
« Reply #8 on: July 25, 2016, 15:23 »
I don't know about this last error you report, but ATK 13.8 is not really supported anymore. Much better to use newer version of ATK, e.g. the 2016 release. Your scripts a.py and b.py already compute and save the electrosttic difference potentials, so you just need to read these (not necessary to recalculate them) when calculating the voltage drop. See attached script and the PNG, which shows what I find with ATK 2016.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5558
  • Country: dk
  • Reputation: 91
    • View Profile
    • QuantumATK at Synopsys
Re: An error about voltage drop
« Reply #9 on: July 30, 2016, 13:37 »
The error shown in the previous post is due to the fact that you run the script on a cluster/remote machine to which you connected with ssh I guess, but without the -X option, so you have no graphics. You can save the figure using pylab.savefig("fig.png") or run the script locally on your own machine instead, or if the cluster supports it use ssh -X and set the display variable (check with your sysadm).