QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: 395235863 on November 27, 2015, 11:42

Title: Projected Local Density of States
Post by: 395235863 on November 27, 2015, 11:42
Dear QW team,
  I calculate the Projected Local Density of States.But I cannot export the data of PLDOS?Can you help me ? Thank you!
Title: Re: Projected Local Density of States
Post by: Jess Wellendorff on November 29, 2015, 17:26
You should be able to export the PLDOS using the "Export" tool: Simply highlight the PLDOS object on the LabFloor and click the Export tool in the right-hand side of the VNL main window.
Title: Re: Projected Local Density of States
Post by: 395235863 on November 30, 2015, 09:37
yes , i did it . An error occurred.

Exception message:
Traceback (most recent call last):
  File ".\zipdir\NL\GUI\MainWindow\AnalysisBar\AnalysisBar.py", line 58, in widget
  File "D:\QuantumWise\VNL-ATK-2015.0\lib\site-packages\AddOns\BasicAnalysis\TextRepresentationPlugin.py", line 43, in createWidget
    nlprint(analysis_object, stream)
  File ".\zipdir\NL\IO\NLPrint.py", line 51, in nlprint
  File ".\zipdir\NL\Analysis\ProjectedLocalDensityOfStates.py", line 294, in nlprint
  File ".\zipdir\NL\Analysis\ProjectedLocalDensityOfStates.py", line 281, in print_pldos
  File ".\zipdir\NL\CommonConcepts\PhysicalQuantity.py", line 739, in inUnitsOf
NLValueError: Unable to convert unit value [[  4.51908626e-01   3.64224885e-01   3.73445793e-01 ...,   3.89357337e-01
    9.51313857e-01   5.86171776e-01]
 [  4.01617159e-01   2.33520033e-01   4.02115112e-01 ...,   2.67837702e-01
    4.44371755e-01   5.87626121e-01]
 [  2.64742225e-01   1.66413890e-01   3.01978109e-01 ...,   3.43013941e-01
    4.24483852e-01   6.36572890e-01]
 ...,
 [  1.11379910e-05   3.00643029e-06   3.12655863e-06 ...,   6.14750930e-06
    1.07890238e-06   1.06253526e-06]
 [  2.59680709e-05   7.36990406e-06   7.08218082e-06 ...,   5.08171631e-06
    1.05291532e-06   1.05347543e-06]
 [  1.72124502e-01   5.30705929e-02   5.90459250e-02 ...,   9.60436821e-04
    1.04734366e-04   2.61281151e-04]] 1/eV to an incompatible unit 1/Hartree/Bohr**3.0.
Title: Re: Projected Local Density of States
Post by: Anders Blom on November 30, 2015, 17:00
This is a known bug which will be fixed, sorry about that.

You can always export the value by using a script, as in the attached example (stolen from the source code, but fixed for the bug).
You add the filename of your NC file at the end, then run on the command line as

Code
atkpython nlprint_pldos.py > outputfile.txt

Title: Re: Projected Local Density of States
Post by: 395235863 on December 1, 2015, 04:15
I follow your way.An error occurs.
Traceback (most recent call last):
  File "nlprint_pldos.py", line 89, in <module>
    nlprint_pldos(pldos)
  File "nlprint_pldos.py", line 12, in nlprint_pldos
    stream.write(tt.tableLine() + '\n')
NameError: global name 'stream' is not defined
Title: Re: Projected Local Density of States
Post by: Anders Blom on December 1, 2015, 07:26
Sorry, I forgot one line of code.

Note, that there is a difference if your PLDOS is made from the device density of states, or the "LDOS", and this is where the unit confusion comes from. So, the attached code will work if the PLDOS comes from the device DOS; the built-in code will work if it's made from LDOS.

Title: Re: Projected Local Density of States
Post by: 395235863 on December 1, 2015, 11:49
OK.I understand it completely.Thank you very much!