Molecular grid types#

These APIs provide the quadrature grid infrastructure for numerical integration. The GauXC::Grid class encapsulates an atom-centered spherical quadrature with batching support. GauXC::MolGrid aggregates per-element grids based on the atomic number to form a complete molecular integration grid. The GauXC::MolGridFactory creates molecular grids from molecules and basis sets.

For applying standard grid sizes and pruning schemes, the enums GauXC::AtomicGridSizeDefault, GauXC::RadialQuad, and GauXC::PruningScheme are provided. Finally, the GauXC::MolecularWeights class provides support for computing molecular integration weights, with configuration via GauXC::MolecularWeightsSettings and construction through GauXC::MolecularWeightsFactory.

class MolGrid#

Molecular integration grid container.

MolGrid aggregates atom-centered quadrature grids for each atomic number and exposes access to per-element grids and batch sizing information for numerical integration.

Public Functions

MolGrid(const atomic_grid_map&)#

Construct from pre-built atom-centered grids.

Parameters:

grids – Map from atomic number to Grid instances.

MolGrid(const atomic_grid_spec_map&)#

Construct from grid specification variants.

Parameters:

grid_specs – Map from atomic number to grid specification variants.

MolGrid(const MolGrid&)#

Copy constructor.

MolGrid(MolGrid&&) noexcept#

Move constructor.

~MolGrid() noexcept#

Destructor.

size_t natoms_uniq() const#

Get the count of unique atomic numbers represented.

Returns:

Number of distinct atomic numbers in the grid map.

const Grid &get_grid(AtomicNumber) const#

Retrieve the atom-centered grid for a given atomic number.

Parameters:

Z – Atomic number to look up.

Returns:

Const reference to the associated Grid.

Grid &get_grid(AtomicNumber)#

Retrieve the atom-centered grid for a given atomic number (mutable).

Parameters:

Z – Atomic number to look up.

Returns:

Reference to the associated Grid.

size_t max_nbatches() const#

Get the maximum batch count across all stored grids.

Returns:

Largest number of batches among all atom grids.

class Grid#

A class to manage a particular spherical (atomic) quadrature.

Public Functions

Grid(std::shared_ptr<quadrature_type> q, BatchSize bsz)#

Generate a batched atomic grid.

Parameters:
  • q[in] Shared ptr to a preconstructed quadrature instance

  • bsz[in] Batch size for quadrature

Grid(const Grid&)#

Copy a Grid object.

Grid(Grid&&) noexcept#

Move a Grid object.

Grid &operator=(const Grid&)#

Copy-assign a Grid object.

Grid &operator=(Grid&&) noexcept#

Move-assign a Grid object.

~Grid() noexcept#

Destroy a Grid object.

const batcher_type &batcher() const#

Get batcher instance for underlying Grid implementation.

Const variant

Returns:

Batcher instance pertaining to the Grid object

batcher_type &batcher()#

Get batcher instance for underlying Grid implementation.

Non-const variant

Returns:

Batcher instance pertaining to the Grid object

Warning

doxygenclass: Cannot find class “GauXC::MolGridFactory” in doxygen xml output for project “GauXC” from directory: _doxygen/xml

enum class GauXC::AtomicGridSizeDefault#

Specifications of grid defaults for atomic integration.

See https://gaussian.com/integral for specification

Values:

enumerator FineGrid#

Fine grid (least accurate)

enumerator UltraFineGrid#

Ultrafine grid (appropriate accuracy)

enumerator SuperFineGrid#

Superfine grid (most accurate)

enumerator GM3#

Treutler-Ahlrichs GM3.

enumerator GM5#

Treutlet-Ahlrichs GM5.

enum class GauXC::RadialQuad#

GauXC specific enums for the specification of radial quadratures.

Generally mapped to equivalent enums in IntegratorXX

Values:

enumerator Becke#

Becke radial quadrature.

enumerator MuraKnowles#

Mura-Knowles radial quadrature.

enumerator MurrayHandyLaming#

Murray-Handy-Laming radial quadrature.

enumerator TreutlerAhlrichs#

Treutler-Ahlrichs radial quadrature.

enum class GauXC::PruningScheme#

High-level specification of pruning schemes for atomic quadratures.

Values:

enumerator Unpruned#

Unpruned atomic quadrature.

enumerator Robust#

The “Robust” scheme of Psi4.

enumerator Treutler#

The Treutler-Ahlrichs scheme.

class MolecularWeights#

Applies molecular partition weights to pre-generated quadrature tasks.

This class computes and modifies the quadrature weights stored in a LoadBalancer according to a specified partitioning scheme (e.g., SSF, Becke).

Public Types

using load_balancer_type = LoadBalancer#

LoadBalancer type alias.

using load_balancer_reference = load_balancer_type&#

Reference to LoadBalancer.

Public Functions

MolecularWeights() = delete#

Deleted default constructor.

~MolecularWeights() noexcept#

Destructor.

MolecularWeights(pimpl_ptr_type &&ptr)#

Construct from a pre-built implementation.

Parameters:

ptr – Unique pointer to implementation instance.

MolecularWeights(const MolecularWeights&) = delete#

Deleted copy constructor.

MolecularWeights(MolecularWeights&&) noexcept#

Move constructor.

void modify_weights(load_balancer_reference lb) const#

Apply weight partitioning to local quadrature tasks.

Parameters:

lb – Reference to the LoadBalancer whose weights will be modified.

const util::Timer &get_timings() const#

Get the local timing tracker.

Returns:

Const reference to internal timer.

class MolecularWeightsFactory#

Factory for constructing MolecularWeights instances.

Provides a configurable interface to generate MolecularWeights objects for host or device execution spaces with specified settings.

Public Functions

MolecularWeightsFactory() = delete#

Deleted default constructor.

MolecularWeightsFactory(ExecutionSpace ex, std::string local_work_kernel_name, MolecularWeightsSettings s)#

Construct a factory for generating MolecularWeights instances.

Parameters:
  • ex – Execution space for weight computation. Acceptable values:

    • Host: Run on CPU.

    • Device: Run on GPU (if enabled).

  • local_work_kernel_name – Specification of the LocalWorkDriver kernel. See LocalWorkDriver documentation for details.

  • s – Settings for the MolecularWeights calculation.

std::shared_ptr<MolecularWeights> get_shared_instance()#

Generate a shared-pointer MolecularWeights instance.

Returns:

Shared pointer to a new MolecularWeights object.

inline MolecularWeights get_instance()#

Generate a MolecularWeights instance.

Returns:

Newly constructed MolecularWeights object.

struct MolecularWeightsSettings#

Settings for molecular weight partitioning.

Controls the weight partitioning algorithm and optional size adjustments used when computing molecular quadrature weights.

Public Members

XCWeightAlg weight_alg = XCWeightAlg::SSF#

Weight partitioning scheme.

bool becke_size_adjustment = false#

Whether to use Becke size adjustments.