[BUG] ABACUS SCF reader inverts coordinates for left-handed cells without transforming forces
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 76/100
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 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di deepmodeling/dpdata
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
deepmodeling/dpdata#1004 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
deepmodeling/dpdata#1058 ·
-
feature request qe
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
deepmodeling/dpdata#901 · 4 commenti ·
-
enhancement vasp
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
deepmodeling/dpdata#642 ·
-
enhancement lammps
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
deepmodeling/dpdata#609 · 1 commento ·
Tutte le issue di deepmodeling/dpdata
Issue simili
-
agent-ready documentation needs-triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
instance instance add
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
searxng/searx-instances#939 · 1 commento ·
-
area-deployment area-integrations triage:bot-seen
Difficoltà 2/5 Mezza giornata Idoneità per principianti 86/100