Dear All, I have found here: http://alps.comp-phys.org/mediawiki/index.php/Tutorials:MeasureHOWTO a way to measure an observable (while working with QMC code) which is related to the basis in which we measure by some simple formula: sqrt (N). But i still have some question regarding implementing a non-standard situation. I would not like to go into really ugly details, so I have created a self contained example:
I understood that: symbols "N" that appearing in that example are labels of quantum numbers defining the basis: if basis was enumerated by a few quantum numbers then the config should look like this:
<SITEBASIS name="boson"> <QUANTUMNUMBER name="S" min="0" max="b1"/> <QUANTUMNUMBER name="C" min="0" max="b2"/>
<OPERATOR name="Milka" matrixelement="1"> <CHANGE quantumnumber="S" change="-1"/> <CHANGE quantumnumber="C" change="1"/> </OPERATOR> </SITEBASIS>
In this case operator "Milka" creates one bar of chocolate using one unit of sugar?
Another issue is what makes a correct expression? I suppose that parsing of these things is done by "expression" binary. Which functions are supporter by this parser? sqrt(N) is supported but BesselJ(N) may not be, I also saw different examples of random number generators - matrixelement="random_gaussian(1)" (or sth like that).
The other question: if matrix elements are not constant, a simple function but "conditional" in nature:
Milka_{(S1,C1), (S2,C2)} = 1 is \lambda(S1,C1,S2,C2) is true and -7 otherwise
then I suppose:
<SITEBASIS name="boson"> <QUANTUMNUMBER name="S" min="0" max="b1"/> <QUANTUMNUMBER name="C" min="0" max="b2"/>
<OPERATOR name="Milka" matrixelement=" f(S1,C1,S2,C2)-7*(1-f(S1,C1,S2,C2))"> <CHANGE ...> </OPERATOR> </SITEBASIS>
will do provided f evaluates to 1,0 iff \lambda is true,false for any C1,C2,S2,S1. Is there a way to introduce "if" construct inside the matrixelement?
Regards, Mateusz Lacki
On Nov 28, 2011, at 4:23 PM, Mateusz Łącki wrote:
Dear All, I have found here: http://alps.comp-phys.org/mediawiki/index.php/Tutorials:MeasureHOWTO a way to measure an observable (while working with QMC code) which is related to the basis in which we measure by some simple formula: sqrt (N). But i still have some question regarding implementing a non-standard situation. I would not like to go into really ugly details, so I have created a self contained example:
I understood that: symbols "N" that appearing in that example are labels of quantum numbers defining the basis: if basis was enumerated by a few quantum numbers then the config should look like this:
<SITEBASIS name="boson"> <QUANTUMNUMBER name="S" min="0" max="b1"/> <QUANTUMNUMBER name="C" min="0" max="b2"/>
<OPERATOR name="Milka" matrixelement="1"> <CHANGE quantumnumber="S" change="-1"/> <CHANGE quantumnumber="C" change="1"/> </OPERATOR> </SITEBASIS>
In this case operator "Milka" creates one bar of chocolate using one unit of sugar?
Yes
Another issue is what makes a correct expression? I suppose that parsing of these things is done by "expression" binary. Which functions are supporter by this parser? sqrt(N) is supported but BesselJ(N) may not be, I also saw different examples of random number generators - matrixelement="random_gaussian(1)" (or sth like that).
The other question: if matrix elements are not constant, a simple function but "conditional" in nature:
Milka_{(S1,C1), (S2,C2)} = 1 is \lambda(S1,C1,S2,C2) is true and -7 otherwise
then I suppose:
<SITEBASIS name="boson"> <QUANTUMNUMBER name="S" min="0" max="b1"/> <QUANTUMNUMBER name="C" min="0" max="b2"/>
<OPERATOR name="Milka" matrixelement=" f(S1,C1,S2,C2)-7*(1-f(S1,C1,S2,C2))"> <CHANGE ...> </OPERATOR> </SITEBASIS>
will do provided f evaluates to 1,0 iff \lambda is true,false for any C1,C2,S2,S1. Is there a way to introduce "if" construct inside the matrixelement?
You can add extra functions in the file src/alps/expression/evaluator.h . We have not made this easy to extend yet but it should not be too hard to add your own special functions, like the Milka function, or your f function.
Matthias
comp-phys-alps-users@lists.phys.ethz.ch