CoMeT4MatSci / dftbephy

Calculating electron-phonon couplings with DFTB.
MIT License
8 stars 0 forks source link

Error running graphene-mobility.py #1

Open mshammami opened 9 months ago

mshammami commented 9 months ago

Hi, I'm trying to reproduce the graphene example, however, I'm encountering the following error when running graphene-mobility.py

python graphene-mobility.py 
-- loading reference calculation
-- loading derivatives calculation
-- starting phonon calculations on mesh ...
-- finished ( 0.4 s).
-- starting el-ph calculation ...
-- finished ( 9.4 s).
-- running 40 calculations for mu, kBT:
0 -4.659620492280717 0.0259
1 -4.649364082024307 0.0259
2 -4.6391076717678965 0.0259
3 -4.628851261511486 0.0259
4 -4.618594851255076 0.0259
5 -4.608338440998666 0.0259
6 -4.598082030742256 0.0259
7 -4.587825620485845 0.0259
8 -4.577569210229435 0.0259
9 -4.567312799973025 0.0259
10 -4.557056389716614 0.0259
11 -4.546799979460204 0.0259
12 -4.536543569203793 0.0259
13 -4.526287158947383 0.0259
14 -4.516030748690973 0.0259
15 -4.505774338434563 0.0259
16 -4.4955179281781525 0.0259
17 -4.485261517921742 0.0259
18 -4.475005107665332 0.0259
19 -4.464748697408922 0.0259
20 -4.454492287152512 0.0259
21 -4.4442358768961014 0.0259
22 -4.433979466639691 0.0259
23 -4.423723056383281 0.0259
24 -4.413466646126871 0.0259
25 -4.403210235870461 0.0259
26 -4.39295382561405 0.0259
27 -4.38269741535764 0.0259
28 -4.37244100510123 0.0259
29 -4.36218459484482 0.0259
30 -4.3519281845884095 0.0259
31 -4.341671774331998 0.0259
32 -4.331415364075588 0.0259
33 -4.321158953819178 0.0259
34 -4.310902543562768 0.0259
35 -4.3006461333063575 0.0259
36 -4.290389723049947 0.0259
37 -4.280133312793537 0.0259
38 -4.269876902537127 0.0259
39 -4.259620492280717 0.0259
-- constructing k-mesh
Traceback (most recent call last):
  File "/software/dftbephy/examples/my-graphene/el-ph/graphene-mobility.py", line 146, in <module>
    fromspglib = spglib.get_ir_reciprocal_mesh([nk, nk, 1], atoms)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/anaconda3/envs/dftbplus/lib/python3.12/site-packages/spglib/spglib.py", line 1557, in get_ir_reciprocal_mesh
    lattice, positions, numbers, _ = _expand_cell(cell)
                                     ^^^^^^^^^^^^^^^^^^
  File "/anaconda3/envs/dftbplus/lib/python3.12/site-packages/spglib/spglib.py", line 1985, in _expand_cell
    lattice = np.array(np.transpose(cell[0]), dtype="double", order="C")
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: float() argument must be a string or a real number, not 'Atom'

Additionally, the scripts graphene-ephline.py/graphene-lws.py don't quite work either. For example,

python graphene-lws.py 
-- loading reference calculation
-- loading derivatives calculation
-- starting phonon calculations on mesh ...
-- finished ( 0.1 s).
-- starting el-ph calculation ...
Traceback (most recent call last):
  File "/software/dftbephy/examples/my-graphene/el-ph/graphene-lws.py", line 97, in <module>
    eps_k, mesh_epskq, mesh_g2 = dftb.calculate_g2(kvec0, mesh_qpoints, mesh_frequencies, mesh_eigenvectors)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 3)
acroy commented 9 months ago

I cannot reproduce the first issue (graphene-mobility.py) here, but the other two should be fixed with the latest commit?

Maybe the problem with spglib is due to some recent changes? Which version are you using? But I would anyways recommend to use the mpi-versions of the scripts and an input file as described in _Input_forDFTBephy.md. This should also be much faster :-)