Skip to content

Commit 208dde0

Browse files
committed
Merge branch 'master' into pyscf-grids
2 parents dc93bc8 + 937bfc3 commit 208dde0

49 files changed

Lines changed: 5460 additions & 42 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ endif()
2727

2828

2929
# GauXC Options
30+
option( GAUXC_ENABLE_C "Enable C API" ON )
3031
option( GAUXC_ENABLE_HOST "Enable Host Integrator" ON )
3132
option( GAUXC_ENABLE_CUDA "Enable CUDA Bindings" OFF )
3233
option( GAUXC_ENABLE_HIP "Enable HIP Bindings" OFF )
@@ -54,6 +55,7 @@ cmake_dependent_option( GAUXC_ENABLE_CUTLASS
5455
)
5556

5657
# Default the feature variables
58+
set( GAUXC_HAS_C FALSE CACHE BOOL "" FORCE )
5759
set( GAUXC_HAS_HOST FALSE CACHE BOOL "" FORCE )
5860
set( GAUXC_HAS_CUDA FALSE CACHE BOOL "" FORCE )
5961
set( GAUXC_HAS_HIP FALSE CACHE BOOL "" FORCE )
@@ -67,6 +69,7 @@ set( GAUXC_HAS_CUTLASS FALSE CACHE BOOL "" FORCE )
6769
set( GAUXC_BLAS_IS_LP64 FALSE CACHE BOOL "" FORCE )
6870

6971
mark_as_advanced( FORCE
72+
GAUXC_HAS_C
7073
GAUXC_HAS_HOST
7174
GAUXC_HAS_CUDA
7275
GAUXC_HAS_HIP

cmake/gauxc-config.cmake.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ include(CMakeFindDependencyMacro)
1010
find_dependency( ExchCXX )
1111
find_dependency( IntegratorXX )
1212

13+
set( GAUXC_HAS_C @GAUXC_HAS_C@ )
1314
set( GAUXC_HAS_HOST @GAUXC_HAS_HOST@ )
1415
set( GAUXC_HAS_CUDA @GAUXC_HAS_CUDA@ )
1516
set( GAUXC_HAS_HIP @GAUXC_HAS_HIP@ )

include/gauxc/c/atom.h

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/**
2+
* GauXC Copyright (c) 2020-2024, The Regents of the University of California,
3+
* through Lawrence Berkeley National Laboratory (subject to receipt of
4+
* any required approvals from the U.S. Dept. of Energy).
5+
*
6+
* (c) 2024-2025, Microsoft Corporation
7+
*
8+
* All rights reserved.
9+
*
10+
* See LICENSE.txt for details
11+
*/
12+
#pragma once
13+
14+
#ifdef __cplusplus
15+
#include <cstdint>
16+
#include <cstdbool>
17+
#include <cstddef>
18+
#else
19+
#include <stdint.h>
20+
#include <stdbool.h>
21+
#include <stddef.h>
22+
#endif
23+
24+
#ifdef __cplusplus
25+
extern "C" {
26+
namespace GauXC::C {
27+
#endif
28+
29+
/**
30+
* @brief GauXC C API Atom representation.
31+
*/
32+
typedef struct GauXCAtom {
33+
int64_t Z; ///< Atomic number.
34+
double x; ///< X coordinate (Bohr).
35+
double y; ///< Y coordinate (Bohr).
36+
double z; ///< Z coordinate (Bohr).
37+
} GauXCAtom;
38+
39+
#ifdef __cplusplus
40+
} // namespace GauXC::C
41+
} // extern "C"
42+
#endif

include/gauxc/c/basisset.h

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/**
2+
* GauXC Copyright (c) 2020-2024, The Regents of the University of California,
3+
* through Lawrence Berkeley National Laboratory (subject to receipt of
4+
* any required approvals from the U.S. Dept. of Energy).
5+
*
6+
* (c) 2024-2025, Microsoft Corporation
7+
*
8+
* All rights reserved.
9+
*
10+
* See LICENSE.txt for details
11+
*/
12+
#pragma once
13+
14+
#ifdef __cplusplus
15+
#include <cstdint>
16+
#include <cstdbool>
17+
#include <cstddef>
18+
#else
19+
#include <stdint.h>
20+
#include <stdbool.h>
21+
#include <stddef.h>
22+
#endif
23+
#include <gauxc/c/types.h>
24+
#include <gauxc/c/status.h>
25+
#include <gauxc/c/shell.h>
26+
27+
#ifdef __cplusplus
28+
extern "C" {
29+
namespace GauXC::C {
30+
#endif
31+
32+
/**
33+
* @brief GauXC C API BasisSet handle.
34+
*/
35+
typedef struct GauXCBasisSet {
36+
GauXCHeader hdr; ///< Header for internal use.
37+
void* ptr; ///< Pointer to the BasisSet instance.
38+
} GauXCBasisSet;
39+
40+
/**
41+
* @brief Create a new BasisSet instance.
42+
* @param status Status object to capture any errors.
43+
* @return Handle to the created BasisSet.
44+
*/
45+
extern GauXCBasisSet gauxc_basisset_new( GauXCStatus* status );
46+
47+
/**
48+
* @brief Create a new BasisSet instance from arrays of shells.
49+
* @param status Status object to capture any errors.
50+
* @param shells Pointer to an array of GauXCShell.
51+
* @param nshells Number of shells in the array.
52+
* @param normalize Whether to normalize the basis functions.
53+
* @return Handle to the created BasisSet.
54+
*/
55+
extern GauXCBasisSet gauxc_basisset_new_from_shells(
56+
GauXCStatus* status,
57+
const GauXCShell* shells,
58+
size_t nshells,
59+
bool normalize
60+
);
61+
62+
/**
63+
* @brief Delete a BasisSet instance.
64+
* @param status Status object to capture any errors.
65+
* @param basis Handle to the BasisSet to delete.
66+
*/
67+
extern void gauxc_basisset_delete( GauXCStatus* status, GauXCBasisSet* basis );
68+
69+
#ifdef __cplusplus
70+
} // namespace GauXC::C
71+
} // extern "C"
72+
#endif

include/gauxc/c/enums.h

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/**
2+
* GauXC Copyright (c) 2020-2024, The Regents of the University of California,
3+
* through Lawrence Berkeley National Laboratory (subject to receipt of
4+
* any required approvals from the U.S. Dept. of Energy).
5+
*
6+
* (c) 2024-2025, Microsoft Corporation
7+
*
8+
* All rights reserved.
9+
*
10+
* See LICENSE.txt for details
11+
*/
12+
#pragma once
13+
14+
#ifdef __cplusplus
15+
extern "C" {
16+
namespace GauXC::C {
17+
#endif
18+
19+
/**
20+
* @brief GauXC specific enums for the specification of radial quadratures
21+
*
22+
* Generally mapped to equivalent enums in IntegratorXX
23+
*/
24+
enum GauXC_RadialQuad {
25+
GauXC_RadialQuad_Becke, ///< Becke radial quadrature
26+
GauXC_RadialQuad_MuraKnowles, ///< Mura-Knowles radial quadrature
27+
GauXC_RadialQuad_MurrayHandyLaming, ///< Murray-Handy-Laming radial quadrature
28+
GauXC_RadialQuad_TreutlerAhlrichs ///< Treutler-Ahlrichs radial quadrature
29+
};
30+
31+
/**
32+
* @brief Specifications of grid defaults for atomic integration
33+
*
34+
* See https://gaussian.com/integral for specification
35+
*/
36+
enum GauXC_AtomicGridSizeDefault {
37+
GauXC_AtomicGridSizeDefault_FineGrid, ///< Fine grid (least accurate)
38+
GauXC_AtomicGridSizeDefault_UltraFineGrid, ///< Ultrafine grid (appropriate accuracy)
39+
GauXC_AtomicGridSizeDefault_SuperFineGrid, ///< Superfine grid (most accurate)
40+
GauXC_AtomicGridSizeDefault_GM3, ///< Treutler-Ahlrichs GM3
41+
GauXC_AtomicGridSizeDefault_GM5, ///< Treutler-Ahlrichs GM5
42+
GauXC_AtomicGridSizeDefault_PySCF0, ///< PySCF default level 0
43+
GauXC_AtomicGridSizeDefault_PySCF1, ///< PySCF default level 1
44+
GauXC_AtomicGridSizeDefault_PySCF2, ///< PySCF default level 2 (angular points ~ fine grid)
45+
GauXC_AtomicGridSizeDefault_PySCF3, ///< PySCF default level 3
46+
GauXC_AtomicGridSizeDefault_PySCF4, ///< PySCF default level 4 (radial points ~ fine grid, angular points ~ ultrafine grid)
47+
GauXC_AtomicGridSizeDefault_PySCF5, ///< PySCF default level 5
48+
GauXC_AtomicGridSizeDefault_PySCF6, ///< PySCF default level 6 (radial points ~ ultrafine grid, angular points ~ superfine grid)
49+
GauXC_AtomicGridSizeDefault_PySCF7, ///< PySCF default level 7
50+
GauXC_AtomicGridSizeDefault_PySCF8, ///< PySCF default level 8
51+
GauXC_AtomicGridSizeDefault_PySCF9 ///< PySCF default level 9 (radial points ~ superfine grid)
52+
};
53+
54+
/**
55+
* @brief Specifications of atomic partitioning scheme for the
56+
* molecular integration
57+
*/
58+
enum GauXC_XCWeightAlg {
59+
GauXC_XCWeightAlg_NOTPARTITIONED, ///< Not partitioned
60+
GauXC_XCWeightAlg_Becke, ///< The original Becke weighting scheme
61+
GauXC_XCWeightAlg_SSF, ///< The Stratmann-Scuseria-Frisch weighting scheme
62+
GauXC_XCWeightAlg_LKO ///< The Lauqua-Kuessman-Ochsenfeld weighting scheme
63+
};
64+
65+
/**
66+
* @brief Specification of the execution space for various operations
67+
*/
68+
enum GauXC_ExecutionSpace {
69+
GauXC_ExecutionSpace_Host, ///< Execute task on the host
70+
GauXC_ExecutionSpace_Device ///< Execute task on the device (e.g. GPU)
71+
};
72+
73+
/// Supported Algorithms / Integrands
74+
enum GauXC_SupportedAlg {
75+
GauXC_SupportedAlg_XC, ///< Exchange-correlation integration
76+
GauXC_SupportedAlg_DEN, ///< Density integration
77+
GauXC_SupportedAlg_SNLINK ///< Seminumerical Coulomb/exchange (snLinK)
78+
};
79+
80+
/// High-level specification of pruning schemes for atomic quadratures
81+
enum GauXC_PruningScheme {
82+
GauXC_PruningScheme_Unpruned, ///< Unpruned atomic quadrature
83+
GauXC_PruningScheme_Robust, ///< The "Robust" scheme of Psi4
84+
GauXC_PruningScheme_Treutler ///< The Treutler-Ahlrichs scheme
85+
};
86+
87+
88+
#ifdef __cplusplus
89+
} // namespace GauXC::C
90+
} // extern "C"
91+
#endif

0 commit comments

Comments
 (0)