Closed SrujS closed 7 years ago
Hi srujanji,
can you be a bit more specific -- which script file are you referring to?
Thanks!
Hello mgbukov,
QuSpin Example Code 1: Exact Diagonalisation of the XXZ Model
What I am confused about is that, in order to introduce randomness, I want to use the h_z parameter (external field different for each site derived from normal distribution) and since it comes into static part of Hamiltonian, we included all terms in line 21 as "static = [["+-",J_xy],["-+",J_xy],["zz",J_zz]]"
but there is no mentioning of h_z in line 21 or in following lines. That's why I am a bit confused whether it is considering h_z or diagonalizing Hamiltonian without that term. Your efforts are much appreciated.
OK, so there are two things here:
i) example0.py
here we are not considering a random Hamiltonian, so in this example there is no randomness.
Nevertheless, there are two bugs in this script:
line 19 should read:
h_z=[[hz,i] for i in range(L)]
In order to use parity, we need the same z-field on each pair of opposite sites, so we need to include the last site.
and line 21 should read:
static = [["+-",J_xy],["-+",J_xy],["zz",J_zz],["z",h_z]]
in order to include the z-field in the Hamiltonian.
Without fixing these lines, the way the script is written right now the Hamiltonian is built without the z-field, and so there is no problem. If you only make the change in line 21 (I advise you to do that first), quspin should yell at you for trying to use parity (specifying the reflection block pblock=1
in basis
in line 15), while the hz-coupling violates parity, since it misses the term on the last site of the chain, see line 19. The fix in line 19 above removes that second bug.
ii) example1.py
if you need to include randomness in the z-field, I suggest you look at example1.py
. This is achieved there using the realization()
function, lines 54-66.
Let us know if you have questions on that.
Dear Mgbukov, No questions at all and THANK YOU very much for your detailed instructions. It really helped me.
Btw, we will soon have another major release including bosons and fermions with a proper documentation and many more examples. Keep an eye on the main quspin repository (this is a different repository than the one we are at right now)
On Fri, Aug 25, 2017 at 6:25 PM srujanji notifications@github.com wrote:
Dear Mgbukov, No questions at all and THANK YOU very much for your detailed instructions. It really helped me.
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/weinbe58/qspin_paper/issues/2#issuecomment-325047463, or mute the thread https://github.com/notifications/unsubscribe-auth/AM8qBrWrdb2qdzOGwyXwgGNM7rCB2VEKks5sb0m1gaJpZM4PDMzo .
https://github.com/weinbe58/QuSpin
Definitely, I will. Thank You very much.
In static part of Hamiltonian (line no. 21), why there is no bracket for the h_z term (line 19) in the Hamiltonian? Please help here, because where and how h_z is included in the final matrix?