Dear ALPS Developers and Users,
I have found a serious bug in alps::SimpleObservableData class defined in src/alps/alea/simpleobsdata.h. This bug has been introduced at [3918] (Feb. 24 2010, https://alps.comp-phys.org/trac/changeset/3918) and overlooked for about 4 years.
After [3918], the jackknife data structure is rebuild (or updated) only when it becomes necessary for linear or nonlinear operation. Unfortunately, the timing when it is invoked was wrong in some member functions. As a result, the results of operation in the evaluator also become incorrect in some cases.
For example, the following test code (alps/test/alea/mergeobs_times.C)
std::vectoralps::ObservableSet obssets(nsets); BOOST_FOREACH(alps::ObservableSet &obs, obssets){ obs << alps::RealObservable("one"); obs.reset(true); for(int i = 0; i < MCS; ++i) obs["one"] << 1.0 + (2 * random() - 1) * 0.3; } // merge for(int i = 1; i < nsets; ++i) obssets[0] << obssets[i]; alps::ObservableSet& obs = obssets[0]; alps::RealObsevaluator one = obs["one"]; make_obs(one * 2.0); std::cout << obs;
generates
one * 2.0: 4.0...
instead of
one * 2.0: 2.0...
This problem happens only if you
1) merge two or more ObservableSets (i.e. NUM_CLONES >= 2), and 2) operate (add, multiply, etc) a scaler constant or perform a nonlinear operation (exp, log, etc) just after merging two (or more) ObservableSets.
in your evaluator. On the other hand, operations between two evaluators are safe. Also, once you have performed an operation between two evaluators, succeeding scaler operations or nonlinear operations work correctly. For example,
binder = m4 / (m2 * m2); // binder cumulant corr = (L / (2*M_PI)) * sort(s0 / s1 - 1.0); // Second moment correlation length estimator
are safe, but
density = mag + 0.5;
will be incorrect. From what I've seen so far, the ALPS applications do not suffer from this bug. But if you are using (or have written) your own evaluator, please check your code carefully and upgrade ALPS to [7274] or later as soon as possible.
Best regards, Synge
comp-phys-alps-users@lists.phys.ethz.ch