QuantumWise Forum
May 20, 2013, 05:45 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: NAPHTHALENE based SET: The length of the lists must be at least 3  (Read 295 times)
0 Members and 1 Guest are viewing this topic.
DOIT NOW
Regular ATK user
**

Reputation: 0
Offline Offline

India India

Posts: 32


View Profile
« on: July 13, 2012, 11:59 »

dear expert,
when i am running the script for self-consistent charge stability diagram for NAPHTHALENE based SET , i am getting the error "NLValueError: The length of the lists must be at least 3."

what to do...


+------------------------------------------------------------------------------+

| NanoLanguageScript execution started |

+------------------------------------------------------------------------------+

+------------------------------------------------------------------------------+

| |

| Atomistix ToolKit 11.2.2 [Build 3069] |

| |

+------------------------------------------------------------------------------+

Traceback (most recent call last):

File "c:\docume~1\cntl\locals~1\temp\9885082076267089.py", line 35, in <module>

f = SplineInterpolation1D(voltage_list,energy_list[i+1]-energy_list)

File ".\zipdir\NL\Math\SplineInterpolation.py", line 22, in __init__

File ".\zipdir\NL\Math\SplineInterpolation.py", line 101, in setAndCheckArray

NL.ComputerScienceUtilities.Exceptions.NLValueError: The length of the lists must be at least 3.

NanoLanguageScript execution failure

+------------------------------------------------------------------------------+

| NanoLanguageScript execution finished |

+------------------------------------------------------------------------------+


thanks for reading.
Logged
Anders Blom
QuantumWise Staff
Supreme ATK Wizard
*****

Reputation: 36
Offline Offline

Denmark Denmark

Posts: 2802



View Profile WWW
« Reply #1 on: July 13, 2012, 13:10 »

In order to use the spline interpolation you need at least 3 points, but for some reason the input you have provided only has one or two points.
Logged
DOIT NOW
Regular ATK user
**

Reputation: 0
Offline Offline

India India

Posts: 32


View Profile
« Reply #2 on: July 13, 2012, 13:20 »

  Anders this is the code i have used. check it and suggest some solution please .



from readTotalEnergy import readTotalEnergy
import pylab
# define the work function of gold
w = 5.28
#gate bias interval
v_g_interval = numpy.linspace(-10,10,201)
#source-drain bias interval
v_sd_interval = numpy.linspace(-15,15,301)
#----------finished define parameters ----------#
#read in the total energy data from the files: naphathalene_set[-2,-1,0,1,2].nc
voltage_list= []
energy_list = []
#loop over the charge states
charge_states = [-2,-1,0,1,2]
for q in charge_states:
    voltage,energy = readTotalEnergy('naphthalene_set'+str(q)+'.nc')
    voltage_list = voltage_list + [voltage]
    # add energy of additional/missing electrons on benzene
    energy = energy -q*w
    energy_list = energy_list + [energy]
# make numpy arrays instead of lists
voltage_list = numpy.array(voltage_list)
energy_list = numpy.array(energy_list)
#make function that can return the charging energies
charging_energy = []
for i in range(len(charge_states)-1):
    f = SplineInterpolation1D(voltage_list,energy_list[i+1]-energy_list)
    charging_energy = charging_energy + [f]
#calculate number of charge states in the bias window
def conductionChannels(v_g,v_sd):
    channels = 0
    for f in charging_energy:
        channels = channels + (abs(f(v_g)) <= abs(v_sd/2) )
    return channels
#Generate the mesh points of the contour plot
X, Y = numpy.meshgrid(v_g_interval,v_sd_interval)
#evaluate number of charge states for each mesh point
Z = [ conductionChannels(X[i,j],Y[i,j])
     for i in range(numpy.shape(X)[0])
          for j in range(numpy.shape(X)[1])]
Z = numpy.array(Z).reshape(numpy.shape(X))
#make the plot
pylab.contour(X,Y,Z)
pylab.contourf(X,Y,Z)
pylab.xlabel("Gate voltage (Volt)")
pylab.ylabel("Source-Drain bias (Volt)")
pylab.show()
Logged
Anders Blom
QuantumWise Staff
Supreme ATK Wizard
*****

Reputation: 36
Offline Offline

Denmark Denmark

Posts: 2802



View Profile WWW
« Reply #3 on: July 13, 2012, 13:25 »

As mentioned in the other post, if the tutorial is followed exactly, this should work, but it seems you have too few voltage points. The problem is not in this script, but in the calculations leading up to it, where you specified how many voltages to scan over etc.
Logged
DOIT NOW
Regular ATK user
**

Reputation: 0
Offline Offline

India India

Posts: 32


View Profile
« Reply #4 on: July 13, 2012, 15:00 »

thank you Anders , you are correct.
In Naphthalene SET .nc file i don't have all gate voltage values, the nc file is showing only for -8.
I will do this Naphthalene work from starting again.


But suggest me for benzene error which i posted in another post.

thank you again Anders sir.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2008, Simple Machines Valid XHTML 1.0! Valid CSS!