Potential#
- cuest.bindings.cuestPotentialComputeWorkspaceQuery(
- *,
- handle: cuest.bindings.cuest.cuestHandle,
- plan: cuest.bindings.cuest.cuestOEIntPlanHandle,
- parameters: cuest.bindings.cuest.Parameters,
- temporaryWorkspaceDescriptor: int,
- numCharges: int,
- xyz: cuest.bindings.cuest.Pointer,
- q: cuest.bindings.cuest.Pointer,
- outVMatrix: cuest.bindings.cuest.Pointer,
Query the temporary workspace required (in bytes) for a potential energy matrix calculation.
This function calculates the workspace 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.numChargesmust be greater than zero.Kernel and precision selection. This routine can use JIT-compiled kernels and/or reduced-precision “ffloat” compute, selected through the compute parameters:
CUEST_POTENTIALCOMPUTE_PARAMETERS_JIT_USAGE_MODE(cuestJITUsageMode_t):CUEST_JIT_USAGE_MODE_ONuses JIT-compiled kernels,CUEST_JIT_USAGE_MODE_OFFuses AOT-compiled kernels. JIT-compiled kernels are only available in the cuEST CUDA 13 package; the default isCUEST_JIT_USAGE_MODE_ONin the cuEST CUDA 13 package andCUEST_JIT_USAGE_MODE_OFFin the cuEST CUDA 12 package. RequestingCUEST_JIT_USAGE_MODE_ONwith the cuEST CUDA 12 package returnsCUEST_STATUS_INVALID_ARGUMENT.CUEST_POTENTIALCOMPUTE_PARAMETERS_FFLOAT_USAGE_MODE(cuestFfloatUsageMode_t) selects the compute precision:CUEST_FFLOAT_USAGE_MODE_ONrequests ffloat compute,CUEST_FFLOAT_USAGE_MODE_OFFrequests fp64 compute, andCUEST_FFLOAT_USAGE_MODE_DEFAULTrequests ffloat compute when it is expected to provide a performance advantage on the present GPU architecture.ffloat compute is only compatible with JIT-compiled kernels. Requesting ffloat compute while JIT is disabled (
CUEST_FFLOAT_USAGE_MODE_ONtogether withCUEST_JIT_USAGE_MODE_OFF) is not supported and returnsCUEST_STATUS_INVALID_ARGUMENT.
Parameters#
- handle[in]cuestHandle
cuEST handle. Must not be NULL.
- plan[in]cuestOEIntPlanHandle
One-electron integral computation plan (opaque handle). Must not be NULL.
- parameters[in]cuestPotentialComputeParameters_t
Parameters object. Must not be NULL.
- temporaryWorkspaceDescriptor[out]WorkspaceDescriptor
Output descriptor for temporary workspace sizes. Must not be NULL.
- numCharges[in]int
Number of point charges (must be greater than zero.).
- xyzPointer
Optional array of charge coordinates. May be NULL.
- qPointer
Optional array of charge magnitudes. May be NULL.
- outVMatrixPointer
Optional output AO potential matrix buffer. May be NULL.
Returns#
- status[out]cuestStatus_t
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_INVALID_ARGUMENTif a parameter value is invalid, if JIT-compiled kernels are requested with the cuEST CUDA 12 package, or if ffloat compute is requested while JIT is disabled (incompatible JIT/ffloat combination);CUEST_STATUS_EXCEPTIONorCUEST_STATUS_UNKNOWN_ERRORotherwise.
- cuest.bindings.cuestPotentialCompute(
- *,
- handle: cuest.bindings.cuest.cuestHandle,
- plan: cuest.bindings.cuest.cuestOEIntPlanHandle,
- parameters: cuest.bindings.cuest.Parameters,
- temporaryWorkspace: int,
- numCharges: int,
- xyz: cuest.bindings.cuest.Pointer,
- q: cuest.bindings.cuest.Pointer,
- outVMatrix: cuest.bindings.cuest.Pointer,
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 \cdot \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 from
cuestPotentialComputeWorkspaceQuery().Kernel and precision selection. This routine can use JIT-compiled kernels and/or reduced-precision “ffloat” compute, selected through the compute parameters:
CUEST_POTENTIALCOMPUTE_PARAMETERS_JIT_USAGE_MODE(cuestJITUsageMode_t):CUEST_JIT_USAGE_MODE_ONuses JIT-compiled kernels,CUEST_JIT_USAGE_MODE_OFFuses AOT-compiled kernels. JIT-compiled kernels are only available in the cuEST CUDA 13 package; the default isCUEST_JIT_USAGE_MODE_ONin the cuEST CUDA 13 package andCUEST_JIT_USAGE_MODE_OFFin the cuEST CUDA 12 package. RequestingCUEST_JIT_USAGE_MODE_ONwith the cuEST CUDA 12 package returnsCUEST_STATUS_INVALID_ARGUMENT.CUEST_POTENTIALCOMPUTE_PARAMETERS_FFLOAT_USAGE_MODE(cuestFfloatUsageMode_t) selects the compute precision:CUEST_FFLOAT_USAGE_MODE_ONrequests ffloat compute,CUEST_FFLOAT_USAGE_MODE_OFFrequests fp64 compute, andCUEST_FFLOAT_USAGE_MODE_DEFAULTrequests ffloat compute when it is expected to provide a performance advantage on the present GPU architecture.ffloat compute is only compatible with JIT-compiled kernels. Requesting ffloat compute while JIT is disabled (
CUEST_FFLOAT_USAGE_MODE_ONtogether withCUEST_JIT_USAGE_MODE_OFF) is not supported and returnsCUEST_STATUS_INVALID_ARGUMENT.
Parameters#
- handle[in]cuestHandle
cuEST handle. Must not be NULL.
- plan[in]cuestOEIntPlanHandle
One-electron integral computation plan (opaque handle). Must not be NULL.
- parameters[in]cuestPotentialComputeParameters_t
Parameters object. Must not be NULL.
- temporaryWorkspace[in]Workspace
Temporary workspace buffers (preallocated for this operation). Must not be NULL.
- numCharges[in]int
Number of point charges (must be greater than zero.).
- xyz[in]Pointer
Array of charge coordinates in atomic units (size:
numChargesx 3) on the GPU. Must not be NULL.- q[in]Pointer
Array of charge magnitudes (size:
numCharges) on the GPU. Must not be NULL.- outVMatrix[out]Pointer
Output AO potential matrix buffer (size: nao × nao) on the GPU. Must not be NULL. Elements of this array are overwritten by the calculation results.
Returns#
- status[out]cuestStatus_t
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_INVALID_ARGUMENTif a parameter value is invalid, if JIT-compiled kernels are requested with the cuEST CUDA 12 package, or if ffloat compute is requested while JIT is disabled (incompatible JIT/ffloat combination);CUEST_STATUS_EXCEPTIONorCUEST_STATUS_UNKNOWN_ERRORotherwise.
- cuest.bindings.cuestPotentialDerivativeComputeWorkspaceQuery(
- *,
- handle: cuest.bindings.cuest.cuestHandle,
- plan: cuest.bindings.cuest.cuestOEIntPlanHandle,
- parameters: cuest.bindings.cuest.Parameters,
- temporaryWorkspaceDescriptor: int,
- numCharges: int,
- xyz: cuest.bindings.cuest.Pointer,
- q: cuest.bindings.cuest.Pointer,
- densityMatrix: cuest.bindings.cuest.Pointer,
- outBasisGradient: cuest.bindings.cuest.Pointer,
- outChargeGradient: cuest.bindings.cuest.Pointer,
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.
Kernel and precision selection. This routine can use JIT-compiled kernels and/or reduced-precision “ffloat” compute, selected through the compute parameters:
CUEST_POTENTIALDERIVATIVECOMPUTE_PARAMETERS_JIT_USAGE_MODE(cuestJITUsageMode_t):CUEST_JIT_USAGE_MODE_ONuses JIT-compiled kernels,CUEST_JIT_USAGE_MODE_OFFuses AOT-compiled kernels. JIT-compiled kernels are only available in the cuEST CUDA 13 package; the default isCUEST_JIT_USAGE_MODE_ONin the cuEST CUDA 13 package andCUEST_JIT_USAGE_MODE_OFFin the cuEST CUDA 12 package. RequestingCUEST_JIT_USAGE_MODE_ONwith the cuEST CUDA 12 package returnsCUEST_STATUS_INVALID_ARGUMENT.CUEST_POTENTIALDERIVATIVECOMPUTE_PARAMETERS_FFLOAT_USAGE_MODE(cuestFfloatUsageMode_t) selects the compute precision:CUEST_FFLOAT_USAGE_MODE_ONrequests ffloat compute,CUEST_FFLOAT_USAGE_MODE_OFFrequests fp64 compute, andCUEST_FFLOAT_USAGE_MODE_DEFAULTrequests ffloat compute when it is expected to provide a performance advantage on the present GPU architecture.ffloat compute is only compatible with JIT-compiled kernels. Requesting ffloat compute while JIT is disabled (
CUEST_FFLOAT_USAGE_MODE_ONtogether withCUEST_JIT_USAGE_MODE_OFF) is not supported and returnsCUEST_STATUS_INVALID_ARGUMENT.It is recommended to leave
CUEST_FFLOAT_USAGE_MODE_OFFfor general use of the potential derivative.
Parameters#
- handle[in]cuestHandle
cuEST handle. Must not be NULL.
- plan[in]cuestOEIntPlanHandle
One-electron integral computation plan (opaque handle). Must not be NULL.
- parameters[in]cuestPotentialDerivativeComputeParameters_t
Parameters object. Must not be NULL.
- temporaryWorkspaceDescriptor[out]WorkspaceDescriptor
Output descriptor for temporary workspace sizes (host and device). Must not be NULL.
- numCharges[in]int
Number of point charges. Must be greater than zero.
- xyzPointer
Optional Cartesian coordinates of the point charges. May be NULL.
- qPointer
Optional point charges. May be NULL.
- densityMatrixPointer
Optional density matrix. May be NULL.
- outBasisGradientPointer
Optional output gradient buffer with respect to AO basis centers. May be NULL.
- outChargeGradientPointer
Optional output gradient buffer with respect to the point-charge coordinates. May be NULL.
Returns#
- status[out]cuestStatus_t
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_INVALID_ARGUMENTif a parameter value is invalid, if JIT-compiled kernels are requested with the cuEST CUDA 12 package, or if ffloat compute is requested while JIT is disabled (incompatible JIT/ffloat combination);CUEST_STATUS_EXCEPTIONorCUEST_STATUS_UNKNOWN_ERRORotherwise.
- cuest.bindings.cuestPotentialDerivativeCompute(
- *,
- handle: cuest.bindings.cuest.cuestHandle,
- plan: cuest.bindings.cuest.cuestOEIntPlanHandle,
- parameters: cuest.bindings.cuest.Parameters,
- temporaryWorkspace: int,
- numCharges: int,
- xyz: cuest.bindings.cuest.Pointer,
- q: cuest.bindings.cuest.Pointer,
- densityMatrix: cuest.bindings.cuest.Pointer,
- outBasisGradient: cuest.bindings.cuest.Pointer,
- outChargeGradient: cuest.bindings.cuest.Pointer,
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).
Kernel and precision selection. This routine can use JIT-compiled kernels and/or reduced-precision “ffloat” compute, selected through the compute parameters:
CUEST_POTENTIALDERIVATIVECOMPUTE_PARAMETERS_JIT_USAGE_MODE(cuestJITUsageMode_t):CUEST_JIT_USAGE_MODE_ONuses JIT-compiled kernels,CUEST_JIT_USAGE_MODE_OFFuses AOT-compiled kernels. JIT-compiled kernels are only available in the cuEST CUDA 13 package; the default isCUEST_JIT_USAGE_MODE_ONin the cuEST CUDA 13 package andCUEST_JIT_USAGE_MODE_OFFin the cuEST CUDA 12 package. RequestingCUEST_JIT_USAGE_MODE_ONwith the cuEST CUDA 12 package returnsCUEST_STATUS_INVALID_ARGUMENT.CUEST_POTENTIALDERIVATIVECOMPUTE_PARAMETERS_FFLOAT_USAGE_MODE(cuestFfloatUsageMode_t) selects the compute precision:CUEST_FFLOAT_USAGE_MODE_ONrequests ffloat compute,CUEST_FFLOAT_USAGE_MODE_OFFrequests fp64 compute, andCUEST_FFLOAT_USAGE_MODE_DEFAULTrequests ffloat compute when it is expected to provide a performance advantage on the present GPU architecture.ffloat compute is only compatible with JIT-compiled kernels. Requesting ffloat compute while JIT is disabled (
CUEST_FFLOAT_USAGE_MODE_ONtogether withCUEST_JIT_USAGE_MODE_OFF) is not supported and returnsCUEST_STATUS_INVALID_ARGUMENT.It is recommended to leave
CUEST_FFLOAT_USAGE_MODE_OFFfor general use of the potential derivative.
Parameters#
- handle[in]cuestHandle
cuEST handle. Must not be NULL.
- plan[in]cuestOEIntPlanHandle
One-electron integral computation plan (opaque handle). Must not be NULL.
- parameters[in]cuestPotentialDerivativeComputeParameters_t
Parameters object. Must not be NULL.
- temporaryWorkspace[in]Workspace
Temporary workspace buffers (preallocated for this operation). Must not be NULL.
- numCharges[in]int
Number of point charges. Must be greater than zero.
- xyz[in]Pointer
Cartesian coordinates of the point charges (size:
numCharges× 3) on the GPU in row-major order. Must not be NULL.- q[in]Pointer
Point charges (size:
numCharges) on the GPU. Must not be NULL.- densityMatrix[in]Pointer
Input density matrix (size: nao × nao) on the GPU. Must not be NULL.
- outBasisGradient[out]Pointer
Output gradient with respect to AO basis centers (size: natom × 3) on the GPU. Must not be NULL. Elements of this array are overwritten by the calculation results.
- outChargeGradient[out]Pointer
Output gradient with respect to the point-charge coordinates (size:
numCharges× 3) on the GPU. Must not be NULL. Elements of this array are overwritten by the calculation results.
Returns#
- status[out]cuestStatus_t
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_INVALID_ARGUMENTif a parameter value is invalid, if JIT-compiled kernels are requested with the cuEST CUDA 12 package, or if ffloat compute is requested while JIT is disabled (incompatible JIT/ffloat combination);CUEST_STATUS_EXCEPTIONorCUEST_STATUS_UNKNOWN_ERRORotherwise.