Author Topic: single electron transistor --- Error in Induced potential code  (Read 1560 times)

0 Members and 1 Guest are viewing this topic.

Offline Shan

  • QuantumATK Guru
  • ****
  • Posts: 101
  • Country: in
  • Reputation: 0
    • View Profile
Dear experts while i am trying to extract the induced potential after executing the Gatescan files, i am getting below error.
Hope u can help ...thank u in advance.

The below is the error,

Traceback (most recent call last):
  File "c:\users\user\appdata\local\temp\9465999441891664.py", line 10, in <module>
    induced_potential = potential1-potential0
  File ".\zipdir\NL\Analysis\GridValues.py", line 162, in __sub__
AttributeError: 'TotalEnergy' object has no attribute 'unit'
NanoLanguageScript execution failure



CODE used is:\

#filename of the data file
filename = 'benzene_set0.nc'
# read electro-static potential with gate potential 0 Volt
potential0 = nlread(filename, object_id = 'gID001')[0]
#read electro-static potential with gate potential 2 Volt
potential1 = nlread(filename, object_id = 'pot2.0 V')[0]
#calculate the induced potential and save it to a file
induced_potential = potential1-potential0
nlsave('InducedPotential_2V.nc',induced_potential)

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5411
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Check the object IDs. You are supposed to subtract to potentials from each other, but object "gID001" in benzene_set0.nc appears to be a TotalEnergy object instead. Check in the Result Browser in VNL what the object ID of the first potential is, probably it's gID002 instead, perhaps you inserted the analysis options in the reverse order simply in the Script Generator.