Quantum 3xplorer (Q3)
An AI-native quantum simulation engine
Loading...
Searching...
No Matches
q3::execution Namespace Reference

Namespaces

namespace  gpu
 
namespace  threading
 

Classes

struct  BandPartition
 
class  ExecutionPolicy
 
class  MPIExecutionPolicy
 
class  PlanewaveExecutionPolicy
 
class  PlanewaveGPUExecutionPolicy
 
class  PlanewaveMPIExecutionPolicy
 
class  PlanewaveSerialExecutionPolicy
 
class  QuantumSystemExecutionPolicy
 
class  SerialExecutionPolicy
 

Functions

MPI_Datatype complex_datatype ()
 
BandPartition partition_bands (int number_of_bands, int number_of_ranks, int rank_index, int elements_per_band, int band_granularity=1)
 
int sum_complex (const Complex *source, Complex *destination, int number_of_elements, MPI_Comm communicator)
 
int sum_complex_in_place (Complex *data, int number_of_elements, MPI_Comm communicator)
 In-place complex MPI_SUM – see sum_complex().
 

Function Documentation

◆ complex_datatype()

MPI_Datatype q3::execution::complex_datatype ( )
inline

The MPI datatype matching Complex on the wire, for moving data – NOT for reductions, which must go through sum_complex_in_place(). See the file comment.

Definition at line 68 of file mpi_datatype.hpp.

Referenced by q3::execution::MPIExecutionPolicy::allgather_across_bands(), q3::execution::MPIExecutionPolicy::broadcast_across_bands(), and q3::execution::MPIExecutionPolicy::broadcast_from_group_root().

◆ partition_bands()

BandPartition q3::execution::partition_bands ( int  number_of_bands,
int  number_of_ranks,
int  rank_index,
int  elements_per_band,
int  band_granularity = 1 
)
inline

Partition whole units, then convert back to bands. The final unit may be short when the band count is not a multiple of the granularity, so every block is clamped to what is actually left.

Definition at line 52 of file init.hpp.

References q3::execution::BandPartition::counts, q3::execution::BandPartition::displacements, q3::execution::BandPartition::local_first_band, and q3::execution::BandPartition::local_number_of_bands.

Referenced by q3::SerialPlanewaveHamiltonianApplicator::apply_batch(), q3::SerialPlanewaveSubspaceManager::build_correction_vectors(), and q3::SerialPlanewaveSubspaceManager::multiply_basis_by_coefficients_across_bands().

◆ sum_complex()

int q3::execution::sum_complex ( const Complex *  source,
Complex *  destination,
int  number_of_elements,
MPI_Comm  communicator 
)
inline

MPI_SUM over a complex buffer, reduced as pairs of doubles.

The only way complex data may be summed in Q3 – see the file comment for why a complex datatype is not used. Reinterpreting the buffer is well defined: C++ requires an array of N std::complex<double> to be reinterpretable as an array of 2N doubles, real part first.

A null source reduces destination in place; otherwise the two must not overlap, as for MPI_Allreduce itself.

Chunked because the element count doubles: a caller may legitimately pass any int, and 2N would overflow one past 2^30 elements. Each chunk is an independent reduction, so splitting changes no result.

Definition at line 89 of file mpi_datatype.hpp.

Referenced by sum_complex_in_place().

◆ sum_complex_in_place()

int q3::execution::sum_complex_in_place ( Complex *  data,
int  number_of_elements,
MPI_Comm  communicator 
)
inline