Author Topic: admittance code tutorial  (Read 3981 times)

0 Members and 1 Guest are viewing this topic.

Offline rose

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Country: it
  • Reputation: 0
    • View Profile
admittance code tutorial
« on: March 12, 2015, 22:46 »
Hi
In the short tutorial admittance, i add the path to the system and then run the code (CNT_admittance.py). unfortunetly i got error as follow:

eps = 1e-5*eV
NameError: name 'eV' is not defined


by removing eV from the admittance... the code is running and then error as follow:

    TE = boltzmann_constant*T
NameError: global name 'boltzmann_constant' is not defined

and by defining boltzmann_constant in admitance and then running following error appear:

0 = Ef-omega-8*TE
  File ".\zipdir\NL\CommonConcepts\PhysicalQuantity.py", line 425, in __sub__
  File ".\zipdir\NL\CommonConcepts\PhysicalQuantity.py", line 754, in inUnitsOf

NL.ComputerScienceUtilities.Exceptions.NLValueError: Unable to convert unit value 0.2064 K to an incompatible unit Hartree.

which apper to be happen due to not defining proper unit in previous parts.
How can i correct the CNT_admitance.py or admitance.py
?
thanks






Offline rose

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Country: it
  • Reputation: 0
    • View Profile
Re: admittance code tutorial
« Reply #1 on: March 13, 2015, 11:46 »
I add all two files togeather now a new error:

   YD = displacementAdmittance(average_fermi_level, omega, T, N, H, S, Sigma_L, Sigma_R)
  File "c:\users\utabco\appdata\local\temp\2897894476902862.py", line 75, in displacementAdmittance
    Gamma_L = 1j*(Sigma_L-numpy.conj(Sigma_L.transpose()))
  File ".\zipdir\NL\CommonConcepts\PhysicalQuantity.py", line 425, in __sub__
  File ".\zipdir\NL\CommonConcepts\PhysicalQuantity.py", line 753, in inUnitsOf
  File ".\zipdir\NL\CommonConcepts\PhysicalQuantity.py", line 249, in unit
AttributeError: 'PhysicalQuantity' object has no attribute '_PhysicalQuantity__unit'

now what??

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: admittance code tutorial
« Reply #2 on: March 13, 2015, 12:34 »
If "eV" is undefined the you definitely have a problem. Also boltzmann_constant should be defined (when you defined it yourself you forgot the unit). I'm guessing you just need to add

from NanoLanguage import *

at the top of the script. Try that, and we'll check on updating the tutorial properly!

Offline rose

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Country: it
  • Reputation: 0
    • View Profile
Re: admittance code tutorial
« Reply #3 on: March 13, 2015, 12:42 »
thanks for the response, as i mentioned i overcome that problem by adding up to individual code to single one. Now i can not understand why Gamma_L is asking for unit or something like that???!!!
___________________________________________________________________________________
 YD = displacementAdmittance(average_fermi_level, omega, T, N, H, S, Sigma_L, Sigma_R)
  File "c:\users\utabco\appdata\local\temp\2897894476902862.py", line 75, in displacementAdmittance
    Gamma_L = 1j*(Sigma_L-numpy.conj(Sigma_L.transpose()))
  File ".\zipdir\NL\CommonConcepts\PhysicalQuantity.py", line 425, in __sub__
  File ".\zipdir\NL\CommonConcepts\PhysicalQuantity.py", line 753, in inUnitsOf
  File ".\zipdir\NL\CommonConcepts\PhysicalQuantity.py", line 249, in unit
AttributeError: 'PhysicalQuantity' object has no attribute '_PhysicalQuantity__unit'
___________________________________________________________________________________
what it means? and how can i overcome this error?
thanks,

Offline Umberto Martinez

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 479
  • Country: dk
  • Reputation: 26
    • View Profile
Re: admittance code tutorial
« Reply #4 on: March 13, 2015, 14:57 »
Please check again the Accessing ATK internal variables tutorial and in particular the AC conductance chapter here http://quantumwise.com/documents/tutorials/latest/LowLevelEntities/index.html/chap.acconductance.html

Unfortunately an old version of the tutorial was online.
Now, the entire tutorial, including scripts, has been updated.
note, you may need to clear your browser cache.

Offline rose

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Country: it
  • Reputation: 0
    • View Profile
Re: admittance code tutorial
« Reply #5 on: March 13, 2015, 16:03 »
thanks...i am running it and till now no problem...Nice Work...