Ef[Dq] =
Etot[Dq] − Etot[bulk]
− Σi Δni (μiref + Δμi)
+ q(EVBM + EF)
+ Ecorr
EF is referenced to the VBM. Ecorr is whatever
finite-size correction you supply per entry — FNV, eFNV, Lany–Zunger — the app
treats it as a fixed additive term and never recomputes it. Include potential alignment in that number only if it is not already included in your correction scheme; do not count it twice. Use bulk and defect supercells of the same size. The app does not calculate correction terms or equilibrium Fermi levels.