band-unfolding / banduppy

Python version ofthe BandUP code
GNU General Public License v3.0
17 stars 7 forks source link

Error running tutorial #11

Closed rogeriog closed 2 years ago

rogeriog commented 2 years ago

I tried run the tutorial file for bulk silicon with both QE 6.8 and QE 6.4.1, keep having the same error, some problem with finding the correct symmetries.

Traceback (most recent call last):
  File "run_banduppy.py", line 64, in <module>
    bands=banduppy.BandStructure(code="espresso", prefix="bulk_Si")
  File "/home/u/raglamai/anaconda3/lib/python3.8/site-packages/irrep/bandstructure.py", line 140, in __init__
    self.__init_espresso(
  File "/home/u/raglamai/anaconda3/lib/python3.8/site-packages/irrep/bandstructure.py", line 802, in __init_espresso
    self.spacegroup = SpaceGroup(
  File "/home/u/raglamai/anaconda3/lib/python3.8/site-packages/irrep/spacegroup.py", line 613, in __init__
    self.refUC, self.shiftUC = self.determine_basis_transf(
  File "/home/u/raglamai/anaconda3/lib/python3.8/site-packages/irrep/spacegroup.py", line 1009, in determine_basis_transf
    raise RuntimeError(("Could not find any shift "
RuntimeError: Could not find any shift placing the origin in an inversion center that leads to the expressions for symmetries found in tables.

I am using: Python 3.8.5 conda 4.10.3 banduppy 0.1.3 pypi_0 pypi irrep 1.6.0 pypi_0 pypi

Any ideas? I am not changing anything in the files except QE path.

stepan-tsirkin commented 2 years ago

Hi @rogeriog , this was a bug in recent irrep, now fixed. Try to upgrade to irrep-1.6.1

rogeriog commented 2 years ago

Great! pip install irrep --upgrade Solved the problem. Thanks.

pandacam commented 2 years ago

Sorry for bringing up this matter again, but I met similar problem running the tutorial on bulk Si with QE 7.0, even with the latest version of irrep (1.7.1), running on python 3.10.4, banduppy 0.2.0.

Traceback (most recent call last):

File "/usr/local/lib/python3.10/dist-packages/spyder_kernels/py3compat.py", line 356, in compat_exec exec(code, globals, locals)

File "/home/jing/softwares/banduppy-master/tutorials/QE-noSOC_2/test.py", line 41, in bands=banduppy.BandStructure(code="espresso", prefix="bulk_Si")

File "/home/jing/.local/lib/python3.10/site-packages/irrep/bandstructure.py", line 144, in init self.__init_espresso(

File "/home/jing/.local/lib/python3.10/site-packages/irrep/bandstructure.py", line 822, in __init_espresso self.spacegroup = SpaceGroup(

File "/home/jing/.local/lib/python3.10/site-packages/irrep/spacegroup.py", line 650, in init self.refUC, self.shiftUC = self.determine_basis_transf(

File "/home/jing/.local/lib/python3.10/site-packages/irrep/spacegroup.py", line 1073, in determine_basis_transf raise RuntimeError(("Could not find any shift that places the "

RuntimeError: Could not find any shift that places the origin on an inversion center which leads to the expressions for the symmetries found in the tables. Enter refUC and shiftUC in command line

stepan-tsirkin commented 1 year ago

Hi, this looks more like a question to irrep

@MIraola , what do you think? Do these lines https://github.com/stepan-tsirkin/irrep/blob/9d496626ebb7a87b538c2cbfb6ee927ccd64c95a/irrep/spacegroup.py#L650-L655

at all need to be executed if identify_irreps==False ? Maybe set it to

if identify_irreps:
     self.refUC, self.shiftUC = self.determine_basis_transf( .. )
else:
     self.refUC, self.shiftUC = np.eye(3,dtype=int), np.zeros(3)

Will it work, or would it generate another problem later?

stepan-tsirkin commented 1 year ago

As a workaround, can you try

bands=banduppy.BandStructure(code="espresso", prefix="bulk_Si", refUC = np.eye(3,dtype=int), shiftUC = np.zeros(3) )

would it work?

pandacam commented 1 year ago

As a workaround, can you try

bands=banduppy.BandStructure(code="espresso", prefix="bulk_Si", refUC = np.eye(3,dtype=int), shiftUC = np.zeros(3) )

would it work?

Many thanks, Stepan, it works! Appreciate your help!

stepan-tsirkin commented 1 year ago

@pandacam could you try with a verison of irrep from this PR and without workarounds. Does it work for you?

pandacam commented 1 year ago

@pandacam could you try with a verison of irrep from this PR and without workarounds. Does it work for you?

Hi Stepan, this new PR solves the issue without the workarounds. Perfect, thanks the team for the nice effort!

MIraola commented 1 year ago

I have merged the PR in IrRep which fixes the incompatibility with banduppy. Thank you for your feedback, @pandacam and @rogeriog .