QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: lknife on June 14, 2017, 16:48

Title: Can I run this command using VNL?
Post by: lknife on June 14, 2017, 16:48
Dear experts,

I am studying the tutorial "Modeling metal–semiconductor contacts: The Ag–Si interface". There is a script named "hdp.py" and need to be run by "atkpython hdp.py device.nc". Since I am using the windows system, I don't know how to run it through VNL.

Can anybody here help me with this problem?

Thank you very much for your kind help!
Title: Re: Can I run this command using VNL?
Post by: lknife on June 14, 2017, 17:04
I got the "ElectrostaticDifferencePotential" with ATK2015 instead of "HartreeDifferencePotential" with ATK2016. When I tried to run the hdp.py using job manager, an error message appeared:

------------------------------------------------
 File "hdp9nm.py", line 50, in <module>
    pot_z = pot_z.inUnitsOf(eV)
  File ".\zipdir\NL\CommonConcepts\PhysicalQuantity.py", line 1753, in inUnitsOf
NL.ComputerScienceUtilities.Exceptions.NLValueError: Unable to convert unit value V to an incompatible unit eV.
---------------------------------------------------------

Attached are the .py file and the .log file, wishing someone here can help me with this problem.

Thank you very much for you time and kind help!
Title: Re: Can I run this command using VNL?
Post by: Jess Wellendorff on June 15, 2017, 09:57
As mentioned in the ATK 2016 manual (http://docs.quantumwise.com/manuals/Introduction.html#atk-2016 (http://docs.quantumwise.com/manuals/Introduction.html#atk-2016)) the definitions of Hartree and Electrostatic potentials was changed with ATK 2016 and forward: EDP is now in units of of Volt, not eV. That's also exactly what the error message says.  More information at http://docs.quantumwise.com/manuals/Types/HartreePotential/HartreePotential.html#the-hartree-potential-and-the-electrostatic-potential (http://docs.quantumwise.com/manuals/Types/HartreePotential/HartreePotential.html#the-hartree-potential-and-the-electrostatic-potential)
Title: Re: Can I run this command using VNL?
Post by: lknife on June 15, 2017, 14:10
Thank you very much for you help!
Title: Re: Can I run this command using VNL?
Post by: lknife on June 15, 2017, 22:13
Even though I changed the unit of the ElectrostaticDifferencePotential to Volt, error messages still appeared:

-------------------------------------------------------------
Traceback (most recent call last):
  File "hdp9nm.py", line 50, in <module>
    pot_z = pot_z.inUnitsOf(Volt)
  File ".\zipdir\NL\CommonConcepts\PhysicalQuantity.py", line 739, in inUnitsOf
NL.ComputerScienceUtilities.Exceptions.NLValueError: Unable to convert unit value [-0.00435305 -0.00433779 -0.00432016 ...,  0.01351189  0.01346716
  0.01349285] Hartree to an incompatible unit V.
tible unit V.
-------------------------------------------------------------

Could you please help me to modify the hdp.py so that it can deal with the  ElectrostaticDifferencePotential and get the similar result as it deal with the HartreeDifferencePotential? I want it to read-in the ElectrostaticDifferencePotential from a .nc file in the script and can be run by Job manager.

Thank you very much for your time and kind help!
Title: Re: Can I run this command using VNL?
Post by: Jess Wellendorff on June 16, 2017, 07:55
The log file says you are now running ATK 2015, in which case you should stick to the "old" definitions of Hartree and Electrostatic potentials.
Title: Re: Can I run this command using VNL?
Post by: lknife on June 18, 2017, 05:00
I am sorry that I am a new born of ATK and do not know how to do as you said. Where and how to "stick" to the "old" definitions of Hartree and Electrostatic potentials ?

Thank you!
Title: Re: Can I run this command using VNL?
Post by: Jess Wellendorff on June 19, 2017, 08:50
OK, here goes:
- ATK 2015 and previous versions: The ElectrostaticPotential was defined from the solution to the Poisson equation, and had units of eV.
- ATK 2016 and later versions: The potential that solves the Poisson equation is now called the HartreePotential. So what use to be the EDP is now HDP. The "new" definition of EDP is
Code
EDP=-(HDP/e)
as explained in the ATK manual: http://docs.quantumwise.com/manuals/Types/HartreePotential/HartreePotential.html#hartreepotential-hartree-and-electrostatic (http://docs.quantumwise.com/manuals/Types/HartreePotential/HartreePotential.html#hartreepotential-hartree-and-electrostatic)

I attach two PNGs that illustrate this, and also the scripts used to run the calculations.
Title: Re: Can I run this command using VNL?
Post by: lknife on June 19, 2017, 17:58
Thank you very much for your reply!

However, what I wanted to do is to modify the hdp.py file in the tutorial "Modeling metal–semiconductor contacts: The Ag–Si interface" so that it can calculate the average of the ElectrostaticDifferencePotential along the z direction to avoid the the wiggles of the potential.

The script you posted here cannot help me with this problem.

Anyway, thank you very much again for your kind help!
Title: Re: Can I run this command using VNL?
Post by: lknife on June 19, 2017, 18:08
Do you mean that since EDP=-(HDP/e), I can get the HDP from EDP by adding these code lines to the script,

------------------------------------------------------------------
# Load the EDP previously calculated
pot1 = nlread(fname2, ElectrostaticDifferencePotential)[0]
# Convert the EDP to HDP
pot = -pot1*e
------------------------------------------------------------------

thus, after converting the EDP to HDP, I can use the hdp.py as usual?
Title: Re: Can I run this command using VNL?
Post by: Jess Wellendorff on June 20, 2017, 08:02
Conversion from EDP to HDP:
Code
EDP = nlread(fname, ElectrostaticDifferencePotential)[0]
(c_axis, edp_pot) = EDP.axisProjection(axis='c')
hdp_pot = -1 * edp_pot.inUnitsOf(Volt) *  elementary_charge * Volt
such that hdp_pot is the values of the average Hartree potential along points on the C-axis.
You can also use other axis projections: http://docs.quantumwise.com/manuals/Types/ElectrostaticDifferencePotential/ElectrostaticDifferencePotential.html#NL.Analysis.ElectrostaticDifferencePotential.ElectrostaticDifferencePotential.axisProjection (http://docs.quantumwise.com/manuals/Types/ElectrostaticDifferencePotential/ElectrostaticDifferencePotential.html#NL.Analysis.ElectrostaticDifferencePotential.ElectrostaticDifferencePotential.axisProjection)
Title: Re: Can I run this command using VNL?
Post by: lknife on June 20, 2017, 21:54
Thank you very much for your kind help! I'll try it.
Title: Re: Can I run this command using VNL?
Post by: lknife on June 21, 2017, 04:12
When I tried to run the script, it failed with these error messages:
---------------------------------------------------------------------------------
 File "hdp9nm_corrected version_new.py", line 44, in <module>
    pot = -1 * edp_pot.inUnitsOf(Volt) * elementary_charge * Volt
  File ".\zipdir\NL\CommonConcepts\PhysicalQuantity.py", line 739, in inUnitsOf
NL.ComputerScienceUtilities.Exceptions.NLValueError: Unable to convert unit value [ -92.51098596  -92.18665482  -91.81209356 ...,  287.15458342  286.20406093
  286.74999692] Hartree to an incompatible unit V.
tible unit V.
----------------------------------------------------------------------------------------------
Could you please help me more with this problem? Thank you very much for you kind help!
Title: Re: Can I run this command using VNL?
Post by: Anders Blom on June 21, 2017, 09:22
Obviously, you should change the unit (in the "inUnitsOf" part) in the script to eV or Hartree then, instead of V. I think you are mixing 2016 and 2015 too much for your own good. Stick to 2015, and all is easy - there is no HartreePotential, only ElectrostaticDifferencePotential, and it's in eV (or Hartree whatever you prefer). However, it actually is the same as the Hartree potential in 2016, but with opposite sign.
Title: Re: Can I run this command using VNL?
Post by: lknife on June 21, 2017, 20:07
I have solved the problem.

Thanks for all of you who helped me on this problem. I have learned a lot from you and I began to have some ideas on how to get information from the manual and write scripts of my own for a certain analysis.

However, I have another question on the EDP along z direction. I posted a topic named "What's wrong with my ElectrostaticDifferencePotential result?". For the EDP calculation, the bias was set to (0.1V, 0V) for the left electrode and right electrode, respectively. However, the potential did not end at the electrode at the preset values. Please see attached figures, can any of you help me with this problem? 

The device configurations for hdp9nm.png and hdp9nm_doping.png are the same. I doped the left part of the device (semiconductor part) for hdp9nm_doping with a n-doping level of 5*10^19 in order to shorten the screening length of the semiconductor part. It's the only difference between them. The bias for the EDP calculation was set to (0.1V, 0V). However, both of the figures did not end at the left electrode at 0.1V (or -0.1V). For hdp9nm, it ends at about 0.4 while for hdp9nm_doping, it ends at 1.0. I don't know why.

I appreciate you if you can help me with this problem.
Title: Re: Can I run this command using VNL?
Post by: lknife on June 21, 2017, 21:22
In tutorial "Modeling metal–semiconductor contacts: The Ag–Si interface", in section "Silicon doping and depletion layer length", there is no bias parameter set for the HartreeDifferencePotential calculation.

It was said in the tutorial that "The wiggles of the potential can make it hard to see if it has converged to the electrode value. ". That means, the potential could be converged to the electrode value. However, the two figures in this section are different. The obvious difference lies on the ending values (converging value) of the HartreeDifferencePotential at the two electrodes. For example, it ends at about 3eV at the right electrode in the first figure, while it ends at about 0eV in the second figure. Assuming the parameter settings (such as bias) for the calculations were the same, where did the inconsistence come from?

Can anyone tell me the meaning of the Y coordinate and help me with this problem?
Title: Re: Can I run this command using VNL?
Post by: Petr Khomyakov on June 22, 2017, 15:58
There is no bias voltage applied in this calculation. However, the Hartree Difference Potential (HDP) does not need to be the same in the left and right electrodes at zero bias. The definition of the HDP is discussed in Notes at http://docs.quantumwise.com/manuals/Types/HartreeDifferencePotential/HartreeDifferencePotential.html.

The second figure shows the same HDP that has been averaged along the Z-direction to smoothen the oscillation related to the discrete nature of atoms. The plot is rigidly shifted as you have noticed, but as any electrostatic potential the HDP is defined up to a constant. So, it is equally good for describing band bending in Si discussed in the tutorial, and was set to zero in the right electrode to align the averaged HDP with the Fermi level in the doped Si (comprising the right electrode) as shown in the PLDOS figure. 
Title: Re: Can I run this command using VNL?
Post by: lknife on June 24, 2017, 04:43
Thank you very much for you help!

You mean that the EDP or HDP does not need to be the same in the left and right electrodes at zero bias, but in my case, there was a bias of 0.1V between the two electrodes, what would it be then? I am now running another calculation for the EDP without bias and want to compare the results with and without bias. I have the question: what's the meaning of the difference in the EDP or HDP curve between the left and right electrodes, just representing the band bending near the interface?

Title: Re: Can I run this command using VNL?
Post by: Petr Khomyakov on June 25, 2017, 10:59
what's the meaning of the difference in the EDP or HDP curve between the left and right electrodes, just representing the band bending near the interface?

The macroscopically-averaged HDP shows the band bending far from the interface, and it reaches constant values in the left and right electrodes. Note that band bending is not defined at the interface, as its definition relies on the Thomas-Fermi approximation that is not valid at or sometime even near the interface.

One may use the HDP curve together with the PLDOS graph to understand band alignment between two dissimilar semiconductor structures.