Polarizable Continuum Models#
- group PCM
Functions
- cuestStatus_t cuestPCMPotentialCompute(
- cuestHandle_t handle,
- const cuestPCMIntPlan_t plan,
- const cuestPCMPotentialComputeParameters_t parameters,
- cuestWorkspace_t *temporaryWorkspace,
- const double *densityMatrix,
- const double *inQ,
- double *outQ,
- cuestPCMResults_t outPCMResults,
- double *outPCMPotentialMatrix
Compute the PCM potential matrix using preconditioned conjugate gradient (PCG) to solve for the PCM charges.
Guesses are obtained from the
inQmatrix, with the pre-allocatedoutQmatrix used to return the converged charges.Convergence properties are controlled by configuring the
cuestPCMPotentialComputeParameters_tstructure passed as theparametersparameter.The required temporary workspace must be allocated using the sizes returned by
cuestPCMPotentialComputeWorkspaceQuery. The number of points, npoint, can be queried from thecuestPCMIntPlan_tstructure using theCUEST_PCMINTPLAN_NUM_POINTquery and is the sum of thenumAngularPointsPerAtomarray used to create the plan.Note that the return status is
CUEST_STATUS_SUCCESSeven if the PCM charges did not converge within the maximum number of iterations provided by theparameters. The caller should check theconvergedmember of theoutPCMResultshandle to determine if the PCM charges converged.- Parameters:
handle – [in] cuEST handle. Must not be NULL.
plan – [in] PCM integral plan (opaque handle) constructed with
cuestPCMIntPlanCreate. Must not be NULL.parameters – [in] PCM potential compute parameters (opaque handle) constructed with
cuestParametersCreate. Must not be NULL.temporaryWorkspace – [in] Temporary workspace buffer for this operation. Must not be NULL.
densityMatrix – [in] Total (alpha + beta) AO basis density matrix (size: nao × nao) on the GPU. Must not be NULL.
inQ – [in] Input guess Q vector (size: npoint) on the GPU; user should initialize this array to zeros if no guess is available. Must not be NULL.
outQ – [out] Output Q matrix (size: npoint) on the GPU. Must not be NULL. Elements of this array are overwritten by the calculation results.
outPCMResults – [out] PCM results (opaque handle) constructed with
cuestPCMResultsCreate. Elements contained in this handle are overwritten by the calculation results.outPCMPotentialMatrix – [out] Output PCM potential matrix (size: nao × nao) on the GPU. Must not be NULL. Elements of this array are overwritten by the calculation results.
- Returns:
CUEST_STATUS_SUCCESSon success, including the case where the PCM charges did not converge within the maximum number of iterations provided by theparameters;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_ARGUMENTif theparametersare configured to have convergence threshold less than or equal to zero;CUEST_STATUS_EXCEPTIONorCUEST_STATUS_UNKNOWN_ERRORotherwise.
- cuestStatus_t cuestPCMPotentialComputeWorkspaceQuery(
- cuestHandle_t handle,
- const cuestPCMIntPlan_t plan,
- const cuestPCMPotentialComputeParameters_t parameters,
- cuestWorkspaceDescriptor_t *temporaryWorkspaceDescriptor,
- const double *densityMatrix,
- const double *inQ,
- double *outQ,
- cuestPCMResults_t outPCMResults,
- double *outPCMPotentialMatrix
Query the temporary workspace required for a PCM potential computation.
This function calculates the memory required for a PCM potential computation, returning host/device workspace buffer sizes in the output descriptor. The user arrays
densityMatrix,inQ,outQ,outPCMResults, andoutPCMPotentialMatrixmay be NULL. All parameters and object handles must be valid.- Parameters:
handle – [in] cuEST handle. Must not be NULL.
plan – [in] PCM integral plan constructed with
cuestPCMIntPlanCreate. Must not be NULL.parameters – [in] PCM potential compute parameters constructed with
cuestParametersCreate. Must not be NULL.temporaryWorkspaceDescriptor – [out] Output descriptor for temporary workspace sizes. Must not be NULL.
densityMatrix – [in] Density matrix. May be NULL.
inQ – [in] Input Q matrix. May be NULL.
outQ – [in] Output Q matrix. May be NULL.
outPCMResults – [in] PCM results constructed with
cuestPCMResultsCreate. May be NULL.outPCMPotentialMatrix – [in] Output PCM potential matrix. 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_ARGUMENTif theparametersare configured to have convergence threshold less than or equal to zero;CUEST_STATUS_EXCEPTIONorCUEST_STATUS_UNKNOWN_ERRORotherwise.
- cuestStatus_t cuestPCMDerivativeCompute(
- cuestHandle_t handle,
- const cuestPCMIntPlan_t plan,
- const cuestPCMDerivativeComputeParameters_t parameters,
- cuestWorkspace_t *temporaryWorkspace,
- const double *densityMatrix,
- const double *inQ,
- double *outQ,
- cuestPCMResults_t outPCMResults,
- double *outPCMGradient
Compute the PCM nuclear gradient.
This routine computes the derivative of the PCM energy with respect to nuclear coordinates.
Converged surface charges are computed using a preconditioned conjugate gradient (PCG) solver. Convergence behavior is controlled by the
cuestPCMDerivativeComputeParameters_tstructure that is packaged insideparameters. Both maximum iterations and convergence threshold may be tuned based on the specific problem.The required temporary workspace must be allocated using the sizes returned by
cuestPCMDerivativeComputeWorkspaceQuery. The number of points, npoint, can be queried from thecuestPCMIntPlan_tstructure using theCUEST_PCMINTPLAN_NUM_POINTquery, and is the sum of thenumAngularPointsPerAtomarray used to create the plan.It is important to note that the return status is
CUEST_STATUS_SUCCESSeven if the PCM charges did not converge within the maximum number of iterations provided byparameters. The caller should check theconvergedmember of theoutPCMResultshandle to determine whether the PCM charges returned byoutQare converged.In the case where
maxIterations==0, no PCG updates of the charges are performed. The values provided ininQare used to evaluate the PCM gradient, and are copied tooutQon return. In this mode, a residual is still evaluated and reported throughoutPCMResults, but the charges themselves are not modified.Similarly, if the PCG procedure reaches the maximum number of iterations without satisfying the requested convergence threshold, the gradient is still computed using the resulting (partially converged) charges. It is the caller’s responsibility to inspect the convergence information in
outPCMResultsand decide whether the result is acceptable.- Parameters:
handle – [in] cuEST handle. Must not be NULL.
plan – [in] PCM integral plan (opaque handle) constructed with
cuestPCMIntPlanCreate. Must not be NULL.parameters – [in] PCM derivative parameters (opaque handle) constructed with
cuestParametersCreate. Must not be NULL.temporaryWorkspace – [in] Temporary workspace buffer for this operation. Must not be NULL.
densityMatrix – [in] Total (alpha + beta) AO basis density matrix (size: nao × nao) on the GPU. Must not be NULL.
inQ – [in] Input guess charges (size: npoint) on the GPU; user should initialize this array to zeros if no guess is available. Must not be NULL.
outQ – [out] Converged charges (size: npoint) on the GPU. Must not be NULL. Elements of this array are overwritten by the calculation results.
outPCMResults – [out] PCM results (opaque handle) constructed with
cuestPCMResultsCreate. Elements contained in this handle are overwritten by the calculation results.outPCMGradient – [out] Output PCM derivative (size: natoms × 3) on the GPU. Must not be NULL. Elements of this array are overwritten by the calculation results.
- Returns:
CUEST_STATUS_SUCCESSon success, including the case where the PCM charges did not converge within the maximum number of iterations provided by theparameters;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; includingparameters;CUEST_STATUS_INVALID_ARGUMENTif theparametersare configured to have convergence threshold less than or equal to zero;CUEST_STATUS_EXCEPTIONorCUEST_STATUS_UNKNOWN_ERRORotherwise.
- cuestStatus_t cuestPCMDerivativeComputeWorkspaceQuery(
- cuestHandle_t handle,
- const cuestPCMIntPlan_t plan,
- const cuestPCMDerivativeComputeParameters_t parameters,
- cuestWorkspaceDescriptor_t *temporaryWorkspaceDescriptor,
- const double *densityMatrix,
- const double *inQ,
- double *outQ,
- cuestPCMResults_t outPCMResults,
- double *outPCMGradient
Query the temporary workspace required for a PCM gradient computation.
Calculate the memory required for a PCM gradient computation, including the PCG solve for charges, returning host/device workspace buffer sizes in the output descriptor. The user arrays
densityMatrix,inQ,outQ,outPCMResults, andoutPCMGradientmay be NULL. All parameters and object handles must be valid.- Parameters:
handle – [in] cuEST handle. Must not be NULL.
plan – [in] PCM integral plan constructed with
cuestPCMIntPlanCreate. Must not be NULL.parameters – [in] PCM derivative parameters constructed with
cuestParametersCreate. Must not be NULL.temporaryWorkspaceDescriptor – [out] Output descriptor for temporary workspace sizes. Must not be NULL.
densityMatrix – [in] Density matrix. May be NULL.
inQ – [in] Input Q vector. May be NULL.
outQ – [in] Output Q vector. May be NULL.
outPCMResults – [in] PCM results constructed with
cuestPCMResultsCreate. May be NULL.outPCMGradient – [in] Output PCM nuclear gradient. 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; includingparameters;CUEST_STATUS_INVALID_ARGUMENTif theparametersare configured to have convergence threshold less than or equal to zero;CUEST_STATUS_EXCEPTIONorCUEST_STATUS_UNKNOWN_ERRORotherwise.