31 double **overlap_up,
int *cart_size_down,
int *cart_size_up);
41 double *point_3d,
double **grad) {
44 int buf_size = cart_size_A * cart_size_B;
49 for (
int icoord = 0; icoord < 3; icoord++) {
50 memset(grad[icoord], 0,
sizeof(
double) * buf_size);
92 double *overlap_down = NULL;
93 double *overlap_up = NULL;
94 int cart_size_down = 0;
98 &overlap_up, &cart_size_down,
105 for (
int icoord = 0; icoord < 3; icoord++) {
107 for (
int j = 0; j < shell_B->
cart_size; j++) {
110 int *ket_nlm = shell_B->
cart_list + 3 * j;
116 if (shell_A->
L > 0) {
117 bra_nlm[icoord] -= 1;
120 bra_nlm[icoord] += 1;
122 grad[icoord][index] -=
123 factor * bra_nlm[icoord] *
124 overlap_down[shell_B->
cart_size * bra_index + ket_index];
130 bra_nlm[icoord] += 1;
133 bra_nlm[icoord] -= 1;
135 grad[icoord][index] +=
136 factor * overlap_up[shell_B->
cart_size * bra_index + ket_index];
158 double **overlap_up,
int *cart_size_down,
int *cart_size_up) {
167 if (shell_A_down != NULL) {
168 *cart_size_down = shell_A_down->
cart_size;
176 if (shell_A_down != NULL) {
177 *overlap_down = (
double *)calloc(
181 *overlap_down = NULL;
211 int cart_size = (L + 1) * (L + 2) / 2;
215 for (index = 0; index < cart_size; index++) {
216 if (cart_list[3 * index + 0] == n && cart_list[3 * index + 1] == l &&
217 cart_list[3 * index + 2] == m) {
static void const int const int i
void libgrpp_differentiate_shell(libgrpp_shell_t *shell, libgrpp_shell_t **shell_minus, libgrpp_shell_t **shell_plus)
void libgrpp_overlap_integrals(libgrpp_shell_t *shell_A, libgrpp_shell_t *shell_B, double *overlap_matrix)
static void overlap_gradient_diff_bra_overlap_integrals(libgrpp_shell_t *shell_A, libgrpp_shell_t *shell_B, double **overlap_down, double **overlap_up, int *cart_size_down, int *cart_size_up)
static void overlap_gradient_diff_bra_contribution(libgrpp_shell_t *shell_A, libgrpp_shell_t *shell_B, double **grad, double factor)
int nlm_to_linear(int *nlm)
int libgrpp_nlm_to_linear(int *nlm)
void libgrpp_overlap_integrals_gradient(libgrpp_shell_t *shell_A, libgrpp_shell_t *shell_B, double *point_3d, double **grad)
int libgrpp_get_shell_size(libgrpp_shell_t *shell)
void libgrpp_delete_shell(libgrpp_shell_t *shell)
int * libgrpp_generate_shell_cartesians(int L)
int points_are_equal(double *a, double *b)