McStasMcXtrace / iFit

a simple library to analyze data (with McCode and Phonons/DFT hooks). :warning: this project has been moved to https://gitlab.com/soleil-data-treatment/soleil-software-projects/remote-desktop
http://ifit.mccode.org
Other
5 stars 5 forks source link

Models: Phonons: recent PhonoPy has issue to get mass #93

Closed farhi closed 7 years ago

farhi commented 7 years ago
s=sqw_phonons([ ifitpath 'Data/POSCAR_Al'],'metal','emt');
qh=linspace(0.01,.5,50);qk=qh; ql=qh; w=linspace(0.01,50,51);
f=iData(s,[],qh,qk,ql',w);

fails with:

Traceback (most recent call last):
  File "/tmp/tpea7560eb_ef46_49a5_8071_74f86e168658/sqw_phonons_eval.py", line 17, in <module>
    omega_kn, polar_kn = ifit.phonopy_band_structure(ph, HKL, modes=True)
  File "/tmp/tpea7560eb_ef46_49a5_8071_74f86e168658/ifit.py", line 1043, in phonopy_band_structure
    m_inv_x = numpy.repeat(numpy.sqrt(D._mass), 3)
AttributeError: 'DynamicalMatrix' object has no attribute '_mass'
farhi commented 7 years ago

Looking at https://github.com/atztogo/phonopy/blob/master/phonopy/harmonic/dynamical_matrix.py we see that:

instead of:

so the fix is easy

farhi commented 7 years ago

Fixed with commit https://github.com/McStasMcXtrace/iFit/commit/5a59e8b170ae78b1734b4c06236e5d5fde9c3125