diff --git a/pyscf/df/incore.py b/pyscf/df/incore.py index 34e92b953b..7147d74646 100644 --- a/pyscf/df/incore.py +++ b/pyscf/df/incore.py @@ -133,7 +133,7 @@ def cholesky_eri(mol, auxbasis='weigend+etb', auxmol=None, low = _eig_decompose(mol, j2c, lindep) decompose_j2c = 'eig' j2c = None - naoaux, naux = low.shape + naux, naoaux = low.shape log.debug('size of aux basis %d', naux) log.timer_debug1('2c2e', *t0) diff --git a/pyscf/df/lrdf.py b/pyscf/df/lrdf.py index e7cbd6e00d..6dd6e1f19e 100644 --- a/pyscf/df/lrdf.py +++ b/pyscf/df/lrdf.py @@ -324,8 +324,8 @@ def _angular_grids_legendre2d(n): xs, wt = scipy.special.roots_legendre(m) phi, wp = scipy.special.roots_legendre(m) theta = np.arccos(xs) + phi += 1. phi *= np.pi - phi += np.pi wp *= np.pi x = np.sin(theta[:,None]) * np.cos(phi) y = np.sin(theta[:,None]) * np.sin(phi) diff --git a/pyscf/lib/vhf/nr_direct_dot.c b/pyscf/lib/vhf/nr_direct_dot.c index 7eb70103ff..1c3972d3ee 100644 --- a/pyscf/lib/vhf/nr_direct_dot.c +++ b/pyscf/lib/vhf/nr_direct_dot.c @@ -97,7 +97,7 @@ void JKOperator_write_back(double *vjk, JKArray *jkarray, int *ao_loc, j0 = ao_loc[jsh]; di = ao_loc[ish+1] - i0; dj = ao_loc[jsh+1] - j0; - pd = data + (i0 - block_i0) * block_dj + (j0 - block_j0) * di; + pd = data + ((i0 - block_i0) * block_dj + (j0 - block_j0) * di) * ncomp; pv = vjk + i0*vcol+j0 - voffset; for (icomp = 0; icomp < ncomp; icomp++) { for (i = 0; i < di; i++) { @@ -190,7 +190,7 @@ static void JKOperator_sanity_check_s8(int *shls_slice) out->key_counts++; \ } \ double *v = out->data + *_poutptr; \ - v += (i##0-ao_off[i##SH]) * shape[j##SH] + (j##0-ao_off[j##SH]) * d##i; + v += ((i##0-ao_off[i##SH]) * shape[j##SH] + (j##0-ao_off[j##SH]) * d##i) * ncomp; #define DECLARE(v, i, j) \ int ncomp = out->ncomp; \