Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to solve AttributeError: 'TBLattice' object has no attribute 'on_mesh_brillouin_zone' #31

Open
xfzhang-phys opened this issue May 4, 2022 · 1 comment

Comments

@xfzhang-phys
Copy link

I'm trying to reproduce the tutorial: "Solving the linearized Eliashberg equation in the random phase approximation limit",and got the following error:


AttributeError Traceback (most recent call last)
Input In [17], in <cell line: 6>()
3 square_lattice = create_square_lattice(norb=1, t=1.0)
5 nk = 32
----> 6 ek = square_lattice.on_mesh_brillouin_zone(n_k=(nk, nk, 1))
8 from triqs.gf import MeshImFreq
9 from triqs_tprf.lattice import lattice_dyson_g0_wk

AttributeError: 'TBLattice' object has no attribute 'on_mesh_brillouin_zone'

Both triqs and triqs_tprf version are 3.1.0, I installed them by anaconda.

Solving lthe inearized Eliashberg equation in the RPA limit.py.txt

@Stefan-Dienst
Copy link
Collaborator

Hi,

thanks for pointing this out. The method on_mesh_brillouin_zone is an old one which does not work anymore, since the triqs.lattice python API changed. You must now first create a kmesh and then use the fourier method of the TBLattice class.
The following code snippet should work

from triqs_tprf.tight_binding import create_square_lattice
square_lattice = create_square_lattice(norb=1, t=1.0)

nk = 32
dim = 2

kmesh = square_lattice.get_kmesh(n_k=[nk] * dim + [1] * (3 - dim))
e_k = square_lattice.fourier(kmesh)

or checkout the tests which use this function to create a dispersion relation.

Feel free to open a PR if you got the notebook running, as I don't have any TRIQS environment setup at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants