ed = nlread('analysis.nc', ElectronDensity)[0]
cut = 20
s = ed[:, :, :].sum()
print ed[:,:, :cut].sum()/s
print ed[:,:, cut:].sum()/sHmm, an alternative to the Mulliken population could be using the ElectronDensity.
A rough example I have made:CodeWhere 20 is some grid number in the z-direction.ed = nlread('analysis.nc', ElectronDensity)[0]
cut = 20
s = ed[:, :, :].sum()
print ed[:,:, :cut].sum()/s
print ed[:,:, cut:].sum()/s
Also take a look at the manual entry for ElectronDensity :)