Incorrect .RHO density file origin on using Grid.CellSampling
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Siesta |
Fix Released
|
Medium
|
Nick Papior | ||
4.0 |
Fix Released
|
Medium
|
Nick Papior | ||
4.1 |
Fix Released
|
Medium
|
Nick Papior |
Bug Description
Using Grid.CellSampling on Siesta 4.1-b3, causes the origin for density to be shifted in the output density .RHO file. Specifically the shift is for the last grid cell fraction used in the sampling. Thus the electron density readings no longer have the same fractional coordinate origin as the ion fractional coordinates. For instance, for Grid.CellSampling of [1 1 40] then the z fractional coordinates in the .RHO file have to be adjusted down in an external program by 39/40ths of the real-space grid resolution for correct results.
Though easy to compensate for once the effect is known, this produces significant errors in external calculations such as polarisation, which took a long time to pin down. At first they seemed to be fixed with a purely arbitrary offset to the .RHO density grid, but eventually it was realised that the required offset was correlated with Grid.CellSampling.
The problem was found on both the Debian platform of my local workstation and on the UK Thomas supercomputer documented at https:/
A .fdf file and the pseudopotentials used are available from this link:
https:/
Related branches
Changed in siesta: | |
status: | New → Confirmed |
importance: | Undecided → High |
assignee: | nobody → Nick Papior (nickpapior) |
importance: | High → Medium |
status: | Confirmed → In Progress |
Changed in siesta: | |
status: | In Progress → Fix Committed |
Changed in siesta: | |
status: | Fix Committed → Fix Released |
Many thanks for reporting the bug. This has now been fixed in the 4.1 branch and will be available in the coming 4.1-b4 release.
I tested this with this smaller fdf:
Diag.ParallelOverK True
WriteForces True
WriteBands True
SaveRho True icPotential True
SaveElectrostat
LatticeConstant 1.0 Ang
%block LatticeVectors
3.80000000 0.00000000 0.00000000
0.00000000 3.80000000 0.00000000
0.00000000 0.00000000 11.90000000
%endblock LatticeVectors
NumberOfAtoms 4 esFormat Ang esAndAtomicSpec ies esAndAtomicSpec ies
AtomicCoordinat
%block AtomicCoordinat
0.00000000 0.00000000 0.00000000 1 # 1: O
1.90000000 0.00000000 0.00000000 1 # 2: O
0.00000000 1.90000000 0.00000000 1 # 3: O
1.90000000 1.90000000 0.00000000 1 # 4: O
%endblock AtomicCoordinat
NumberOfSpecies 1 Label Label
%block ChemicalSpecies
1 8 O
%endblock ChemicalSpecies
#Real space grid
MeshCutoff 100.0 Ry
KgridCutoff 20.0 Ang rature 0.03 eV
ElectronicTempe
Grid.CellSampling [1 1 3]
# Convergence of SCF
SCFMustConverge False
MaxSCFIterations 8000
DM.MixingWeight 0.01
DM.UseSaveDM True