Incorrect .RHO density file origin on using Grid.CellSampling

Bug #1799991 reported by Peter Davies
6
This bug affects 1 person
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://wiki.rc.ucl.ac.uk/wiki/RC_Systems#Thomas_technical_specs.

A .fdf file and the pseudopotentials used are available from this link:

https://www.dropbox.com/sh/1a7zty9xtupeneg/AACNPlgQXcz2CGPjVtW7i1C4a?dl=0

Related branches

Nick Papior (nickpapior)
Changed in siesta:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Nick Papior (nickpapior)
importance: High → Medium
status: Confirmed → In Progress
Revision history for this message
Nick Papior (nickpapior) wrote :

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
SaveElectrostaticPotential True

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
AtomicCoordinatesFormat Ang
%block AtomicCoordinatesAndAtomicSpecies
 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 AtomicCoordinatesAndAtomicSpecies

NumberOfSpecies 1
%block ChemicalSpeciesLabel
 1 8 O
%endblock ChemicalSpeciesLabel

#Real space grid
MeshCutoff 100.0 Ry

KgridCutoff 20.0 Ang
ElectronicTemperature 0.03 eV

Grid.CellSampling [1 1 3]

# Convergence of SCF
SCFMustConverge False
MaxSCFIterations 8000

DM.MixingWeight 0.01
DM.UseSaveDM True

Nick Papior (nickpapior)
Changed in siesta:
status: In Progress → Fix Committed
Nick Papior (nickpapior)
Changed in siesta:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.