Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - esp

Pages: 1 2 [3] 4 5 ... 22
31
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?

32
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

33
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!


34
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 ..

35
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

36
number of electrons per unit length in transprt direction would be great ... if only i could decipher how to do it

37
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?

38
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

39
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?


40
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 ... ?

41
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

42
>> 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()?

43
ok thank you ...

So then why is the integral method not exactly equal to the .sum() method ... ?

44
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

45
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()

Pages: 1 2 [3] 4 5 ... 22