-
Notifications
You must be signed in to change notification settings - Fork 31
Basic C API for GauXC #172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
awvwgk
wants to merge
1
commit into
wavefunction91:master
Choose a base branch
from
awvwgk:c-api
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /** | ||
| * GauXC Copyright (c) 2020-2024, The Regents of the University of California, | ||
| * through Lawrence Berkeley National Laboratory (subject to receipt of | ||
| * any required approvals from the U.S. Dept. of Energy). | ||
| * | ||
| * (c) 2024-2025, Microsoft Corporation | ||
| * | ||
| * All rights reserved. | ||
| * | ||
| * See LICENSE.txt for details | ||
| */ | ||
| #pragma once | ||
|
|
||
| #ifdef __cplusplus | ||
| #include <cstdint> | ||
| #include <cstdbool> | ||
| #include <cstddef> | ||
| #else | ||
| #include <stdint.h> | ||
| #include <stdbool.h> | ||
| #include <stddef.h> | ||
| #endif | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| namespace GauXC::C { | ||
| #endif | ||
|
|
||
| /** | ||
| * @brief GauXC C API Atom representation. | ||
| */ | ||
| typedef struct GauXCAtom { | ||
| int64_t Z; ///< Atomic number. | ||
| double x; ///< X coordinate (Bohr). | ||
| double y; ///< Y coordinate (Bohr). | ||
| double z; ///< Z coordinate (Bohr). | ||
| } GauXCAtom; | ||
|
|
||
| #ifdef __cplusplus | ||
| } // namespace GauXC::C | ||
| } // extern "C" | ||
| #endif |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| /** | ||
| * GauXC Copyright (c) 2020-2024, The Regents of the University of California, | ||
| * through Lawrence Berkeley National Laboratory (subject to receipt of | ||
| * any required approvals from the U.S. Dept. of Energy). | ||
| * | ||
| * (c) 2024-2025, Microsoft Corporation | ||
| * | ||
| * All rights reserved. | ||
| * | ||
| * See LICENSE.txt for details | ||
| */ | ||
| #pragma once | ||
|
|
||
| #ifdef __cplusplus | ||
| #include <cstdint> | ||
| #include <cstdbool> | ||
| #include <cstddef> | ||
| #else | ||
| #include <stdint.h> | ||
| #include <stdbool.h> | ||
| #include <stddef.h> | ||
| #endif | ||
| #include <gauxc/types.h> | ||
| #include <gauxc/status.h> | ||
| #include <gauxc/shell.h> | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| namespace GauXC::C { | ||
| #endif | ||
|
|
||
| /** | ||
| * @brief GauXC C API BasisSet handle. | ||
| */ | ||
| typedef struct GauXCBasisSet { | ||
| GauXCHeader hdr; ///< Header for internal use. | ||
| void* ptr; ///< Pointer to the BasisSet instance. | ||
| } GauXCBasisSet; | ||
|
|
||
| /** | ||
| * @brief Create a new BasisSet instance. | ||
| * @param status Status object to capture any errors. | ||
| * @return Handle to the created BasisSet. | ||
| */ | ||
| extern GauXCBasisSet gauxc_basisset_new( GauXCStatus* status ); | ||
|
|
||
| /** | ||
| * @brief Create a new BasisSet instance from arrays of shells. | ||
| * @param status Status object to capture any errors. | ||
| * @param shells Pointer to an array of GauXCShell. | ||
| * @param nshells Number of shells in the array. | ||
| * @param normalize Whether to normalize the basis functions. | ||
| * @return Handle to the created BasisSet. | ||
| */ | ||
| extern GauXCBasisSet gauxc_basisset_new_from_shells( | ||
| GauXCStatus* status, | ||
| GauXCShell* shells, | ||
| size_t nshells, | ||
| bool normalize | ||
| ); | ||
|
|
||
| /** | ||
| * @brief Delete a BasisSet instance. | ||
| * @param status Status object to capture any errors. | ||
| * @param basis Handle to the BasisSet to delete. | ||
| */ | ||
| extern void gauxc_basisset_delete( GauXCStatus* status, GauXCBasisSet* basis ); | ||
|
|
||
| #ifdef __cplusplus | ||
| } // namespace GauXC::C | ||
| } // extern "C" | ||
| #endif |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| /** | ||
| * GauXC Copyright (c) 2020-2024, The Regents of the University of California, | ||
| * through Lawrence Berkeley National Laboratory (subject to receipt of | ||
| * any required approvals from the U.S. Dept. of Energy). | ||
| * | ||
| * (c) 2024-2025, Microsoft Corporation | ||
| * | ||
| * All rights reserved. | ||
| * | ||
| * See LICENSE.txt for details | ||
| */ | ||
| #pragma once | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| namespace GauXC::C { | ||
| #endif | ||
|
|
||
| /** | ||
| * @brief GauXC specific enums for the specification of radial quadratures | ||
| * | ||
| * Generally mapped to equivalent enums in IntegratorXX | ||
| */ | ||
| enum GauXC_RadialQuad { | ||
| GauXC_RadialQuad_Becke, ///< Becke radial quadrature | ||
| GauXC_RadialQuad_MuraKnowles, ///< Mura-Knowles radial quadrature | ||
| GauXC_RadialQuad_MurrayHandyLaming, ///< Murray-Handy-Laming radial quadrature | ||
| GauXC_RadialQuad_TreutlerAhlrichs ///< Treutler-Ahlrichs radial quadrature | ||
| }; | ||
|
|
||
| /** | ||
| * @brief Specifications of grid defaults for atomic integration | ||
| * | ||
| * See https://gaussian.com/integral for specification | ||
| */ | ||
| enum GauXC_AtomicGridSizeDefault { | ||
| GauXC_AtomicGridSizeDefault_FineGrid, ///< Fine grid (least accurate) | ||
| GauXC_AtomicGridSizeDefault_UltraFineGrid, ///< Ultrafine grid (appropriate accuracy) | ||
| GauXC_AtomicGridSizeDefault_SuperFineGrid, ///< Superfine grid (most accurate) | ||
| GauXC_AtomicGridSizeDefault_GM3, ///< Treutler-Ahlrichs GM3 | ||
| GauXC_AtomicGridSizeDefault_GM5 ///< Treutlet-Ahlrichs GM5 | ||
| }; | ||
|
|
||
| /** | ||
| * @brief Specifications of atomic partitioning scheme for the | ||
| * molecular integration | ||
| */ | ||
| enum GauXC_XCWeightAlg { | ||
| GauXC_XCWeightAlg_NOTPARTITIONED, ///< Not partitioned | ||
| GauXC_XCWeightAlg_Becke, ///< The original Becke weighting scheme | ||
| GauXC_XCWeightAlg_SSF, ///< The Stratmann-Scuseria-Frisch weighting scheme | ||
| GauXC_XCWeightAlg_LKO ///< The Lauqua-Kuessman-Ochsenfeld weighting scheme | ||
| }; | ||
|
|
||
| /** | ||
| * @brief Specification of the execution space for various operations | ||
| */ | ||
| enum GauXC_ExecutionSpace { | ||
| GauXC_ExecutionSpace_Host, ///< Execute task on the host | ||
| GauXC_ExecutionSpace_Device ///< Execute task on the device (e.g. GPU) | ||
| }; | ||
|
|
||
| /// Supported Algorithms / Integrands | ||
| enum GauXC_SupportedAlg { | ||
| GauXC_SupportedAlg_XC, | ||
| GauXC_SupportedAlg_DEN, | ||
| GauXC_SupportedAlg_SNLINK | ||
| }; | ||
|
|
||
| /// High-level specification of pruning schemes for atomic quadratures | ||
| enum GauXC_PruningScheme { | ||
| GauXC_PruningScheme_Unpruned, ///< Unpruned atomic quadrature | ||
| GauXC_PruningScheme_Robust, ///< The "Robust" scheme of Psi4 | ||
| GauXC_PruningScheme_Treutler ///< The Treutler-Ahlrichs scheme | ||
| }; | ||
|
|
||
|
|
||
| #ifdef __cplusplus | ||
| } // namespace GauXC::C | ||
| } // extern "C" | ||
| #endif | ||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.