yuzie007 / upho

Band unfolding for phonons
http://yuzie007.github.io/upho/
MIT License
48 stars 22 forks source link

Question regarding input files #1

Open catotac opened 6 years ago

catotac commented 6 years ago

Hello Dr. Ikeda, I am doing band unfolding calculation using upho. I am getting an error something like this: Calculate weights for wavevectors (sec.): 0.0002 Traceback (most recent call last): File "/Users/rahulsn/Downloads/upho-0.5.3/scripts/upho_weights", line 262, in main() File "/Users/rahulsn/Downloads/upho-0.5.3/scripts/upho_weights", line 197, in main is_band_connection=settings.get_is_band_connection(), File "/Users/rahulsn/Downloads/upho-0.5.3/lib/python/upho/api_unfolding.py", line 169, in set_band_structure verbose=True) File "/Users/rahulsn/Downloads/upho-0.5.3/lib/python/upho/phonon/band_structure.py", line 85, in init self._set_band(verbose=verbose) File "/Users/rahulsn/Downloads/upho-0.5.3/lib/python/upho/phonon/band_structure.py", line 102, in _set_band self._solve_dm_on_path(ipath, path, verbose) File "/Users/rahulsn/Downloads/upho-0.5.3/lib/python/upho/phonon/band_structure.py", line 118, in _solve_dm_on_path eigenstates.extract_eigenstates(q) File "/Users/rahulsn/Downloads/upho-0.5.3/lib/python/upho/phonon/eigenstates.py", line 144, in extract_eigenstates q, transformation_matrix) File "/Users/rahulsn/Downloads/upho-0.5.3/lib/python/upho/phonon/eigenstates.py", line 221, in _extract_eigenstates_for_q weights['total'], t_proj_eigvecs = self._extract_weights(q_sc, eigvecs) File "/Users/rahulsn/Downloads/upho-0.5.3/lib/python/upho/phonon/eigenstates.py", line 252, in _extract_weights vectors=eigvecs, kpoint=q) File "/Users/rahulsn/Downloads/upho-0.5.3/lib/python/upho/phonon/translational_projector.py", line 129, in project_vectors projected_vectors += vectors.take(jndices, axis=-2) ValueError: operands could not be broadcast together with shapes (81,162) (3,162) (81,162)

I just wanted to check if I am doing everything correctly. My POSCAR is a supercell 3x3x3 cubic BCC structure and my POSCAR_ideal is

X 1.00000000000000 3.2520000000000001 0.0000000000000000 0.0000000000000000 0.0000000000000000 3.2520000000000001 0.0000000000000000 0.0000000000000000 0.0000000000000000 3.2520000000000001 X
2
Direct 0.5000000000000000 0.5000000000000000 0.5000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 Using this I am getting an error in the step of calculating weights. Any help is highly appreciated.

yuzie007 commented 6 years ago

I am very sorry for my late response (I wish you have a chance to see my reply...)

It looks the problem is that you probably do not have a consistent POSCAR and POSCAR_ideal. What we need for upho is like

X
   1.00000000000000
     9.7560000000000002    0.0000000000000000    0.0000000000000000
     0.0000000000000000    9.7560000000000002    0.0000000000000000
     0.0000000000000000    0.0000000000000000    9.7560000000000002
   X
    54
Direct
  0.1666666666666667  0.1666666666666667  0.1666666666666667
  0.5000000000000000  0.1666666666666667  0.1666666666666667
  0.8333333333333333  0.1666666666666667  0.1666666666666667
  0.1666666666666667  0.5000000000000000  0.1666666666666667
  0.5000000000000000  0.5000000000000000  0.1666666666666667
  0.8333333333333333  0.5000000000000000  0.1666666666666667
  0.1666666666666667  0.8333333333333333  0.1666666666666667
  0.5000000000000000  0.8333333333333333  0.1666666666666667
  0.8333333333333333  0.8333333333333333  0.1666666666666667
  0.1666666666666667  0.1666666666666667  0.5000000000000000
  0.5000000000000000  0.1666666666666667  0.5000000000000000
  0.8333333333333333  0.1666666666666667  0.5000000000000000
  0.1666666666666667  0.5000000000000000  0.5000000000000000
  0.5000000000000000  0.5000000000000000  0.5000000000000000
  0.8333333333333333  0.5000000000000000  0.5000000000000000
  0.1666666666666667  0.8333333333333333  0.5000000000000000
  0.5000000000000000  0.8333333333333333  0.5000000000000000
  0.8333333333333333  0.8333333333333333  0.5000000000000000
  0.1666666666666667  0.1666666666666667  0.8333333333333333
  0.5000000000000000  0.1666666666666667  0.8333333333333333
  0.8333333333333333  0.1666666666666667  0.8333333333333333
  0.1666666666666667  0.5000000000000000  0.8333333333333333
  0.5000000000000000  0.5000000000000000  0.8333333333333333
  0.8333333333333333  0.5000000000000000  0.8333333333333333
  0.1666666666666667  0.8333333333333333  0.8333333333333333
  0.5000000000000000  0.8333333333333333  0.8333333333333333
  0.8333333333333333  0.8333333333333333  0.8333333333333333
  0.0000000000000000  0.0000000000000000  0.0000000000000000
  0.3333333333333333  0.0000000000000000  0.0000000000000000
  0.6666666666666666  0.0000000000000000  0.0000000000000000
  0.0000000000000000  0.3333333333333333  0.0000000000000000
  0.3333333333333333  0.3333333333333333  0.0000000000000000
  0.6666666666666666  0.3333333333333333  0.0000000000000000
  0.0000000000000000  0.6666666666666666  0.0000000000000000
  0.3333333333333333  0.6666666666666666  0.0000000000000000
  0.6666666666666666  0.6666666666666666  0.0000000000000000
  0.0000000000000000  0.0000000000000000  0.3333333333333333
  0.3333333333333333  0.0000000000000000  0.3333333333333333
  0.6666666666666666  0.0000000000000000  0.3333333333333333
  0.0000000000000000  0.3333333333333333  0.3333333333333333
  0.3333333333333333  0.3333333333333333  0.3333333333333333
  0.6666666666666666  0.3333333333333333  0.3333333333333333
  0.0000000000000000  0.6666666666666666  0.3333333333333333
  0.3333333333333333  0.6666666666666666  0.3333333333333333
  0.6666666666666666  0.6666666666666666  0.3333333333333333
  0.0000000000000000  0.0000000000000000  0.6666666666666666
  0.3333333333333333  0.0000000000000000  0.6666666666666666
  0.6666666666666666  0.0000000000000000  0.6666666666666666
  0.0000000000000000  0.3333333333333333  0.6666666666666666
  0.3333333333333333  0.3333333333333333  0.6666666666666666
  0.6666666666666666  0.3333333333333333  0.6666666666666666
  0.0000000000000000  0.6666666666666666  0.6666666666666666
  0.3333333333333333  0.6666666666666666  0.6666666666666666
  0.6666666666666666  0.6666666666666666  0.6666666666666666

I mean, POSCAR_ideal should have the same size as POSCAR (which may have a random occupation of elements). Please also be careful that currently POSCAR and POSCAR_ideal should also have the same atomic positions.

ShuaishuaiYuan commented 4 years ago

I mean, POSCAR_ideal should have the same size as POSCAR (which may have a random occupation of elements). Please also be careful that currently POSCAR and POSCAR_ideal should also have the same atomic positions.

Dear Dr. Ikeda, Is this possible to unfold a phonon band structure with a vacancy defect in the supercell? Such as POSCAR has one less atom than POSCAR_ideal?

Thanks!

Sincerely, Shuaishuai

yliu1240 commented 2 years ago

I mean, POSCAR_ideal should have the same size as POSCAR (which may have a random occupation of elements). Please also be careful that currently POSCAR and POSCAR_ideal should also have the same atomic positions.

Dear Dr. Ikeda, Is this possible to unfold a phonon band structure with a vacancy defect in the supercell? Such as POSCAR has one less atom than POSCAR_ideal?

Thanks!

Sincerely, Shuaishuai

Dr. Ikeda, Hi! I'm also wondering if there's a way to work around the vacancy problem, since some of my disordered sites are not fully occupied. I've tried to put an dummy atom 'X' at the vacancy site in POSCAR and POSCAR_ideal, but the band structures look weird. Also I find that changing the dummy atom 'X' to other atoms, such as Li, would influence the resulting bands. It's interesting to consider that the force constant matrix doesn't even include the vacancy site. I guess it's caused by the atomic mass of the dummy atom? Shall I try a 0-mass atom?

I completely understand that you may no longer work on this project, but thank you anyway!

Have a nice day!

Best, yliu1240

yuzie007 commented 2 years ago

@yliu1240 I so far do not have any methods to deal with vacancies that I can convince myself, and therefore it is beyond support. What I can say is:

yliu1240 commented 2 years ago

@yliu1240 I so far do not have any methods to deal with vacancies that I can convince myself, and therefore it is beyond support. What I can say is:

  • Putting "X" is not a good idea; phonopy may assign an arbitrary element (like "H", "He", "Li", in the order of the periodic table) to X, which does not mean vacancies. Let me comment that this is not a problem in upho but simply a behavior of the phonopy side.
  • Putting some arbitrary element "Li" by hand instead of "X" is also not good; it just means some disordered alloy including "Li", not vacancies.
  • I also do not suggest a 0-mass atom; actually what we should have at the vacancy site is an "inifite-mass" atom.

Dr. Ikeda, Thanks a lot! I was trying to play with making Fl or the other heavy elements for fun only. Also, just something fun to share, it seems Phonopy is implementing an older version of phonon unfolding method dealing with vacancies, where, if you're interested, you can see an 'unfolding' directory in Phonopy, which is published last October. Currently, it's not publicly supported with little documentation, but there're tests and Python scripts visible in Phonopy.

Anyway, thank you for your time and have a nice weekend!

Best regards, yliu1240