Message: 3
Date: Fri, 27 Mar 2009 21:48:00 +0100
From: Evgeny Burovskiy burovski@alumni.umass.edu
Subject: Re: [ALPS-users] working on alps code
To: comp-phys-alps-users@phys.ethz.ch
Message-ID: 49CD3B80.9080803@physik.uni-greifswald.de
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Dear Jakub,
So I guess from examples .. but I cannot guess everything. To be specific.
I run QMC codes for Bose-Hubbard. I know how to get occupation at different
sides (for inhomogenous model, e.g. with harmonic trap and/or disorder),
call them <n_i>. But I am interested in second moment <n_i^2>
There is a solution which looks ugly, but works :
patch the definition of the site basis of the model you're working
with.
In your example, Bose-Hubbard Hamiltonian uses the basis called
"boson".
Go to models.xml file and then add a line to the SITEBASIS definition:
<SITEBASIS name="boson">
<PARAMETER name="Nmax" default="infinity"/>
<QUANTUMNUMBER name="N" min="0" max="Nmax"/>
<OPERATOR name="bdag" matrixelement="sqrt(N+1)">
<CHANGE quantumnumber="N" change="1"/>
</OPERATOR>
<OPERATOR name="b" matrixelement="sqrt(N)">
<CHANGE quantumnumber="N" change="-1"/>
</OPERATOR>
<OPERATOR name="n" matrixelement="N"/>
<OPERATOR name="n2" matrixelement="N*N"/> <!-- added -->
</SITEBASIS>
Like I said, it's ugly, but it works.
And, like you, I'd be very much interested in learning how to add
measurements properly, without dirty tricks :).
Best,
Zhenya
End of Comp-phys-alps-users Digest, Vol 36, Issue 16