Implemented disorder in the DCA Loop using the CT-AUX solver - #365
Implemented disorder in the DCA Loop using the CT-AUX solver#365anirudha-mirmira wants to merge 45 commits into
Conversation
add data member to dca_loop data, should still be more
Unfortunate rippling
discovered much wider access to dca_data g0_r_t than expected
Unfortunate rippling
…ed quantities and added another TWO_K_DISORDER flag for the WIP involving k1,k2
…at the code runs. Concurrency barriers for prettier printing of disorder output
… disorder averaging procedure. Also wrote a test for the edited accumulation
…m cluster GF and added a dummy disorder block.
…(replaced earlier code) and dumping of disorder configurations. Wired new disorder config generation to the dca_loop.
…ion, orientation and full loop with U=0
…iagonal short-circuits, implemented compatible local_G_k_w
… calculated as FT from w rather than the erroneous inversion, tail from clean G0_cl_exl; MAJOR CHANGE: g0_interpolation now uses the two r-index signatures even in clean case. Cleanup and a walker unit test added
…he disordered_G0_cl_exl
…ed with the CMake option -DDCA_WITH_DISORDER=ON
…lock or zero num_configs in the input file
…al copy of disorder averaged G and Sigma and error bars
… only when Cmake option -DDCA_WITH_DISORDER=ON; Stat test revealed bug in local_G_k_w division by sign, fixed both disorder and clean branches (other parts were fixed in 2023)
Delete dead, never-compiled early-iteration disorder files: apply_disorder.{cpp,hpp}
(in include/ and src/), make_disorder.hpp, and two committed-by-accident Emacs lock
symlinks (.#apply_disorder.{cpp,hpp}). None are referenced by any CMakeLists or #include;
the live disorder generation path is makeDisorderConfigurations.hpp.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Brings the CT-AUX site-disorder work (DCA_WITH_DISORDER / DISORDERED_G0) onto master. Conflict: include/.../ctaux/ctaux_walker.hpp — resolved by taking master's version. disorder_two_k's only changes to this file were clang-format reflow (no logic); master's 85e58ac carries the real change there (re-enabled NDEBUG delayed-spin check) plus the Matrix::resize memory-corruption fix elsewhere. All other overlaps (parameters.hpp, output_parameters.hpp, the parameters test CMake/test) auto-merged in disjoint regions. Verified on the merged tree (DCA_WITH_DISORDER=ON): main_dca builds, 7/7 disorder unit tests pass. Master's new readInput checks (OutputParameters::validate, checkModelSections) accept the disorder inputs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PDoakORNL
left a comment
There was a problem hiding this comment.
@anirudha-mirmira These are my comments based on the work you did which looks good, it would have been nice to retain the ability to run both disorder and standard calculations without recompilation but that can probably be restored.
Most of what I see holding this back from merge is other delta's inherited from the starting branch and its divergence for master. We should discuss directly.
| std::cout << "\n\t\t symmetrize measurements has started \t" << dca::util::print_time() << "\n"; | ||
|
|
||
| #ifdef DISORDERED_G0 | ||
| // No Symmetrize overload for the two-site <nu,R,nu,R,w> domain, and crystal symmetry only holds |
There was a problem hiding this comment.
I believe the symmetrization is also a linear operation and therefore will commute with the sum. One reason not to symmetrize here is the possibility it introduce more floating point error. The other is we don't have the symmetrization overload written.
My intuition is that applying the symmetrization to each configuration or once to the summed M will make little difference unless the sampling is insufficient.
| // on every rank (every rank generates the same disorder ensemble) and fixed for the whole | ||
| // run (the ensemble is the same in every DCA iteration, i.e. quenched disorder). No separate | ||
| // seed broadcast is needed here. | ||
| constexpr unsigned disorder_seed_offset = 0x9e3779b9u; // golden ratio; arbitrary but fixed |
There was a problem hiding this comment.
This seems perfectly fine and its useful to know the behavior of Parameters.
but more import are the assumptions MakeDisorderConfigurations makes wrt Parameters, i.e. its requirements of Parameters for this class to function as described.
The following assumptions are made here:
- The global seed is read from input and an identical value is returned by parameters.get_seed() in all contexts parameters is available.
- the parmeters.get_seed() value is immutable
One might assume Parameters are immutable over a DCA run but the code violates this for instance with chemical potential.
| #ifdef DISORDERED_G0 | ||
| // The two-particle (G4) accumulator measures against the clean G0_k_w_cluster_excluded, which is | ||
| // inconsistent with the disordered walker; fail fast rather than produce wrong G4 under disorder. | ||
| if (parameters_.isAccumulatingG4()) |
There was a problem hiding this comment.
This is much better than having it still go and be wrong.
| using typename BaseClass::Accumulator; | ||
| using Walker = stdthreadqmci::StdThreadQmciWalker<typename BaseClass::Walker, Data>; | ||
| using SpGreensFunction = typename BaseClass::SpGreensFunction; | ||
| using SpDisorderedGreensFunction = typename BaseClass::SpDisorderedGreensFunction; |
There was a problem hiding this comment.
This breaks the CTINT build and in a way that is not going to be clear to most people building the code. Some clean way of dealing with this is needed. An intelligible compilation or cmake error would be fine until disorder is supported for ctint.
Summary
Support DCA calculations for systems with static on-site disorder. The crux of the implementation is the idea that the addition of disorder configurations breaks the translational symmetry and requires the cluster problem to be solved with two real space indices (for the 2D case) instead of a single displacement index. The disorder averaging, which is carried out analogously to the CPA, restores translational symmetry, thereby allowing for the solution of the cluster problem with a single displacement and subsequently a single momentum index.
The flow proceeds as follows: Subsequent to the calculation of the cluster excluded G0(d), the real space indices are unfolded to get G0(r1,r2), the disorder configurations (box or binary) are added. This disordered_G0(r1,r2) is the bare line the walkers uses to walk the chains, followed by an two index M(r1,r2) accumulation. The resulting interacting G(r1,r2) is disorder averaged, folded back into a single displacement index G(d), transformed to G(k) and fed into the cluster finalization step.
CMake Options
The new code has an associated
-DDCA_WITH_DISORDER=ONgate, which definesDISORDERED_G0flag. The disorder parts are separated with#ifdef DISORDERED_G0conditionals. The-DDCA_WITH_DISORDER=OFFflag results is identical to the clean code except in the places as noted belowMain differences from the DCA++ main branch
These are the changes to existing, shared code paths:
g0_interpolationnow uses the two r-index signature G0(r1, r2) in both the clean anddisordered cases. : The clean code calculated a single index as subtract(r2,r1) in the g0_interpolation routines, which is now calculated after inputting both the indices separately;
Fixed a latent divide-by-sign bug in
local_G_k_w(used bycomputeErrorBars) inboth branches: the
get_accumulated_signwas used where the scalar accumulatedget_accumulated_phasewas intended (missed by the Feb-2023 Phase refactor).CMake files where a new CMake option
DCA_WITH_DISORDER(OFF by default) definingDISORDERED_G0, plus anew
DisorderParametersblock (with MPI broadcast) and disorder-related parameter wiring.Features
unique-configs: trueparameter allows for the generation of strictly unique configurationsnum-configurations: 0is handled with a warning and calculation with a single configurationExample disorder block in input
Disorder is configured by adding a
disorderblock to the run's JSON input. The presence ofthe block is what enables the disorder flow; omit it for a clean run.
distribution-"binary"or"box"(any other value is a hard error).potential- disorder strength: V for binary (levels ±V/2), or the full box width W.density- fraction of sites at +V/2 for the binary distribution (ignored by box). For values away from 0.5,adjust-chemical-potentialin thephysicsblock should befalseto prevent chemical potential adjustment from undoing the effect of the shifted average potential.num-configurations- number of disorder realizations in the ensemble (equal weights).unique-configs- iftrue, enforce distinct binary realizations (no-op for box).Tests
Added and tested disorder tests gated on
DCA_WITH_DISORDER AND NOT DCA_WITH_CUDA AND NOT DCA_WITH_HIP, which test the following:Limitations
DCA_WITH_DISORDER+ CUDA/HIP configuration is a deliberate hard CMake error: the GPU version is not implemented. The common G0_interpolation in the GPU case has the original signature and the two index version is not implemented.binaryandboxare accepted; any otherdistributionvalue is a hard error.