Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[BUG] ABACUS SCF reader inverts coordinates for left-handed cells without transforming forces

Aperta
#1,061 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
data

Direzione di ricerca

Start with dpdata/formats/abacus/stru.py::right_hand_rule() and get_frame_from_stru(), then inspect dpdata/formats/abacus/scf.py::get_force() and get_frame(). Run the provided dpdata.LabeledSystem(..., fmt="abacus/scf") reproduction using task.21.zip. Done means left-handed cells produce consistently transformed coordinates and forces while energy, stress, and virial remain unchanged.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Bug summary

When the input STRU cell has a negative determinant, right_hand_rule() negates the cell and Cartesian coordinates. However, the SCF reader loads forces from running_scf.log without negating them.

The exported coordinates and forces therefore belong to inconsistent spatial representations. The trigger is cell handedness, not atom count.

dpdata Version

The same logic was also observed in GitHub master on September 20, 2026. The affected installation uses the older dpdata/abacus/ module path.

Input Files, Running Commands, Error Log, etc.

task.21.zip
calculation/
├── INPUT
├── STRU
└── OUT.ABACUS/running_scf.log

Read and export using:

import dpdata

system = dpdata.LabeledSystem("calculation", fmt="abacus/scf")
system.to_deepmd_npy("exported")

Observed values from an affected dataset:
eg:

Original Cartesian position ≈ [ 2.7337, 7.0893, 2.2321]
Exported coord.npy ≈ [-2.7337, -7.0891, -2.2320]

ABACUS TOTAL-FORCE = [-0.0020299593, 2.3578977033, 0.3664125131]
Exported force.npy ≈ [-0.002, 2.3579, 0.3664]

The coordinates are approximately negated, while the force signs remain unchanged. This is a silent data-consistency error rather than a parsing exception.

Steps to Reproduce

Prepare a converged ABACUS SCF calculation whose input STRU cell has det(cell) < 0 and whose output contains nonzero forces.

Read the calculation with dpdata.LabeledSystem(..., fmt="abacus/scf").

Compare the parsed cell and Cartesian coordinates with the original STRU.

Compare the parsed forces with the corresponding TOTAL-FORCE block.

Actual: Cell and coordinates are negated; forces retain their original signs.

Expected: If coordinates undergo spatial inversion, forces must also be negated. Energy, stress, and virial should remain unchanged under this inversion.

Further Information, Files, and Links

Relevant source code:

stru.py::right_hand_rule() negates only the cell and coordinates:

if np.linalg.det(cell) < 0:
cell = -cell
coord = -coord

get_frame_from_stru() calls this function without returning an inversion flag.

scf.py::get_force() reads forces without a spatial transformation.

scf.py::get_frame() combines the transformed structure with the untransformed forces.

Lingua principale
Python
Stelle
254
Fork
159
Merge medio
8g 3h
PR unite (30g)
1

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di deepmodeling/dpdata

Tutte le issue di deepmodeling/dpdata

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.