Phonon-assisted luminescence by finite atomic displacements-Yambopy
Posted: Sun Jun 01, 2025 12:56 am
Dear all,
I am also checking the following tutorial :
Phonon-assisted luminescence by finite atomic displacements
for cubic BTO, it is indirect and the q = 1/2 , 1/2 , 1/2 ,
first I run scf, nscf, phonon and got Q.mode as attached for q= 1/2 , 1/2 , 1/2
that is why I created the diagonal supercell (using the attached python script ) , but then when I want to create the displacement structure, it is giving the following error , even though Q.mode is 225 ,
Could you please guide me , why I am getting this error ?
(yamboenv) [sghanbar@vacc-login1 PL]$ python generate_supercells.py -S
Applying displacements according to phonon modes...
Traceback (most recent call last):
File "/gpfs1/home/s/g/sghanbar/Yambo/PL/generate_supercells.py", line 142, in <module>
if args.displaced_nondiagonal: generate_displaced_supercells(uc_filnm,Q,modes_file,kpoints)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/gpfs1/home/s/g/sghanbar/Yambo/PL/generate_supercells.py", line 82, in generate_displaced_supercells
sc.displace(eivs,nd_atom_positions,Temp=0.1) # Generate list of displaced supercells as PwIn objects called 'modes_qe'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/s/g/sghanbar/yamboenv/lib/python3.11/site-packages/qepy/supercell.py", line 108, in displace
self.initialize_phonons(modes_file,self.atypes,Temp)
File "/users/s/g/sghanbar/yamboenv/lib/python3.11/site-packages/qepy/supercell.py", line 176, in initialize_phonons
self.eigs = read_eig(modes_file,self.basis)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/s/g/sghanbar/yamboenv/lib/python3.11/site-packages/qepy/supercell.py", line 49, in read_eig
eig = np.reshape(eig, (modes,basis,3))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/s/g/sghanbar/yamboenv/lib/python3.11/site-packages/numpy/_core/fromnumeric.py", line 324, in reshape
return _wrapfunc(a, 'reshape', shape, order=order)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/s/g/sghanbar/yamboenv/lib/python3.11/site-packages/numpy/_core/fromnumeric.py", line 57, in _wrapfunc
return bound(*args, **kwds)
^^^^^^^^^^^^^^^^^^^^
ValueError: cannot reshape array of size 222 into shape (15,5,3)
I am also checking the following tutorial :
Phonon-assisted luminescence by finite atomic displacements
for cubic BTO, it is indirect and the q = 1/2 , 1/2 , 1/2 ,
first I run scf, nscf, phonon and got Q.mode as attached for q= 1/2 , 1/2 , 1/2
that is why I created the diagonal supercell (using the attached python script ) , but then when I want to create the displacement structure, it is giving the following error , even though Q.mode is 225 ,
Could you please guide me , why I am getting this error ?
(yamboenv) [sghanbar@vacc-login1 PL]$ python generate_supercells.py -S
Applying displacements according to phonon modes...
Traceback (most recent call last):
File "/gpfs1/home/s/g/sghanbar/Yambo/PL/generate_supercells.py", line 142, in <module>
if args.displaced_nondiagonal: generate_displaced_supercells(uc_filnm,Q,modes_file,kpoints)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/gpfs1/home/s/g/sghanbar/Yambo/PL/generate_supercells.py", line 82, in generate_displaced_supercells
sc.displace(eivs,nd_atom_positions,Temp=0.1) # Generate list of displaced supercells as PwIn objects called 'modes_qe'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/s/g/sghanbar/yamboenv/lib/python3.11/site-packages/qepy/supercell.py", line 108, in displace
self.initialize_phonons(modes_file,self.atypes,Temp)
File "/users/s/g/sghanbar/yamboenv/lib/python3.11/site-packages/qepy/supercell.py", line 176, in initialize_phonons
self.eigs = read_eig(modes_file,self.basis)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/s/g/sghanbar/yamboenv/lib/python3.11/site-packages/qepy/supercell.py", line 49, in read_eig
eig = np.reshape(eig, (modes,basis,3))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/s/g/sghanbar/yamboenv/lib/python3.11/site-packages/numpy/_core/fromnumeric.py", line 324, in reshape
return _wrapfunc(a, 'reshape', shape, order=order)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/s/g/sghanbar/yamboenv/lib/python3.11/site-packages/numpy/_core/fromnumeric.py", line 57, in _wrapfunc
return bound(*args, **kwds)
^^^^^^^^^^^^^^^^^^^^
ValueError: cannot reshape array of size 222 into shape (15,5,3)