QuantumATK Forum
QuantumATK => General Questions and Answers => Topic started by: kaypu on November 9, 2014, 14:16
-
hi:
i use this py(in the attachment) to plot the Energy dependent LDOS at bias of 0.4V. the LDOS in the different energy(-1eV~1eV) are saved to LDOS1-LDOS4. but it doesn't work.
*******************
File "LDOS-plot.py", line 25, in <module>
X, Y = numpy.meshgrid(z, energies)
File "./build/lib/python2.7/site-packages/numpy/lib/function_base.py", line 3379, in meshgrid
File "./zipdir/NL/CommonConcepts/PhysicalQuantity.py", line 456, in __mul__
File "./zipdir/NL/CommonConcepts/PhysicalQuantity.py", line 249, in unit
AttributeError: 'PhysicalQuantity' object has no attribute '_PhysicalQuantity__unit'
*******************
atk version 2014.1
what's wrong? need to modify the py?
thanks
-
Try to replace "convertTo" by "inUnitsOf" when you convert from Bohr to Ang on the grid volume element.
-
thank you, but still didn't work. i replace "convertTo" by "inUnitsOf" in line 9, right?
******************
Traceback (most recent call last):
File "LDOS-plot2014.py", line 10, in <module>
dz = dZ.norm()
AttributeError: 'numpy.ndarray' object has no attribute 'norm'
*****************
-
Ah, bummer. Then do this: the problem is meshgrid, which doesn't like objects with units, so use z.inUnitsOf(Ang) inside that call.