Quantum 3xplorer (Q3)
An AI-native quantum simulation engine
Loading...
Searching...
No Matches
init.hpp
Go to the documentation of this file.
1#pragma once
2
3/**
4 * QuantumSystemExecutionPolicy — introduces band semantics on top of the
5 * representation-agnostic ExecutionPolicy.
6 *
7 * Layer 0 provides collective operations over an anonymous process group; it
8 * deliberately knows nothing about bands, k-points, or any physical basis.
9 * This interface fixes the meaning of that group at the quantum-system level:
10 * a *band group* is the set of processes that diagonalize the same quantum
11 * states together, sharing the work of one diagonalization. The layer-0
12 * process group IS the band group — dot_product, norm, reduce_within_group,
13 * and the group broadcast/allgather primitives all operate over it.
14 *
15 * Representation-specific topology (e.g. k-point pools and G-vector slab
16 * distribution in the planewave representation) is layered on further down,
17 * in layer_4_computation/iterator/kohn_sham/planewave/execution/init.hpp.
18 *
19 * No MPI headers — the band accessors are thin, band-named views of the
20 * layer-0 group topology.
21 */
22
24
25namespace q3 {
26namespace execution {
27
29 public:
30 ~QuantumSystemExecutionPolicy() override = default;
31
32 /**
33 * Number of processes collaborating within this band group.
34 *
35 * 1 means each process diagonalizes its quantum states alone (no band
36 * parallelism); >1 means the diagonalization work of each quantum state
37 * is shared across the group.
38 */
39 int band_size() const {
40 return group_size();
41 }
42
43 /**
44 * Index of this process within its band group (0 = band root).
45 */
46 int band_rank_index() const {
47 return group_rank_index();
48 }
49};
50
51} // namespace execution
52} // namespace q3
virtual int group_size() const =0
virtual int group_rank_index() const =0