Author Topic: Single Electron Transistor  (Read 10293 times)

0 Members and 1 Guest are viewing this topic.

Offline researcher

  • Regular QuantumATK user
  • **
  • Posts: 9
  • Country: in
  • Reputation: 0
    • View Profile
Single Electron Transistor
« on: December 25, 2012, 07:37 »
Sir
I am currently working on SET using Atomistics ToolKit. I have calculated the charging densities of benzene in gaseous phase as well as in SET environment.
However I am not getting the main plots i.e Total energy Vs Gate voltage and the charge stability diagram
Please do explain as i am totally new to python language.Also whenever I tried to perform the steps according to the ATK manual of Benzene SET its showing error.
I shall be waiting for your reply
Regards
Researcher

Offline kstokbro

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 392
  • Reputation: 13
    • View Profile
    • QuantumWise
Re: Single Electron Transistor
« Reply #1 on: December 25, 2012, 14:18 »
for us to help you, you need to be more specific,
send us your script and the error message you get

Offline researcher

  • Regular QuantumATK user
  • **
  • Posts: 9
  • Country: in
  • Reputation: 0
    • View Profile
Re: Single Electron Transistor
« Reply #2 on: December 26, 2012, 06:42 »
+------------------------------------------------------------------------------+
| NanoLanguageScript execution started                                         |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
|                                                                              |
| Atomistix ToolKit 11.2.2 [Build 3069]                                        |
|                                                                              |
+------------------------------------------------------------------------------+
  File "c:\users\guest\appdata\local\temp\6524251319681072.py", line 11
    print 'Gate Voltage = ', gate_voltage
        ^
IndentationError: expected an indented block
NanoLanguageScript execution failure
+------------------------------------------------------------------------------+
| NanoLanguageScript execution finished                                        |
+------------------------------------------------------------------------------+
this is what i got after i put the following in job manager


#read in the old configuration
filename = 'benzene_set0.nc'
bulk_configuration = nlread(filename,BulkConfiguration)[0]
# Define gate_voltages
gate_voltage_list=[2, 4, 6, 8, -2, -4, -6, -8]*Volt
metallic_regions = bulk_configuration.metallicRegions()
metallic_region0 = metallic_regions[0]
for gate_voltage in gate_voltage_list:
print 'Gate Voltage = ', gate_voltage
bulk_configuration.setMetallicRegions(
[metallic_region0(value = gate_voltage),
metallic_regions[1],
metallic_regions[2] ] )
calculator = bulk_configuration.calculator()
# Set the calculator on the configuration
# and use the old calculation as initial state for the scf loop
bulk_configuration.setCalculator(calculator(),
initial_state=bulk_configuration)
#Analysis
electrostatic_potential = ElectrostaticDifferencePotential(bulk_configuration)
nlsave(filename, electrostatic_potential, object_id='pot'+str(gate_voltage))
molecular_energy_spectrum = MolecularEnergySpectrum(
configuration=bulk_configuration,
energy_zero_parameter=FermiLevel,
projection_list=ProjectionList(All)
)nlsave(filename, molecular_energy_spectrum, object_id='spec'+str(gate_voltage))
nlprint(molecular_energy_spectrum)
total_energy = TotalEnergy(bulk_configuration)
nlprint(total_energy)
nlsave(filename, total_energy, object_id='energy'+str(gate_voltage))


as per written in the manual

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Single Electron Transistor
« Reply #3 on: December 26, 2012, 15:34 »
Python is sensitive to indentation, i.e. how many spaces you put in the beginning of a line. You need to copy the script exactly as it is, else it will not work.

Offline researcher

  • Regular QuantumATK user
  • **
  • Posts: 9
  • Country: in
  • Reputation: 0
    • View Profile
Re: Single Electron Transistor
« Reply #4 on: December 27, 2012, 11:11 »
sir
i got two more errors
+------------------------------------------------------------------------------+
| NanoLanguageScript execution started                                         |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
|                                                                              |
| Atomistix ToolKit 11.2.2 [Build 3069]                                        |
|                                                                              |
+------------------------------------------------------------------------------+
Traceback (most recent call last):
  File "c:\users\guest\appdata\local\temp\5953000043519188.py", line 6, in <module>
    potential0 = nlread(filename, object_id = 'gID1')[0]
IndexError: list index out of range
NanoLanguageScript execution failure
+------------------------------------------------------------------------------+
| NanoLanguageScript execution finished                                        |
+------------------------------------------------------------------------------+






+------------------------------------------------------------------------------+
| NanoLanguageScript execution started                                         |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
|                                                                              |
| Atomistix ToolKit 11.2.2 [Build 3069]                                        |
|                                                                              |
+------------------------------------------------------------------------------+
Traceback (most recent call last):
  File "c:\users\guest\appdata\local\temp\4492241747131733.py", line 10, in <module>
    induced_potential = potential1-potential0
  File ".\zipdir\NL\Analysis\GridValues.py", line 162, in __sub__
AttributeError: 'MolecularEnergySpectrum' object has no attribute 'unit'
NanoLanguageScript execution failure
+------------------------------------------------------------------------------+
| NanoLanguageScript execution finished                                        |
+------------------------------------------------------------------------------+


i shall be awaiting your reply

Regards
Researcher

Offline Shan

  • QuantumATK Guru
  • ****
  • Posts: 101
  • Country: in
  • Reputation: 0
    • View Profile
Re: Single Electron Transistor
« Reply #5 on: December 27, 2012, 21:17 »
I don't know why you are getting error every time.
But I can say one thing, study and follow the benzene manual strictly.
wherever u get the error, copy the corresponding code from the codes given by me and paste it in your document, save it and run again.

They will work definitely, But don't go to them unless you got some error in the manual code.
I designed 5 single electron transistors and simulated them successfully earlier.

But don't worry, all these errors comes when you are working on the tool for the first time.

 8) :)


   

Offline zh

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1141
  • Reputation: 24
    • View Profile
Re: Single Electron Transistor
« Reply #6 on: December 28, 2012, 00:12 »
As replied by AB, you have to care of the indentation. In particular for the lines below "for gate_voltage in gate_voltage_list:", they should be indented with a "TAB" or several blanks spaces, because they belong to the part of a loop.  Strongly suggest you to learn a bit of Python grammar. It will be helpful for you to write or copy the ATK script by yourself.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Single Electron Transistor
« Reply #7 on: December 28, 2012, 00:38 »
I need to point out two or three things here.

First of all, the SET tutorial is rather "advanced" because it involves a lot of scripts. Now, it's not strictly necessary to have a lot of experience in Python programming to complete the tutorial, but it helps a lot to troubleshoot simple mistakes like the indentation issue we started out with in this thread, but that was easy to solve, and as long as you copy the scripts exactly, there shouldn't be any issues with the Python syntax etc.

The part that makes the tutorial tricky is instead the fact that there is a lot of data being stored in various NC files and read by scripts and plotted, etc. It would of course be nice if all that could be done in VNL directly, and we are working on such a framework, but for now it's very important to understand how ATK stores data in the NC files, not least in order to be able to work around small hickups with the scripts.

In the current situation, your problem is that you are reading some data from a NC file using object_id='gID1'. However, it would appear that there is no such object in the file, and indeed this appears to stem from a possible typo in the tutorial. Try to replace this with object_id='gID001' and rerun the script. For future reference, to troubleshoot this kind of problems, if you select the NC file in VNL, the object IDs are listed in the Result Browser panel.

The second issue you report appears to have occurred by trying to fix the first error in an unsuccessful way, so it is perhaps not relevant.

I should also point out that the current version of the tutorial, on the website, is adapted for ATK 12.2/12.8, so there may be small - or large - differences if you are using such an older version as ATK 11.2.

In general, and in particular for such a complex tutorial as this, please be very careful to state which script you are running when reporting problems (ideally attach the script), otherwise it becomes very difficult to advise. I would also recommend, in the case of this tutorial, to run the scripts from the command line rather than inside VNL.
« Last Edit: December 28, 2012, 00:40 by Anders Blom »

Offline researcher

  • Regular QuantumATK user
  • **
  • Posts: 9
  • Country: in
  • Reputation: 0
    • View Profile
Re: Single Electron Transistor
« Reply #8 on: December 28, 2012, 07:54 »

I just changed gID1 to gID002


#filename of the data file
filename = 'benzene_set0.nc'
# read electro-static potential with gate potential 0 Volt
potential0 = nlread(filename, object_id = 'gID002')[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)


though there was no error this time ,however it just finished as soon as it began.

+------------------------------------------------------------------------------+
| NanoLanguageScript execution started                                         |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
|                                                                              |
| Atomistix ToolKit 11.2.2 [Build 3069]                                        |
|                                                                              |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
| NanoLanguageScript execution finished                                        |
+------------------------------------------------------------------------------+

Please do reply.

Offline researcher

  • Regular QuantumATK user
  • **
  • Posts: 9
  • Country: in
  • Reputation: 0
    • View Profile
Re: Single Electron Transistor
« Reply #9 on: December 28, 2012, 08:07 »
from NL.IO.NLSaveUtilities import nlinspect
#define function for reading in total energy and gate voltage data from a file
def readTotalEnergy(filename):
    """
    function for reading a list of total energies and gate voltages from a file
       @param filename : filename of the netcdf file
       @return voltages, energies : list of gate voltages and energies
                                    found in filename
    """
    if filename == None:
        return
    #get list of data in file
    file_data = nlinspect(filename)
    if file_data == None:
        raise ValueError, "Wrong file format"
    total_energy_list = numpy.array([])
    gate_voltage_list = numpy.array([])
    for id in file_data:
        if (id[0] == 'TotalEnergy'):
            total_energy=nlread(filename, object_id = id[1])[0]
            total_energy_list = numpy.append(total_energy_list,
                                             total_energy.evaluate().inUnitsOf(eV))
            #extract the gate voltage from the id of the data
            if id[1][0:3] == 'gID':
                gate_voltage = 0.0
            else:
                gate_voltage = float(id[1].strip(
                             "abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVXYZ"))
            gate_voltage_list = numpy.append(gate_voltage_list,gate_voltage)
    if len(total_energy_list) ==0:
        raise ValueError, "No total energy in NC file"
    #sort the data
    index_list = numpy.argsort(gate_voltage_list)
    return gate_voltage_list[index_list], total_energy_list[index_list]



for the above script
i got no result
it too ended as soon as it began



+------------------------------------------------------------------------------+
| NanoLanguageScript execution started                                         |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
|                                                                              |
| Atomistix ToolKit 11.2.2 [Build 3069]                                        |
|                                                                              |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
| NanoLanguageScript execution finished                                        |
+------------------------------------------------------------------------------+




Please do reply

Regards
Researcher

Offline Shan

  • QuantumATK Guru
  • ****
  • Posts: 101
  • Country: in
  • Reputation: 0
    • View Profile
Re: Single Electron Transistor
« Reply #10 on: December 28, 2012, 08:48 »
No need to run the inducedpot.py (9 line code after gatescan0.py) file 5 times, just run it only once, in 4th line replace gID1 with gID001.

After it, the last code posted by u is readTotalEnergy.py , copy the code given by me and save it as readTotalEnergy.PY. This is an intermediate code, it will not produce any external output.
if it is succesfully completed.

go to the next code which produces TE Vs Vg plot. this code works properly and no need to save this code.

 next code also works fine. no need to save it.

The last and final code to plot charge stability diagram, copy the code given by me "setcsd.py" and save it, run it.



Go ahead...
 8)  :) ;D




 

Offline researcher

  • Regular QuantumATK user
  • **
  • Posts: 9
  • Country: in
  • Reputation: 0
    • View Profile
Re: Single Electron Transistor
« Reply #11 on: December 28, 2012, 10:23 »
sir
as suggested by you i ran total energy for te vs gv plot but it showed the following error



+------------------------------------------------------------------------------+
| NanoLanguageScript execution started                                         |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
|                                                                              |
| Atomistix ToolKit 11.2.2 [Build 3069]                                        |
|                                                                              |
+------------------------------------------------------------------------------+
Traceback (most recent call last):
  File "c:\users\guest\appdata\local\temp\9424093850827525.py", line 3, in <module>
    from readTotalEnergy import readTotalEnergy
ImportError: No module named readTotalEnergy
NanoLanguageScript execution failure
+------------------------------------------------------------------------------+
| NanoLanguageScript execution finished                                        |
+------------------------------------------------------------------------------+

please do reply


Offline Shan

  • QuantumATK Guru
  • ****
  • Posts: 101
  • Country: in
  • Reputation: 0
    • View Profile
Re: Single Electron Transistor
« Reply #12 on: December 28, 2012, 10:51 »
Have you saved the readTotalEnergy.py in home or not. check the spelling of the file name as well  (use the code given by me).
If u saved it in home then there should be an output file readTotalEnergy.pyc.
« Last Edit: December 28, 2012, 10:58 by DOIT NOW »

Offline researcher

  • Regular QuantumATK user
  • **
  • Posts: 9
  • Country: in
  • Reputation: 0
    • View Profile
Benzene Single Electron Transistor
« Reply #13 on: January 4, 2013, 10:15 »
Sir
In the SET environment the charging energies in the paper titled "First-principles modelling of molecular
single-electron transistors" by Stokbro sir and the values given in the Benzene SET manual by ATK are different.
Please do reply
Regards
researcher

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Single Electron Transistor
« Reply #14 on: January 4, 2013, 20:04 »
Slightly different parameters were used, and actually if I recall correctly we corrected a few bugs which affected the paper.

However, the results in the paper are in no way intended to be interpreted as quantitatively relevant; the articles is about the methodology, not a realistic system (if you compute the forces on the benzene molecule, you will see that it will explode with gates placed this close).