A problem about ase.dft.Wannier
Hi. I met a problem about fitting wannier functions of a crystal.
from ase import Atoms
import numpy as np
from gpaw import GPAW
from ase.dft import Wannier
atoms = Atoms('Cu', pbc=[1, 1, 1], cell=np.eye(3)*3)
atoms.center()
calc = GPAW(xc='PBE', nbands=20, kpts={'size': (5, 5, 5)})
atoms.set_calculator(calc)
atoms.get_potential_energy()
wan = Wannier(nbands=10, calc=calc)
Then it will return an AssertionError
:
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-18-42f112293711> in <module>()
----> 1 wan = Wannier(nwannier=15, calc=calc)
~/anaconda3/lib/python3.7/site-packages/ase/dft/wannier.py in __init__(self, nwannier, calc, file, nbands, fixedenergy, fixedstates, spin, initialwannier, seed, verbose)
285 self.verbose = verbose
286 self.kpt_kc = calc.get_bz_k_points()
--> 287 assert len(calc.get_ibz_k_points()) == len(self.kpt_kc)
288 self.kptgrid = get_monkhorst_pack_size_and_offset(self.kpt_kc)[0]
289 self.kpt_kc *= sign
AssertionError:
I print the information:
In [20]: calc.get_bz_k_points().shape
Out[20]: (125, 3)
In [21]: calc.get_ibz_k_points().shape
Out[21]: (10, 3)
I know that to reduce the computational cost, the number of k-points in IBZ are not equal to that in BZ. But how to fit wannier functions of a PBC system?