This issue is a result of a Codex global repository scan.
overlap_generator.py treats RadialCollection.rcut_max and lmax as properties and also calls lmax_, but the PyABACUS wrapper exposes them as methods named rcut_max(...) and lmax(...). This makes overlap generation fail before producing matrices.
Script usage:
|
self.orb = nao.RadialCollection() |
|
self.orb.build(orb_file_num, orb_file_list, 'o') |
|
|
|
# Standardize the orbital grid |
|
rmax = self.orb.rcut_max * 2.0 |
|
dr = 0.01 |
|
nr = int(rmax/dr) + 1 |
|
self.orb.set_uniform_grid(True, nr, rmax, 'i', True) |
|
|
|
# Print basic orbital information |
|
ntype = self.orb.ntype |
|
lmax = self.orb.lmax |
|
for it, element in enumerate(unique_elements): |
|
for ia in range(element_counts[element]): |
|
for iL in range(self.orb.lmax_(it)+1): |
|
for iN in range(self.orb.nzeta(it, iL)): |
|
def cal_R_direct_coor(self): |
|
rcut=self.orb.rcut_max*np.ones(len(self.atom_positions_c),dtype=float) |
|
print(rcut) |
|
Ncell = NeighbourCell(self.lattice_vector, self.atom_positions_c, self.atom_positions_ct, rcut) |
Wrapper API:
|
@overload |
|
def lmax(self) -> int: ... |
|
@overload |
|
def lmax(self, itype: int) -> int: ... |
|
|
|
def lmax(self, *args, **kwargs): |
|
return super().lmax(*args, **kwargs) |
|
|
|
@overload |
|
def rcut_max(self) -> float: ... |
|
@overload |
|
def rcut_max(self, itype: int) -> float: ... |
|
|
|
def rcut_max(self, *args, **kwargs): |
|
return super().rcut_max(*args, **kwargs) |
Relevant code:
rmax = self.orb.rcut_max * 2.0
...
lmax = self.orb.lmax
...
for iL in range(self.orb.lmax_(it)+1):
...
rcut=self.orb.rcut_max*np.ones(...)
Suggested fix:
Use the actual method calls, for example self.orb.rcut_max(), self.orb.rcut_max(it), and self.orb.lmax(it). Add a smoke test that constructs overlap_R with a minimal orbital collection or mocked wrapper.
This issue is a result of a Codex global repository scan.
overlap_generator.pytreatsRadialCollection.rcut_maxandlmaxas properties and also callslmax_, but the PyABACUS wrapper exposes them as methods namedrcut_max(...)andlmax(...). This makes overlap generation fail before producing matrices.Script usage:
abacus-develop/tools/02_postprocessing/rt-tddft-tools/overlap_generator.py
Lines 23 to 34 in 84ca04b
abacus-develop/tools/02_postprocessing/rt-tddft-tools/overlap_generator.py
Lines 55 to 58 in 84ca04b
abacus-develop/tools/02_postprocessing/rt-tddft-tools/overlap_generator.py
Lines 73 to 76 in 84ca04b
Wrapper API:
abacus-develop/python/pyabacus/src/pyabacus/ModuleNAO/_module_nao.py
Lines 86 to 100 in 84ca04b
Relevant code:
Suggested fix:
Use the actual method calls, for example
self.orb.rcut_max(),self.orb.rcut_max(it), andself.orb.lmax(it). Add a smoke test that constructsoverlap_Rwith a minimal orbital collection or mocked wrapper.