Author Topic: IndentationError/Electrode properties  (Read 10889 times)

0 Members and 1 Guest are viewing this topic.

Offline Dipankar Saha

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 516
  • Country: in
  • Reputation: 5
    • View Profile
IndentationError/Electrode properties
« on: October 5, 2013, 22:24 »
Sir
While running a simple script, to find out the plot of Cond. V/s. Temp. ....I'm getting the following error...
May I know, what is the cause of this error...???

___________________________
Script:

#calculate the conductance for each temperature in the temperature list
for i in range(len(temperature_list)):
conductance_list=transmission_spectrum.conductance(
electrode_temperatures=(temperature_list,temperature_list) )
#plot the conductance as function of temperature
import pylab
pylab.figure()
pylab.semilogy(temperature_list,conductance_list)
pylab.xlabel("Temperature (K)")
pylab.ylabel("Conductance (S)")
pylab.show()
______________________________________

Error:
------------------------------------------------------------------------------+
| NanoLanguageScript execution started                                         |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
|                                                                              |
| Atomistix ToolKit 12.8.2 [Build c2e18ea]                                     |
|                                                                              |
+------------------------------------------------------------------------------+
  File "/tmp/6998650439471636.py", line 11
    conductance_list=transmission_spectrum.conductance(
                   ^
IndentationError: expected an indented block
+------------------------------------------------------------------------------+
| NanoLanguageScript execution finished                                        |
+------------------------------------------------------------------------------+
« Last Edit: October 23, 2013, 11:13 by Dipankar Saha »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5575
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: IndentationError
« Reply #1 on: October 5, 2013, 23:10 »
Python is sensitive to indentation, and at least if your script is as shown in the post, you are missing an indent for all lines after the "for" line.

Offline Dipankar Saha

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 516
  • Country: in
  • Reputation: 5
    • View Profile
Re: IndentationError,Index Error
« Reply #2 on: October 7, 2013, 17:36 »

Thank you sir.... that problem is solved.....  :) /
 But, I'am facing another issue while running the following script. Can you please tell me that how can I get rid of this error ??


_____________
Script:

#list of relevant temperatures
temperature_list=numpy.linspace(0,2000,21)*Kelvin
#list of relevant gate voltages
gate_voltage_list=numpy.linspace(-2.0,2.0,17)*Volt
#list to hold the conductance calculations
conductance_list=numpy.zeros(len(gate_voltage_list)*len(temperature_list))
conductance_list=conductance_list.reshape(len(gate_voltage_list),
                                                                        len(temperature_list))

#the reference transmission spectrum from the netcdf data file
gate_potential_ref = 0.*Volt
transmission_spectrum = nlread("/home/dipankar/Desktop/Exapmle_456/gatescan-6-6.nc",
                               object_id="trans"+str(gate_potential_ref))[0]

#loop through the gate voltages
for n in range(len(gate_voltage_list)):
    #loop through the temperature list
    for i in range(len(temperature_list)):
        conductance_list[n,i]=transmission_spectrum.conductance(
            electrode_temperatures=(temperature_list,temperature_list),
            electrode_voltages=(gate_voltage_list[n]-gate_potential_ref,
                                gate_voltage_list[n]-gate_potential_ref ) )
.......................
................

________________________
Error:

 NanoLanguageScript execution started                                         |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
|                                                                              |
| Atomistix ToolKit 12.8.2 [Build c2e18ea]                                     |
|                                                                              |
+------------------------------------------------------------------------------+
Traceback (most recent call last):
  File "/tmp/6519725838618169.py", line 15, in <module>
    object_id="trans"+str(gate_potential_ref))[0]
IndexError: list index out of range
+------------------------------------------------------------------------------+
| NanoLanguageScript execution finished                                        |
+------------------------------------------------------------------------------+

 

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5575
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: IndentationError
« Reply #3 on: October 8, 2013, 14:28 »
The fundamental reason is that your file /home/dipankar/Desktop/Exapmle_456/gatescan-6-6.nc does not contain the expected object with ID "0.0 V". Maybe you forgot to run a step before, maybe this object is in a different file, or maybe the object exists but is called something else... What it's looking for is the reference calculation at zero gate bias.

You can check which objects are in a NC file in VNL, they are shown in the Result Browser.

Offline Dipankar Saha

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 516
  • Country: in
  • Reputation: 5
    • View Profile
Re: IndentationError
« Reply #4 on: October 10, 2013, 21:23 »
Thank u sir.... :)
In this regard I would like to ask you that, where from I can get the details of those different methods [for example, the method 'conductance ()' which is operating on the 'transmission_spectrum' object as transmission_spectrum.conductance()] ?? Can I make any alternation to those?? And more importantly if I choose a different calculator altogether, then can those methods be invoked by using same name??

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5575
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: IndentationError
« Reply #5 on: October 10, 2013, 21:51 »
All objects, methods, classes etc that are used in ATK are documented in detail in the Reference Manual.

Almost all "analysis" classes are available for all calculators, although you can't obtain e.g. the electron density from a tight-binding calculation - it's a DFT-only property. But if you have a TransmissionSpectrum, it contains the same methods regardless of how it was computed.

Making alterations is in a sense perfectly possible, if you are experienced in Python programming, since almost all objects in ATK are classes (or rather, class instances). But often, making alterations to a class method is perhaps not what you want - maybe rather extend a class with new functionality. You can then make a derived class and add new methods to it.

Offline Dipankar Saha

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 516
  • Country: in
  • Reputation: 5
    • View Profile
Re: IndentationError
« Reply #6 on: October 19, 2013, 12:40 »
Sir
As I am finding in the Constructor for the "TransmissionEigenvalues" class,.... there are four arguments ...../ one of those is  "k-point" ... / On the other hand with any object of "TransmissionEigenvalues"  class.... I can call a method  kPoint() which returns the k-point that has been used for the calculation of the transmission eigenvalue..... / Now my confusion is... once I set the k-points in my Calculator, at the time of doing the analysis....then,  calling a method kPoint() with any object, should return those particular values only.... /Then where from the question arrives for setting the "k-point"  again as the argument, while running a code like the following......... ??
______________

eigenvalues = TransmissionEigenvalues(---,--- ,--- ,--- )
nlprint(eigenvalues)

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5575
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: IndentationError
« Reply #7 on: October 20, 2013, 02:02 »
Nothing strange about that. The kPoint method returns the k-point used when computing the TransmissionEigenstate / EigenValue. This is a single point, of your choosing. It has nothing to do with the k-points used in the selfconsistent loop.


Offline Dipankar Saha

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 516
  • Country: in
  • Reputation: 5
    • View Profile
Re: IndentationError
« Reply #8 on: October 23, 2013, 11:12 »
Okay....thanks!!! :)

Offline Dipankar Saha

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 516
  • Country: in
  • Reputation: 5
    • View Profile
Re: IndentationError/Electrode properties
« Reply #9 on: October 23, 2013, 11:29 »
Sir
I have a query here, regarding the electrodes of any two-terminal device. .....When we create a device from bulk.....we get the left and right electrode lengths....as well as the +/- options to increase or decrease the size of the central region at the interfaces of the electrodes. ..... But, where from I can get the electrical, material properties of those default electrodes?? Are those can be considered as ideal contacts??  :-\

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5575
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: IndentationError/Electrode properties
« Reply #10 on: October 23, 2013, 18:31 »
The properties of the electrodes are computed atomistically (with DFT or whichever method you choose) just like the rest of the device.

Offline Dipankar Saha

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 516
  • Country: in
  • Reputation: 5
    • View Profile
Re: IndentationError/Electrode properties
« Reply #11 on: October 23, 2013, 19:10 »
May be I was not so clear while asking the question.... What I intended to mean is....considering the case of diffusive transport, I can treat the electrodes as the ideal reservoirs...and there I have the relaxation of ignoring the interface resistance between the contact and channel.... but when the central region of my device is around 10 nm or so...as well as, the device is not diffusive anymore.... in such scenario, how can I get the information which will help me to find out the behavior of the contact, and more importantly the interface resistances between the electrodes and the central region... ??
« Last Edit: October 23, 2013, 19:14 by Dipankar Saha »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5575
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: IndentationError/Electrode properties
« Reply #12 on: October 27, 2013, 02:42 »
The best way to study the contact resistance is to set up a system that only consists of the electrode + the central region, if possible. That is, let's say you want to know the contact resistance between a metal and a nanotube. Then don't set it up as metal-nanotube-metal, but just metal-nanotube. The nanotube will define the right electrode in this case, and you will be considering a single interface between the metal and a nanotube, rather than a short stump of nanotube between two metals. The same is true if your central region is a semiconductor, oxide, etc.

Offline Dipankar Saha

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 516
  • Country: in
  • Reputation: 5
    • View Profile
Re: IndentationError/Electrode properties
« Reply #13 on: October 27, 2013, 06:43 »
Thanks again... :) / As per what I'm getting... you r suggesting to form a Schottky barrier junc. device or, so....and, there I have to measure the junction resistance...applying some biasing voltages across the terminals...../ 
....... Is it so??

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5575
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: IndentationError/Electrode properties
« Reply #14 on: October 27, 2013, 22:40 »
Pretty much, yes.