Anouar - #39
Merged
Merged
Conversation
… Now corrected. The RPA examples are still broken and need to be looked at.
GPU-accelerated counterparts to the CPU solvers, for systems/Ncheb too large to run on CPU. Chebyshev recurrence, MPO/MPS products, Hadamard products, projections, and real-space/QFT sampling run on GPU (NDTensors CUDA backend, ComplexF32); setup, Tucker SVDs, k-/spatial-group bookkeeping, and final scalar accumulation stay on CPU. Entry points: - get_conductivity_ward_gpu / get_conductivity_cheb2d_gpu - sigma(omega) - get_bands_gpu - A(k,omega) band structure - get_ldos_spatial_gpu - A(r,omega) real-space LDOS, with :point/:block sampling and sublattice :average/:resolve modes - get_dos_stochastic_gpu - stochastic-trace DOS - get_exciton_ldos_spatial_gpu - A(X,omega) exciton LDOS - get_C_gpu - real-space Chern marker - scf_magnetic_hubbard_gpu, get_scf_magnetization_gpu, get_scf_bands_gpu - collinear magnetic Hubbard SCF loop and post-hoc magnetization/band diagnostics CUDA stays an optional dependency: CUDA is resolved at runtime via Base.loaded_modules (no `using CUDA` at load time, not in Project.toml), so including this file does not force CUDA on users who never call *_gpu functions.
…F maps
Adds a single planner used by every spatial sampler (eval_mps_spatial here,
plus get_ldos_spatial, get_ldos_spatial_gpu, get_scf_magnetization_gpu) so
they share one geometry-aware notion of "where to sample" and "how to
reduce the cells under each pixel."
- spatial_sampling_plan(L; ...) - builds sample centers/groups for a
2^Lx x 2^Ly system. Supports two reduction modes:
- :point (default) - sample/box-average at grid positions; cheap but
aliases thin features on a coarse grid.
- :block - gap-free coarse-graining: integrate each block by tracing
out the within-block position bits (cost independent of block size),
for large-scale maps of thin edge/domain-wall features.
Also decides whether multi-atom unit cells are sublattice-:resolved
(per-atom columns) or :averaged (one value per unit cell), or :auto
based on sampling resolution. Extensive docstring documents all three
procedures with usage examples.
- _eval_block_mps(A, ixp, iyp, a, b, Lx, Ly) - CPU block-integration MPS
evaluator backing reduce=:block.
- eval_mps_spatial(A; ...) - new spatial sampler for profile MPS (e.g. SCF
density/magnetization), built on spatial_sampling_plan; same
num_x/num_avg/x_groups/box_half API as get_ldos_spatial but evaluates via
eval_mps directly (no KPM recursion).
spatial_sampling_plan, requires num_x/num_y powers of two, :mpo mode only) alongside the existing :point sampling, plus sublattice=:resolve /:average/:auto for geometry-aware sublattice handling. New num_y, grid, xwin, ywin, box_half kwargs enable 2D grid/window sampling. accumulate_Tn! is simplified via a new spatial_vals_cpu closure that unifies point vs. block reduction across resolved/averaged sublattice layouts. Docstring rewritten to document the sampling procedures, sublattice decision logic, and resulting shapes. get_dos_stochastic: add dos_weighting=:trace (default, unchanged behavior) / :sample (raw sampled signal before sector-size weighting, for inspecting exciton bound peaks) and HODC reconstruction support via new eta/m_order kwargs. New _dos_weight_matrix helper centralizes the per-kernel weight matrix and normalization denom, replacing the old _kpm_weight_matrix + hardcoded pi^2*Ncheb norm, and is shared with the new exciton LDOS path. Exciton LDOS: replace the cache-based get_exciton_ldos (now internal _get_exciton_ldos_cached, kept for legacy use) with get_exciton_ldos_spatial, an online MPS Chebyshev recursion over one or many bound-pair positions |X,X> with no cache stored on H. New public get_exciton_ldos (scalar and vector-omega forms) wrap get_exciton_ldos_spatial for a single position. Update the Pathway 2/4 overview at the top of the file to match. Minor: fix "HODC" expansion (High-Order Damping Correction -> Higher-Order Delta Chebyshev) in get_ldos_hodc_from_mun's docstring.
Member
Author
|
@copilot resolve the merge conflicts in this pull request |
Done in commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.