-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Density #28
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor comments :)
Hubbard/plot/plot.py
Outdated
import sisl | ||
|
||
# Set new sc to create real-space grid | ||
sc = sisl.SuperCell([self.xmax-self.xmin, self.ymax-self.ymin, 3.2]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you should use origo
instead of move
. It makes checking stuff easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem I found is that by only setting the origo
of the geometry/supercell, only atoms with positive xyz
coordinates appear in the plot, while negative ones don't. I'm not sure why...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I think is related to the wavefunction
method, because when using a DensityMatrix
object it works perfectly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, let me see if I can reproduce.
They should work similarly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can let me know which test shows this, I'll use that as a baseline?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can try going to folder tests/
and run the file test-hubbard-plots.py
which tests all plotting functionalities. In principle testing all these functions is not really necessary, since Charge
, ChargeDifference
, and SpinPolarization
are very similar (the real space grid is created from a DensityMatrix
object from sisl
), while they differ from Wavefunction
, where the real space grid is created from a wavefunction
object (from sisl
).
The one that I am having problems with is the latter one, while the other ones work fine when using origo
instead of move
. Let me know if you try and what you get :-).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I see. The reason is that sisl currently handles unit-cells such that the specified coordinates must be within the unit-cell. If not spurious things may happen, see zerothi/sisl#102.
Hence, if you shift the atomic coordinates into the primary cell, it will work with origo... :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works by shifting only negative coordinates into the primary cell (see my last commit 90b2ed8) . I will merge this on the master branch now :-)
Since the realspace and orbitals functions in charge.py and wavefunction.py are the same, defining them once in the GeometryPlot class is enough
Since these functions are now defined in plot.py they can be used from there.
…space Since these functions are now defined in plot.py they can be used from there.
…ions Since these functions are now defined in plot.py the can be used from there.
…ion.py Since they are now defined in plot.py they can be used from there
First attempt to add possibility to create a real space grid from a DensityMatrix sisl object to plot in real space physical quantities that involve densities (such as charge, charge difference, spin polarization...) to fix #13. In principle it works.