On 2011/02/10, at 0:22, Kubila wrote:
Thank you very much for your email. I am using ALPS 2.0. It will be great if you can briefly tell me how to modify the code in order to calculate the magnetization density for my model. Also will it be possible to measure the correlation of the first component of magnetization for this model? Many appreciations!
Please find attached patch to applications/qmc/looper/path_integral.C, by which you can measure the average number of site operators. Since this quantity is related to the total site-term energy, i.e. Zeeman term by the transverse field, by
- Gamma * <Sum(S_i^x)> = - T * <Number of Site Operators> + C
with C = Gamma/2 in the present specific case, the transverse magnetization per site is given by
<S_i^x> = T * <Number of Site Operators> / N / Gamma - 1/2
where T is the temperature, N the number of sites.
Best, Synge
Index: applications/qmc/looper/path_integral.C =================================================================== --- applications/qmc/looper/path_integral.C (revision 5386) +++ applications/qmc/looper/path_integral.C (working copy) @@ -150,6 +150,7 @@ } looper::energy_estimator::init_observables(obs, model.is_signed()); estimator.init_observables(obs, model.is_signed()); + obs << alps::RealObservable("Number of Site Operators"); }
void loop_worker::run(alps::ObservableSet& obs) { @@ -374,6 +375,11 @@
// normal measurement estimator.normal_measurement(obs, lattice, beta, sign, spins, operators, spins_c); + + // counting number of site operators + int num_site_op = 0; + BOOST_FOREACH(local_operator_t& op, operators) if (op.is_site()) ++num_site_op; + obs["Number of Site Operators"] << (double)num_site_op; }
typedef looper::evaluator<loop_config::measurement_set> loop_evaluator;