QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: Wanzhi Qiu on December 10, 2013, 03:08

Title: select a particular cut-plane of electrostaticdifference
Post by: Wanzhi Qiu on December 10, 2013, 03:08
Hi, I would like to find the difference in electrostaticdifference (EDP) of two systems corresponding to different cut-planes. In particular, for system A I need EDP at cut-plane x=x1 (edpA_x1), and for system B at cut-plane x=x2 (edpB_x2)., so I can compute edpA_x1 - edpB_x2..
However,  the following script only computes the difference of the whole systems and so doesn't work for me:

edpA = nlread("systemA.nc", ElectrostaticDifferencePotential)[0] 
edpB = nlread("systemB.nc", ElectrostaticDifferencePotential)[0] 
nlsave("diff.nc", edpA-edpB) 

Any idea on selecting a particular cut-plane?

Also, when I export the EDP data into a CUBE file, the values contained in the file are much smaller as compared with what observed in VNL viewer. This is confusing.. Please advise. Many thanks.



Title: Re: select a particular cut-plane of electrostaticdifference
Post by: kstokbro on December 10, 2013, 15:10
For the exporting to the cube file, there might be a difference in the units.

To subtract values at different cutplanes, there are several options:
checkout http://www.quantumwise.com/documents/manuals/latest/ReferenceManual/index.html/ref.electrostaticdifferencepotential.html

forinstance
vA = edpA.toArray()
vB = edpB.toArray()
vDiff = vA[x1_index,:,:] -vB[x2_index,:,:]

print vDiff
It requires that  you know the index of each plane. You can find the index using
dX, dY, dZ = edpA.volumeElement()
dx = dX.norm()
x1_index = x1/dx



Title: Re: select a particular cut-plane of electrostaticdifference
Post by: Wanzhi Qiu on December 11, 2013, 00:51
This helps a lot, thanks. One thing is that I have problem in viewing the vDiff.
Is there anyway to show vDiff in VNL, for example, by saving it into a .nc file then use VNL's Results Viewer to visualize and plot it? I tried nlsave("diff.nc", vDiff) but it didn't work..
Title: Re: select a particular cut-plane of electrostaticdifference
Post by: Anders Blom on December 16, 2013, 16:03
Your best option is probably to plot the contour plane directly in the script, using matplotlib.