QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: eastnobil on March 25, 2012, 15:39

Title: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: eastnobil on March 25, 2012, 15:39
Why can not calculate the ElectronDensity of Bulk configuration using ATK-SE? But I found the ElectronDifferent Density can be calculated. see attachment as following.
What is the meaning of ElectronDifferentDensity if the Electron Density can not be calculated?
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: kstokbro on March 25, 2012, 22:04
You can calculate the electron density with ATK-DFT, however, electron density is not supported fro ATK-SE.

Attached is from the reference manual:
ElectronDifferenceDensity, returns the electron difference density, i.e. the difference between the self-consistent valence charge density and the superposition of atomic valence densities.
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 11, 2012, 20:20
I need to calculate the "charge" in the channel to try to estimate capacitance for a GNR device ... from some relevant papers, i see the technique many use use is to calculate a small change in charge with respect to gate voltage (for Cgate for example) .. Q = CV, C = dQ/dV ... now, the idea i found in another post was to use the ElecronDensity, then add it up for example over the entire channel to get charge .. I was planning on calculating Q1 at V1, then Q2 and V2, then C = (Q2-Q1)/(V2-V1) .... does this all sound reasonable?

Now, I have been running ElectronDensity all week .. I cannot get it to converge .. my current job is 36 hours running, still on the base calculation .. no points completed yet ... it is taking forever ... i even reduced the k points a bit and the energy range ... it never got to the Elec.Dens. calc yet ...   [Update:  As Dr. Blom noted, it is the base calculation taking a long time to converge, not the E.D. calculation]

So, I am wondering, I believe i tried before and electron difference density was faster ... is this expected?  if so, then wouldn't the method above of calculating difference in charge at two gate voltages give the same answer?  In other words if i am interested in the difference at two different gate voltages and not the absolute value of charge or elec dens, then wouldnt both methods give the same answer, if i used either ElectronDensity, or ElectronDifferenceDensity?
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 11, 2012, 21:37
The electron density calculation itself is a simple step after the main calculation is converged. So, one cannot say that the electron density doesn't converge.

So, I would assume you have trouble converging the self-consistent device calculation. But without knowing anything about that, it's impossible to provide any guidance beyond the generic, which I think you know very well already.

But this really has nothing to do with which quantity you attempt to compute, since as you mention, you apparently never even get to this point in the script. To reiterate: ATK first converges the self-consistent calculation, and then, afterwards, computes stuff like band structure, potentials, LDOS, and electron density. But all of that is not taken into consideration for the self-consistent calculation, nor are (typically) the post-processing steps in any way difficult (time-consuming, perhaps, but there is a progress bar).

Finally, indeed the difference between two ElectronDensity objects and two ElectronDifferenceDensity objects is identical.
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 11, 2012, 21:44
ok thank you very much
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 11, 2012, 21:47
i would add though that it seems that ElectronDifferenceDendity uses Huckel, while ElectronDensity uses DFT, which in my case seems to be why the base calculation converges much more easily for EDD than ED ... I will retry with Huckel
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 11, 2012, 21:50
No, you cannot say it this way. If you have a Huckel calculation, then you can only ask for the difference density, if you have DFT you can ask for both. It's not the other way around (i.e. the density calculators do not "use" any method).
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 11, 2012, 22:05
i understand, thank you ...
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 12, 2012, 18:13
Ok so i got some results, ran Electron Difference Density at two different gate voltages ... then i did this:

   diffDensity1 = nlread(fName, ElectronDifferenceDensity, object_id="diffDensity[vg-0.25000][vds0.50000]")[0]
   diffDensity2 = nlread(fName, ElectronDifferenceDensity, object_id="diffDensity[vg-0.20000][vds0.50000]")[0]

   s1 = diffDensity1[:, :, :].sum()
   s2 = diffDensity2[:, :, :].sum()
   print s1, s2, s2-s1

I got this:

EDD at V1:  2.49328980937 1/Bohr**3
EDD at V2:  2.62952644165 1/Bohr**3
EDD difference:  0.136236632277 1/Bohr**3

So does this mean 0.136 electrons per Bohr^3 ? Also I cannot figure out how to convert to 1/Angstrom**3 .. I have tried inUnitsOf() in different forms but it did not work...

also, since this is graphene .. volume does not seem to make sense .. how do i get a 2d calculation, or is it already 2d anyway, since there is only 2d graphene?
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 12, 2012, 18:55
ok i did this, does it make sense?

Code
	diffDensity1 = nlread(fName, ElectronDifferenceDensity, object_id="diffDensity[vg-0.25000][vds0.50000]")[0]
diffDensity2 = nlread(fName, ElectronDifferenceDensity, object_id="diffDensity[vg-0.20000][vds0.50000]")[0]

s1 = diffDensity1[:, :, :].sum()
s2 = diffDensity2[:, :, :].sum()
print s1, s2, s2-s1

shape1 = diffDensity1.shape()
shape2 = diffDensity2.shape()

# Find the volume elements.
dX1, dY1, dZ1 = diffDensity1.volumeElement()
dX2, dY2, dZ2 = diffDensity2.volumeElement()

# Calculate the unit area in the y-x plane.
dAYX1 = numpy.linalg.norm( numpy.cross(dY1,dX1) )
dAYX2 = numpy.linalg.norm( numpy.cross(dY2,dX2) )

# calculate density along z integrated over y,x
n_z1 = [ diffDensity1[:,:,i].sum() * dAYX1 for i in range(shape1[2]) ]
n_z2 = [ diffDensity2[:,:,i].sum() * dAYX2 for i in range(shape2[2]) ]

dz1 = dZ1.norm()
sum1 = 0 * Units.Bohr**-2
for i in range(shape1[2]):
print dz1*i, n_z1[i]
sum1+=n_z1[i]*dz1
print 'total density1=', sum1

dz2 = dZ2.norm()
sum2 = 0 * Units.Bohr**-2
for i in range(shape2[2]):
print dz2*i, n_z2[i]
sum2+=n_z2[i]*dz2
print 'total density2=', sum2

print s1, s2, s2-s1
print 'diff', sum2-sum1


I get:

0.0465095588926 1/Bohr**2

now i think this means, in a slice of X-Y plane, this is the density difference (difference) per area, due to the change in voltage ... correct?  and so to translate this over the whole channel in the Z direction .. i would have to do what exactly? 
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 12, 2012, 19:20
actually the documentation page does not make sense to me ..

http://quantumwise.com/documents/manuals/latest/ReferenceManual/index.html/ref.electrondifferencedensity.html

it says:
Read in the electron difference density from a file and print d(x) = int { n(x,y,z)dydz }

but the calculation looks like it first calculates d(x) as above, then integrates that over dx, so it seems it calculates the integral over all x,y,z isnt that correct?  then why does it say print out d(x) = int { n(x,y,z)dydz } when it is printing out d(x) = int { n(x,y,z)dydzdx } ??

Update: ok i see that is referring to the intermediate print statements before the sum is printed .. but then still the question is, why is sum not equal to a simple sum like this, without doing the whole piece by piece integration?
   s1 = diffDensity1[:, :, :].sum()
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 12, 2012, 19:48
ok here is a full script, does it makes sense for calcaulting gate capacitance in channel of GNR? 

Code
	diffDensity1 = nlread(fName, ElectronDifferenceDensity, object_id="diffDensity[vg-0.25000][vds0.50000]")[0]
diffDensity2 = nlread(fName, ElectronDifferenceDensity, object_id="diffDensity[vg-0.20000][vds0.50000]")[0]

s1 = diffDensity1[:, :, :].sum()
s2 = diffDensity2[:, :, :].sum()
print s1, s2, s2-s1

shape1 = diffDensity1.shape()
shape2 = diffDensity2.shape()

# Find the volume elements.
dX1, dY1, dZ1 = diffDensity1.volumeElement()
dX2, dY2, dZ2 = diffDensity2.volumeElement()

# Calculate the unit area in the y-x plane.
dAYX1 = numpy.linalg.norm( numpy.cross(dY1,dX1) )
dAYX2 = numpy.linalg.norm( numpy.cross(dY2,dX2) )

print dAYX1, dAYX2

# calculate density along z integrated over y,x
n_z1 = [ diffDensity1[:,:,i].sum() * dAYX1 for i in range(shape1[2]) ]
n_z2 = [ diffDensity2[:,:,i].sum() * dAYX2 for i in range(shape2[2]) ]

dz1 = dZ1.norm()
sum1 = 0 * Units.Bohr**-2
for i in range(shape1[2]):
#print dz1*i, n_z1[i]
sum1+=n_z1[i]*dz1
print 'total density1=', sum1

dz2 = dZ2.norm()
sum2 = 0 * Units.Bohr**-2
for i in range(shape2[2]):
#print dz2*i, n_z2[i]
sum2+=n_z2[i]*dz2
print 'total density2=', sum2

print 'diff', s1, s2, s2-s1
print 'diff', sum1, sum2, sum2-sum1

# let's use s2-s1 as difference in # electrons in channel due to voltage
numElecDiff = (s2-s1).inUnitsOf(Bohr**-3)
print "numElecDiff", numElecDiff
# convert to coulombs
chargeDiff = numElecDiff*1.6e-19
voltDiff = 0.05
capacitance = chargeDiff/voltDiff
print "capacitance in F", capacitance

the voltage difference and voltages i used would need to be chosen carefully, and in fact i am going to average over two cap values found at off end, and at on end ... fyi
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 12, 2012, 22:17
You're fast on the trigger with the posts, so I have to answer out of sequence :) Let's see if I cover all points.

First of all, you will find this useful, for converting units:
Code: python
x=(1/Bohr)**3
x.inUnitsOf(Ang**-3)
which prints 6.748342563230854.

Even if your system is 2D, the electrons are not, the electron cloud has a finite extension beyond the graphene plane, perpendicular to it. The difference you compute is for the entire simulation cell, and so it is normalized by the cell volume. That is, if you ran the simulation with twice as much vacuum around the graphene sheet (which obviously should not affect the result, provided there is "enough" vacuum in both cases), the density values drop by a factor 2. Hence it is appropriate to multiplying by dimension in which you have vacuum to get a 2D density. I'm not sure that's what you do - I would probably just multiply by the cell length perpendicular to the sheet.

For the integral over dx, I think you have just misread the formulas. It's not a piecewise integration over x, it's an integral over dydz for each value of x. So the result is a function of x still. What you write d(x) = int { n(x,y,z)dydzdx } makes no mathematical sense. In fact, int { n(x,y,z)dydzdx } is a pure number, viz. the number of electrons in the system. And that is indeed equal to the .sum() you used, provided of course you also multiply by the volume element.

Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 12, 2012, 22:21
ok thank you ...

So then why is the integral method not exactly equal to the .sum() method ... ?
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 12, 2012, 22:30
You mean d(x) or the point about the volume element?
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 12, 2012, 23:00
>> Even if your system is 2D, the electrons are not, the electron cloud has a finite extension beyond the graphene plane, perpendicular to it. The difference you compute is for the entire simulation cell, and so it is normalized by the cell volume. That is, if you ran the simulation with twice as much vacuum around the graphene sheet (which obviously should not affect the result, provided there is "enough" vacuum in both cases), the density values drop by a factor 2. Hence it is appropriate to multiplying by dimension in which you have vacuum to get a 2D density. I'm not sure that's what you do - I would probably just multiply by the cell length perpendicular to the sheet.

All makes sense, except the last part ... I am not sure what is the cell length?

>> For the integral over dx, I think you have just misread the formulas. It's not a piecewise integration over x, it's an integral over dydz for each value of x. So the result is a function of x still. What you write d(x) = int { n(x,y,z)dydzdx } makes no mathematical sense. In fact, int { n(x,y,z)dydzdx } is a pure number, viz. the number of electrons in the system. And that is indeed equal to the .sum() you used, provided of course you also multiply by the volume element.

Ok, above, great, i understand that .. but then why is this:

s1 = diffDensity1[:, :, :].sum()

Not equal to the result from this loop (sum1)?
Code
        dz1 = dZ1.norm()
sum1 = 0 * Units.Bohr**-2
for i in range(shape1[2]):
#print dz1*i, n_z1[i]
sum1+=n_z1[i]*dz1
print 'total density1=', sum1
In this loop above, n_z1 is the already calculated integral of ElectronDifferenceDensity over X and Y (in my adaptation of the example)  ... so just like your example on the ElectronDifferenceDensity manual page, this is n(z) = int { n(x,y,z)dxdy } ...

Then this loop above, integrates over z right? ...  so again my confusion why this is not equal to s1 = diffDensity1[:, :, :].sum()?
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 12, 2012, 23:20
The unit cell for the system has a length in all three directions, that's what I meant.

An integral is not only a sum of the values of f(x), it's a sum of f(x)*dx.
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 12, 2012, 23:42
ok i am almost there but let me go line by line to make sure i understand .. first of all let me say that i realize for what i want, i can use sum(), that is good enough ... but i still want to understand this calculation because it could be useful .... please stop me where i am making a mistake

1) ok read in DD at bias1:

diffDensity1 = nlread(fName, ElectronDifferenceDensity, object_id="diffDensity[vg-0.25000][vds0.50000]")[0]

2) this gets dimensions of array?
shape1 = diffDensity1.shape()

3) this just separates components?
dX1, dY1, dZ1 = diffDensity1.volumeElement()

4) this would get unit area in XY plane?
dAYX1 = numpy.linalg.norm( numpy.cross(dY1,dX1) )

5) this calculates the integral n(z) = int { d(x,y,z)dydx } for each value of z, and stores them in the n_z1 array, indexed by the z index ... so this is the density, per unit area in XY, at each value of z right?
n_z1 = [ diffDensity1[:,:,i].sum() * dAYX1 for i in range(shape1[2]) ]

6) this is where my confusion is i think:

here we now take each value in z, and we sum them all up multiplying by dz ... so sum1 = int{ n(z)dz } ...  and if it is, then why is this not equivalent to: int{ n(z)dz } = int{ int { d(x,y,z)dydx } dz } = int{ d(x,y,z)dydxdz } ? 

Code
	dz1 = dZ1.norm()
sum1 = 0 * Units.Bohr**-2
for i in range(shape1[2]):
#print dz1*i, n_z1[i]
sum1+=n_z1[i]*dz1
print 'total density1=', sum1

If all above are true, then the value of sum1 should be the same as:
s1 = diffDensity1[:, :, :].sum()

I am sorry, I am not sure where I am going wrong here ,,.. but i do get two different answers .. please tell which step in my explanation is wrong
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 12, 2012, 23:51
All is correct, almost :)

3) Not quite, but by 4) you are on the right track again.

6) Indeed, this is the small misconception. .sum() is different from the integral by a factor equal to the volume element. To check this, remove dAXY1 from the integral over XY, and remove dz1 from the integral over Z, then you get the same values in both methods. Or, conversely, multiply the .sum() by numpy.dot(dZ1,cross(dX1,dY1)).
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 13, 2012, 00:00
For a very trivial example:

Code: python
# Estimate the integral of 3x^2 from 0 to 1 (should be 1):
dx = 0.0001
# Generate x-values from 0 to 1 (end-points included, via dx/2)
x = numpy.arange(0,1+dx/2.0,dx)
y = 3*x**2
print sum(y)*dx

Depending on dx, the value is close to 1.

sum(y) is however not 1 - far from it, it becomes larger and larger with smaller dx. This is your sum(), which thus is not the same as the integral.
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 13, 2012, 00:10
i get it now .. sum() is a density sum, not the number of electrons ... i missed that part ..

So then i think this is correct:

   s1 = diffDensity1[:, :, :].sum()
   s2 = diffDensity2[:, :, :].sum()
   dX1, dY1, dZ1 = diffDensity1.volumeElement()
   dX2, dY2, dZ2 = diffDensity2.volumeElement()
   s1 = numpy.dot(dZ1,numpy.cross(dX1,dY1))*s1.inUnitsOf(Bohr**-3)
   s2 = numpy.dot(dZ2,numpy.cross(dX2,dY2))*s2.inUnitsOf(Bohr**-3)
        print "Total # electrons: ", s1, s2   
        numElecDiff = (s2-s1)
   print "numElecDiff", numElecDiff

Where the end answer is the number of electrons added from the increase in voltage, since densities 1 and 2 were at lower and higher voltages, respectively .. but something is not right here, because the # of electrons is less than 1 over the entire volume ... or is that per unit volume? if per unit volume, how do i get the number of electrons ... ?
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 13, 2012, 00:20
Yes, it's per unit volume. The number of electrons is obtained by multiplying with the volume of the unit cell.
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 13, 2012, 01:10
how do i get the entire volume? remember i need charge in the channel not charge in a unit volume

Ok, I did the following ... if i have the density per unit volume, and it seems the unit length is about 0.7 Bohr in the x direction, perpendicular to the 2d plane, some very rough estimate of channel charge (for 2D graphene only) could be to multiply this by the channel length, and its width .... this would assume that the 0.7 Bohr in the x-direction is a large enough "thickness" to encapsulate the charge of the Carbon atoms, which it is not ... but in the absence of knowing how to get the actual volume, ..  very roughly ...

i took my density per unit volume, and multiplied by 160 angstrom (16 nm channel length), and 12.9 angstrom (1.29 nm channel width) .. and i redid this for -0.25V (totaly off) and 0.0 volts (halfway on), and i get

Total # electrons:  before: 1756.83419532 after: 3626105.77915
numElecDiff 3624348.94495
capacitance in pF:  2.31958332477

Well now this sounds more reasonable .. but i know it is not actually correct ... if i could know how to get the actual volume of the ribbon that includes all the electrons, i think i would be set ... now another question is too .. when you run ElectronDifferenceDensity, is it only the scattering region, or the whole device?

Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 13, 2012, 03:59
also i would not be using off and half on as the points, but thats all i have for now ... i just want to get the calculation right first as i wait for results
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 13, 2012, 09:24
The electron density is normalized by the actual volume of the simulation cell, the volume of which you can compute by hand by just looking at the configuration (you know the Bravais lattice or UnitCell), or you can do

Code: python
cA, cB, cC = density_object.unitCell()
cell_volume = numpy.dot(cC, numpy.cross(cA,cB))*Bohr**3
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 13, 2012, 09:33
Cells? There is only one cell. What's important to understand is that if you integrate the density (not the difference) over the entire volume of the simulation cell you get the number of electrons. That gives you the normalization. I may be wrong regarding the need to multiply your result with the volume, however. Just check that you can integrate the densities (not their difference) to give the number of electrons, then you know it's all normalized.
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 13, 2012, 09:50
Ok let's try one more time, two difference densities at two different voltages:
Code
	diffDensity1 = nlread(fName, ElectronDifferenceDensity, object_id="diffDensity[vg-0.25000][vds0.50000]")[0]
diffDensity2 = nlread(fName, ElectronDifferenceDensity, object_id="diffDensity[vg0.00000][vds0.50000]")[0]

        s1 = diffDensity1[:, :, :].sum()
s2 = diffDensity2[:, :, :].sum()

        cA1, cB1, cC1 = diffDensity1.unitCell()
dV1 = numpy.dot(cC1, numpy.cross(cA1,cB1))
cA2, cB2, cC2 = diffDensity2.unitCell()
dV2 = numpy.dot(cC2, numpy.cross(cA2,cB2))

numE1b = s1.inUnitsOf(Angstrom**-3)*dV1
numE2b = s2.inUnitsOf(Angstrom**-3)*dV2
print "Total # electrons: ", numE1b, numE2b

        numElecDiff = (numE2b-numE1b)
  print "numElecDiff", numElecDiff
is numElecDiff the number of electrons that were injected because of raising the voltage?
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 13, 2012, 09:56
Start by checking the densities individually, not the difference (since we don't know what to expect there).

But, no, I would use the previous scheme with the volume element, that makes more sense for the normalization, to get the number of electrons.

The reason to involve the unit cell will be separate; after all, you are probably not too interested in the absolute number of electrons, but probably the number per unit area (or unit length, perhaps).
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 13, 2012, 11:17
number of electrons per unit length in transprt direction would be great ... if only i could decipher how to do it
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 13, 2012, 11:19
Are you sure it should be in the transport direction? Is it a ribbon or a sheet you are working with?
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 13, 2012, 11:20
GNR TFET, two probe, 16nm long, 1.29nm wide .... i am trying to get the charge in the channel under different biases to calculate capacitance ... all i need is the total number of additional electrons from V1 to V2 .. then I want to do C = dQ/dV
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 13, 2012, 11:24
Ok, then once you have computed the number of electrons you can basically forget about the size of the unit cell, I think. I would have mattered if you had periodic boundary conditions in a sheet.

But I also think you are just concerned with the true number of electrons, so there is no further need for normalization once you have that number.

Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 13, 2012, 11:26
that sounds good, but i still dont know how to calculate the number of electrons ... you completely confused me .. i was going to quit but that only hurts me, so i can't... i can only keep asking questions ... what doesnt make sense to me is that if you have a density, why is it so difficult?  you just multiply by volume right? only problem is, I dont know how to get the volume .. and since we went around and back i got lost ..
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 13, 2012, 11:27
That is the integral of the density over the volume, like you did above. So, density[:,:,:].sum() times the volume of the volume element.
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 13, 2012, 11:34
I thought you had a nanosheet. All systems we simulate under periodic boundary conditions are effectively infinite, so there are infinitely many electrons. The number computed in this way is the number of electrons inside the simulation cell. So in that sense it's a number of electrons per a certain volume. The same would apply to any difference in densities. But for a quasi-1D device it's not so much an issue, then you can really talk about the absolute number of electrons inside the channel.
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 13, 2012, 11:34
ok .. now were getting somewhere ... !!!!

from the manual:

# Calculate the volume of the volume element.
dV = numpy.dot(dX, numpy.cross(dY,dZ)) * length_unit**3

Great!

Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 13, 2012, 11:46
and now for the results .....

if i calcualted correctly,

0.01pF per square um

so that is 10fF per square um might possibly make sense
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 13, 2012, 11:52
And probably (hopefully!) non-linear in the bias ;)
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 13, 2012, 21:16
Let's see if these numbers make sense:

Code
	diffDensity1 = nlread(fName, ElectronDifferenceDensity, object_id="diffDensity[vg-0.25000][vds0.50000]")[0]
diffDensity2 = nlread(fName, ElectronDifferenceDensity, object_id="diffDensity[vg-0.20000][vds0.50000]")[0]
diffDensity3 = nlread(fName, ElectronDifferenceDensity, object_id="diffDensity[vg0.00000][vds0.50000]")[0]

s1 = diffDensity1[:, :, :].sum()
s2 = diffDensity2[:, :, :].sum()
s3 = diffDensity3[:, :, :].sum()
print s1, s2, s3, s2-s1, s3-s2

# Find the volume elements.
dX1, dY1, dZ1 = diffDensity1.volumeElement()
dX2, dY2, dZ2 = diffDensity2.volumeElement()
dX3, dY3, dZ3 = diffDensity3.volumeElement()
length_unit1 = dX1.unit()
length_unit2 = dX2.unit()
length_unit3 = dX3.unit()
# Calculate the volume of the volume element.
dV1 = numpy.dot(dX1, numpy.cross(dY1,dZ1)) * length_unit1**3
dV2 = numpy.dot(dX2, numpy.cross(dY2,dZ2)) * length_unit2**3
dV3 = numpy.dot(dX3, numpy.cross(dY3,dZ3)) * length_unit3**3
print "volumes", dV1, dV2, dV3
numE1 = s1*dV1
numE2 = s2*dV2
numE3 = s3*dV3
print "Total # electrons: ", numE1, numE2, numE3

Output:

Code
2.49328980937 1/Bohr**3 2.62952644165 1/Bohr**3 3.18669569532 1/Bohr**3 0.136236632277 1/Bohr**3 0.557169253673 1/Bohr**3
volumes 0.341388054851 Bohr**3 0.341388054851 Bohr**3 0.341388054851 Bohr**3
Total # electrons:  0.851179358199  0.897688917092  1.08789984483

These are some pretty small volumes .. so this number of electrons is the number per a small volume element .. does it make sense if i now multiply this by device width and length to get total?
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 13, 2012, 21:46
Ok, hm, a few things.

Perhaps most important: the difference in two difference densities at two voltages IS INDEED the same as the difference in two densities at two voltages.

However, as you hinted at, the electron difference density would not integrate up to the number of electrons, I missed that point. Only the total electron density would do that. So the main purpose of the difference density is, indeed, to look at differences between different bias or gate voltages.

You don't need the total number of electrodes (or, you can't get it anyway), what you need is the change in electrons (charge, really) relative to the change in voltage. And that is properly described in this way. I think the numbers make sense also, a decent fraction of an electron (0.05-0.2) per 0.1 V or so (I assume) sounds about right.
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 13, 2012, 21:54
ok yes i thought something was strange about that ... but i did think it made sense the differences were the same .. ok ..

but still although this is all sound, it still this is then going to give me in the end, the change in charge, per this small volume correct? not the total change in charge in the device channel?
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 13, 2012, 22:01
the device itself gives a good on/off ratio of at least 10^5, so there is definitely a huge change in charge .. i just need to quantify that
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 13, 2012, 22:08
wouldnt it be as simple as multiplying the change in charge, per this small volume, but the total volume ?  If so, how to get that volume? I can use device width and length which I know, but I do not know the dimension in the direction perpendicular to the 2D graphene plane ... can I estimate maybe 1 Bohr ?
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 13, 2012, 22:13
It's not charge in the volume element, it's the total charge in the channel. A nanoribbon doesn't have a well-defined volume...
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 13, 2012, 22:14
ok then thank you very much .. it is just so small a capacitance so i was not sure .. ok thank you
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 13, 2012, 22:15
It's a nanoscale device, so yes the numbers are small.
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 13, 2012, 22:18
Thank you .. i will post the final script, could be helpful to others after all this discussion ...
This is a 2 probe GNR TFET device, 16nm long, 1.29nm wide

Code
	diffDensity1 = nlread(fName, ElectronDifferenceDensity, object_id="diffDensity[vg-0.25000][vds0.50000]")[0]
diffDensity2 = nlread(fName, ElectronDifferenceDensity, object_id="diffDensity[vg-0.20000][vds0.50000]")[0]
diffDensity3 = nlread(fName, ElectronDifferenceDensity, object_id="diffDensity[vg0.00000][vds0.50000]")[0]

s1 = diffDensity1[:, :, :].sum()
s2 = diffDensity2[:, :, :].sum()
s3 = diffDensity3[:, :, :].sum()
print s1, s2, s3, s2-s1, s3-s2

# Find the volume elements.
dX1, dY1, dZ1 = diffDensity1.volumeElement()
dX2, dY2, dZ2 = diffDensity2.volumeElement()
dX3, dY3, dZ3 = diffDensity3.volumeElement()
print "unit lengths", dX1,dY1,dZ1
print "unit lengths", dX2,dY2,dZ2
length_unit1 = dX1.unit()
length_unit2 = dX2.unit()
length_unit3 = dX3.unit()
# Calculate the volume of the volume element.
dV1 = numpy.dot(dX1, numpy.cross(dY1,dZ1)) * length_unit1**3
dV2 = numpy.dot(dX2, numpy.cross(dY2,dZ2)) * length_unit2**3
dV3 = numpy.dot(dX3, numpy.cross(dY3,dZ3)) * length_unit3**3
print "volumes", dV1, dV2, dV3
numE1 = s1*dV1
numE2 = s2*dV2
numE3 = s3*dV3
print "Total # electrons: ", numE1, numE2, numE3

# let's use s2-s1 as difference in # electrons in channel due to voltage
numElecDiff1 = (numE2-numE1)
numElecDiff2 = (numE3-numE2)
print "numElecDiff", numElecDiff1, numElecDiff2

# convert to coulombs
chargeDiff1 = numElecDiff1*1.6e-19
chargeDiff2 = numElecDiff2*1.6e-19
voltDiff1 = 0.05
voltDiff2 = 0.25
capacitance1 = chargeDiff1/voltDiff1
capacitance2 = chargeDiff2/voltDiff2
print "capacitance", (capacitance1), (capacitance2)

print "capacitance in fF", (capacitance1)*1e15, (capacitance2)*1e15

my results for reference:
Code
2.49328980937 1/Bohr**3 2.62952644165 1/Bohr**3 3.18669569532 1/Bohr**3 0.136236632277 1/Bohr**3 0.557169253673 1/Bohr**3
unit lengths [ 0.69774531  0.          0.        ] Bohr [ 0.          0.69769726  0.        ] Bohr [ 0.          0.          0.70126857] Bohr
unit lengths [ 0.69774531  0.          0.        ] Bohr [ 0.          0.69769726  0.        ] Bohr [ 0.          0.          0.70126857] Bohr
volumes 0.341388054851 Bohr**3 0.341388054851 Bohr**3 0.341388054851 Bohr**3
Total # electrons:  0.851179358199  0.897688917092  1.08789984483
numElecDiff 0.0465095588926  0.190210927734
capacitance 1.48830588456e-19  1.2173499375e-19
capacitance in fF 0.000148830588456  0.00012173499375
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 13, 2012, 22:36
since my device channel is 16nm x 1.29nm, i can say this capacitance is in units of:  fF / (16*1.29 sq nm) correct? 

Then I can convert to um^2 by multiplying by 16*1.29, and then by 1000*1000 ... this gives:
capacitance in fF per um sq 3071.86334574  2512.61027099

Now if all that is right, how can I convert to ITRS units of fF per um device width? .... multiply by the length in um? That gives:
capacitance in fF per um width 49.1498135318  40.2017643359

Does that make sense?
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 13, 2012, 22:43
The last point seems to make sense.

I was looking at this: http://arxiv.org/abs/0705.3068 - it gives numbers in pF/cm.

So if you have C of the order 1e-5 fF over a "gate length" of 1 nm it is 1 pF/cm.
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 14, 2012, 01:41
addition to script:

Code
	# convert to coulombs
chargeDiff1 = numElecDiff1*1.6e-19
chargeDiff2 = numElecDiff2*1.6e-19
voltDiff1 = 0.05
voltDiff2 = 0.25
capacitance1 = chargeDiff1/voltDiff1
capacitance2 = chargeDiff2/voltDiff2
print "capacitance", (capacitance1), (capacitance2)

capacitance1 /= 1e-15
capacitance2 /= 1e-15
print "capacitance in fF", (capacitance1), (capacitance2)

# (a in 1/nm**2)*(b in nm**2)=cap
# (a in 1/nm**2) = cap/(b in nm**2)
# above is fF over area of device, which is 16nm x 1.29nm = 20.64nm**2
deviceArea = 20.64 # in nm^2
capacitance1 /= deviceArea
capacitance2 /= deviceArea
print "capacitance in fF per nm^2", (capacitance1), (capacitance2)
capacitance1 = capacitance1*1e6
capacitance2 = capacitance2*1e6
print "capacitance in fF per um^2", (capacitance1), (capacitance2)

# multiply by device length in um
deviceLength = 0.016 # in um
capacitance1 = capacitance1*deviceLength
capacitance2 = capacitance2*deviceLength
print "capacitance in fF per um width", (capacitance1), (capacitance2)


Results:

Code
numElecDiff 0.0465095588926  0.190210927734 
capacitance 1.48830588456e-19  1.2173499375e-19
capacitance in fF 0.000148830588456  0.00012173499375
capacitance in fF per nm^2 7.21078432443e-06  5.89801326307e-06
capacitance in fF per um^2 7.21078432443  5.89801326307
capacitance in fF per um width 0.115372549191  0.094368212209
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 15, 2012, 10:20
one thing is bothering me here still ...

you said >> "a decent fraction of an electron (0.05-0.2) per 0.1 V or so (I assume) sounds about right"

So thinking of the definition of an electronvolt, yes that seems to make sense ... now, my numbers say that with .25V voltage difference on the gate, there are 0.19 more electrons in the channel ... now I know from transmission calculations that the whole range of gate voltage for this device, 0.5V, gives a current increase of current of about 100000x, or 10^5 ... so then it seems to me that the extra electrons in channel are really not helping the current much at all ... is that right?  i suppose since it is a tfet, and tunneling is happening only at one side (source side for n tfet) .. and it does not depend on their being any mosfet-like channel bridging source-drain for operation, then it all makes sense? 

I suppose as in the attached figure from "Tunneling Field-Effect Transistor: Capacitance Components and Modeling", my numbers are in line (my 0.1 fF/um versus theirs about 1.5 fF/um for a not so dissimilar device) with published results .. but then if that is the case .. then i think their picture of the inversion layer near the drain is misleading. .. if there are only a few extra electrons .. i would draw it extremeley thin .. do I have the right understanding here?
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: esp on November 15, 2012, 10:33
actually this figure is more appropriate .. they are using Si while i am using Graphene, but this figure shows a 25nm length device, mine is 16nm, so almost similar, and there they show Cgd (which makes up most of Cg), as between 0.2 and 1 fF/um .. so very similar numbers ..
Title: Re: Why can not calculate the ElectronDensity of Bulkconfiguration using ATK-SE?
Post by: Anders Blom on November 15, 2012, 10:49
Quote
i think their picture of the inversion layer near the drain is misleading

Their picture of the charge distribution is most likely based on a purely classical simulation (or actually not even a simulation, it's just a conceptual view), so there is no account for quantum effects. I think what we will increasingly see in the near future, as people start to study true nano-scale devices from an atomistic perspective, is that things are not so simple as the continuous models predict when you get down to these "extreme" length scales. Well established concepts will break down and a new understanding of how electrons behave in very confined dimensions will be necessary. Well, how the electrons themselves behave is rather well understood, but now we are adding electrostatic control, via the gates, and it's another level of complexity immediately.

So a lot of new simulations need to be done even for simple toy systems just to establish the new paradigm. I'm doing some calculations right now on a very, very thin Si nanowire set up as a p-i-n junction with a cylindrical wrap gate. The voltage drop is not symmetric!