QuantumLab-ZY / HamEPC

A machine learning workflow for calculating the electron-phonon coupling (EPC)
MIT License
16 stars 3 forks source link

Test to get T_c of T-graphene #3

Open ayitido opened 2 months ago

ayitido commented 2 months ago

I want get the T_c of T-graphene by HamEPC, when I run HamEPC --config EPC_input.yaml an error has occurred:

Traceback (most recent call last):
  File "/home/gengbin_32346034_stl_155/softwares/miniconda3/envs/HamEPC/bin/HamEPC", line 33, in <module>
    sys.exit(load_entry_point('HamEPC==0.1', 'console_scripts', 'HamEPC')())
  File "/home/gengbin_32346034_stl_155/softwares/miniconda3/envs/HamEPC/lib/python3.9/site-packages/HamEPC-0.1-py3.9.egg/HamEPC/run_EPC.py", line 27, in main
  File "/home/gengbin_32346034_stl_155/softwares/miniconda3/envs/HamEPC/lib/python3.9/site-packages/HamEPC-0.1-py3.9.egg/HamEPC/EPC_calculator.py", line 477, in run
  File "/home/gengbin_32346034_stl_155/softwares/miniconda3/envs/HamEPC/lib/python3.9/site-packages/HamEPC-0.1-py3.9.egg/HamEPC/EPC_calculator.py", line 1467, in superconductivity_cal
  File "/home/gengbin_32346034_stl_155/softwares/miniconda3/envs/HamEPC/lib/python3.9/site-packages/HamEPC-0.1-py3.9.egg/HamEPC/EPC_calculator.py", line 1301, in eliashberg_spectrum_cal_sparse
IndexError: index 4 is out of bounds for axis 4 with size 4

FORECE_SETS created by vasp + phonopy, with 3x3x1 supercell.

The error is located on line 1300 of EPC_calculator.py, when ia=4

grad_mat_small = self.grad_mat[i_m, i_n, :, :, ia, k]

It also can be repeated by:

import numpy as np
a = np.load("grad_mat.npy")
print(a[0,0,:,:,4,0])
print(len(a))

I uploaded most of the files to my github, except for the graph_data_gen.yaml files.

QuantumLab-ZY commented 2 months ago

Dear @ayitido,

The structure in graph_data.npz appears not to be a primitive cell, which is why the number of atoms exceeds the index limit of grad_max. When using HamEPC, ensure that the same primitive cell is used for the phonon spectrum, grad_data.npz, and grad_mat.npz. This means the atomic coordinates and lattice parameters must be identical across these datasets.

Best wishes,

Yang Zhong