Potential#
- group Potential
Functions
- cuestStatus_t cuestPotentialCompute(
- cuestHandle_t handle,
- const cuestOEIntPlan_t plan,
- const cuestPotentialComputeParameters_t parameters,
- cuestWorkspace_t *temporaryWorkspace,
- uint64_t numCharges,
- const double *xyz,
- const double *q,
- double *outVMatrix
Compute the atomic orbital nuclear attraction (potential energy) matrix (V) for given point charges.
This function computes the AO potential energy matrix for a set of point charges (typically nuclei) as:
\[ V_{pq} = \sum_{A} q_A * \left< p \left| \frac{1}{|r - R_A|} \right| q \right> \]All input arrays must be preallocated and valid.The
xyzarray has sizenumCharges× 3 (row major order: \( [x_0, y_0, z_0, x_1, y_1, z_1, ...] \) ).The
qarray has lengthnumCharges.The output buffer
outVMatrixmust be preallocated for (nao × nao) doubles. Temporary workspace must be preallocated using the requirements fromcuestPotentialComputeWorkspaceQuery.
Note:
The potential is evaluated with a positive unit test charge. To obtain nuclear attraction integrals, the
qarray could have negative entries. Alternatively, theqarray could have positive entries and the result scaled by the charge of an electron (i.e. -1 in atomic units).
- Parameters:
handle – [in] cuEST handle. Must not be NULL.
plan – [in] One-electron integral computation plan (opaque handle). Must not be NULL.
parameters – [in] Compute parameters (
cuestPotentialComputeParameters_t). Must not be NULLtemporaryWorkspace – [in] Temporary workspace buffers, preallocated as required. Must not be NULL.
numCharges – [in] Number of point charges (must be greater than zero).
xyz – [in] Array of charge coordinates (size:
numCharges× 3) in atomic units on GPU. Must not be NULL.q – [in] Array of charge magnitudes (size:
numCharges) on GPU. Must not be NULL.outVMatrix – [out] Output AO potential matrix buffer (size: nao × nao) on GPU. Must not be NULL. Elements of this array are overwritten by the calculation results.
- Returns:
CUEST_STATUS_SUCCESSon success;CUEST_STATUS_INVALID_HANDLEif the cuEST handle is NULL;CUEST_STATUS_NULL_POINTERif any required pointer is NULL;CUEST_STATUS_INVALID_TYPEif opaque handles are not the correct type.CUEST_STATUS_INVALID_ARGUMENTifnumChargesis zero;CUEST_STATUS_EXCEPTIONorCUEST_STATUS_UNKNOWN_ERRORotherwise.
- cuestStatus_t cuestPotentialComputeWorkspaceQuery(
- cuestHandle_t handle,
- const cuestOEIntPlan_t plan,
- const cuestPotentialComputeParameters_t parameters,
- cuestWorkspaceDescriptor_t *temporaryWorkspaceDescriptor,
- uint64_t numCharges,
- const double *xyz,
- const double *q,
- double *outVMatrix
Query the temporary workspace required (in bytes) for a potential energy matrix calculation.
This function calculates the workflow required for a potential energy matrix evaluation, returning host/device workspace buffer sizes in the output descriptor. The user arrays
q,xyz, andoutVMatrixmay be NULL; only sizes are computed. All pointer parameters must be valid, andnumChargesmust be greater than zero.- Parameters:
handle – [in] cuEST handle. Must not be NULL.
plan – [in] One-electron integral computation plan (opaque handle). Must not be NULL.
parameters – [in] Compute parameters (
cuestPotentialComputeParameters_t). Must not be NULLtemporaryWorkspaceDescriptor – [out] Output descriptor for temporary workspace sizes (host and device). Must not be NULL.
numCharges – [in] Number of point charges (must be greater than zero.).
xyz – [in] Optional array of charge coordinates (may be NULL).
q – [in] Optional array of charge magnitudes (may be NULL).
outVMatrix – [in] Optional output AO potential matrix buffer (may be NULL).
- Returns:
CUEST_STATUS_SUCCESSon success;CUEST_STATUS_INVALID_HANDLEif the cuEST handle is NULL;CUEST_STATUS_NULL_POINTERif any required pointer is NULL;CUEST_STATUS_INVALID_TYPEif opaque handles are not the correct type.CUEST_STATUS_INVALID_ARGUMENTifnumChargesis zero;CUEST_STATUS_EXCEPTIONorCUEST_STATUS_UNKNOWN_ERRORotherwise.
- group PotentialGrad
Functions
- cuestStatus_t cuestPotentialDerivativeCompute(
- cuestHandle_t handle,
- const cuestOEIntPlan_t plan,
- const cuestPotentialDerivativeComputeParameters_t parameters,
- cuestWorkspace_t *temporaryWorkspace,
- uint64_t numCharges,
- const double *xyz,
- const double *q,
- const double *densityMatrix,
- double *outBasisGradient,
- double *outChargeGradient
Compute the potential integral derivatives with respect to atomic and charge coordinates, contracted with a density matrix.
This routine evaluates the derivative of the potential integrals and contracts the result with a density matrix in the AO basis. The resulting gradient is returned both with respect to the AO basis functions and with respect to the point-charge coordinates. All required temporary workspace must be sized and allocated using the corresponding workspace query function.
The user must provide:
A preallocated/populated density matrix of size (nao × nao).
A list of point charges and their Cartesian coordinates.
Preallocated output buffers for the AO basis gradients and charge gradients (to be overwritten).
- Parameters:
handle – [in] cuEST handle. Must not be NULL.
plan – [in] One-electron integral computation plan (opaque handle). Must not be NULL.
parameters – [in] Compute parameters (
cuestPotentialDerivativeComputeParameters_t). Must not be NULLtemporaryWorkspace – [in] Temporary workspace buffers (preallocated for this operation). Must not be NULL.
numCharges – [in] Number of point charges. Must be greater than zero.
xyz – [in] Cartesian coordinates of the point charges (size:
numCharges× 3, in row-major order) on GPU. Must not be NULL.q – [in] Point charges (size:
numCharges) on GPU. Must not be NULL.densityMatrix – [in] Input density matrix (size: nao × nao) on GPU. Must not be NULL.
outBasisGradient – [out] Output gradient with respect to AO basis centers (size: natom × 3) on GPU. Must not be NULL. Elements of this array are overwritten by the calculation results.
outChargeGradient – [out] Output gradient with respect to the point-charge coordinates (size:
numCharges× 3) on GPU. Must not be NULL. Elements of this array are overwritten by the calculation results.
- Returns:
CUEST_STATUS_SUCCESSon success;CUEST_STATUS_INVALID_HANDLEif the cuEST handle is NULL;CUEST_STATUS_NULL_POINTERif any required pointer is NULL;CUEST_STATUS_INVALID_TYPEif opaque handles are not the correct type.CUEST_STATUS_INVALID_ARGUMENTifnumChargesis zero;CUEST_STATUS_EXCEPTIONorCUEST_STATUS_UNKNOWN_ERRORotherwise.
- cuestStatus_t cuestPotentialDerivativeComputeWorkspaceQuery(
- cuestHandle_t handle,
- const cuestOEIntPlan_t plan,
- const cuestPotentialDerivativeComputeParameters_t parameters,
- cuestWorkspaceDescriptor_t *temporaryWorkspaceDescriptor,
- uint64_t numCharges,
- const double *xyz,
- const double *q,
- const double *densityMatrix,
- double *outBasisGradient,
- double *outChargeGradient
Query the temporary workspace required to compute the potential integral derivatives with respect to atomic and charge coordinates, contracted with a density matrix.
This function determines the workspace required for a potential derivative evaluation with a given plan and point-charge specification. The output descriptor is filled on success and can be used to allocate host and device workspace buffers prior to calling
cuestPotentialDerivativeCompute.The density matrix and output gradient pointers are optional and may be NULL.
- Parameters:
handle – [in] cuEST handle. Must not be NULL.
plan – [in] One-electron integral computation plan (opaque handle). Must not be NULL.
parameters – [in] Compute parameters (
cuestPotentialDerivativeComputeParameters_t). Must not be NULLtemporaryWorkspaceDescriptor – [out] Output descriptor for temporary workspace sizes (host and device). Must not be NULL.
numCharges – [in] Number of point charges. Must be greater than zero.
xyz – [in] Optional Cartesian coordinates of the point charges. May be NULL.
q – [in] Optional point charges. May be NULL.
densityMatrix – [in] Optional density matrix. May be NULL.
outBasisGradient – [in] Optional output gradient buffer with respect to AO basis centers. May be NULL.
outChargeGradient – [in] Optional output gradient buffer with respect to the point-charge coordinates. May be NULL.
- Returns:
CUEST_STATUS_SUCCESSon success;CUEST_STATUS_INVALID_HANDLEif the cuEST handle is NULL;CUEST_STATUS_NULL_POINTERif any required pointer is NULL;CUEST_STATUS_INVALID_TYPEif opaque handles are not the correct type.CUEST_STATUS_INVALID_ARGUMENTifnumChargesis zero;CUEST_STATUS_EXCEPTIONorCUEST_STATUS_UNKNOWN_ERRORotherwise.