Skip to content

Commit 3da5ff2

Browse files
author
Sichao Xiong
committed
Changed sym_pos=True to assume_a='pos' to solve compatibility issues with lastest SciPy (1.11.0) linalg.solve
1 parent 4850981 commit 3da5ff2

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

pyscf/df/grad/rhf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def get_j(mf_grad, mol=None, dm=None, hermi=0):
244244

245245
# (P|Q)
246246
int2c = auxmol.intor('int2c2e', aosym='s1')
247-
rhoj = scipy.linalg.solve(int2c, rhoj.T, sym_pos=True).T
247+
rhoj = scipy.linalg.solve(int2c, rhoj.T, assume_a='pos').T
248248
int2c = None
249249

250250
# (d/dX i,j|P)

pyscf/lib/linalg_helper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,7 @@ def cho_solve(a, b, strict_sym_pos=True):
14611461
on matrix a
14621462
'''
14631463
try:
1464-
return scipy.linalg.solve(a, b, sym_pos=True)
1464+
return scipy.linalg.solve(a, b, assume_a='pos')
14651465
except numpy.linalg.LinAlgError:
14661466
if strict_sym_pos:
14671467
raise

pyscf/mcscf/avas.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def _kernel(avas_obj):
131131
s2 = pmol.intor_symmetric('int1e_ovlp')[baslst][:,baslst]
132132
s21 = gto.intor_cross('int1e_ovlp', pmol, mol)[baslst]
133133
s21 = numpy.dot(s21, mo_coeff[:, ncore:])
134-
sa = s21.T.dot(scipy.linalg.solve(s2, s21, sym_pos=True))
134+
sa = s21.T.dot(scipy.linalg.solve(s2, s21, assume_a='pos'))
135135

136136
threshold = avas_obj.threshold
137137
if avas_obj.openshell_option == 2:

pyscf/mp/mp2f12_slow.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def find_cabs(mol, auxmol, lindep=1e-8):
4343
nao = mol.nao_nr()
4444
s = cabs_mol.intor_symmetric('int1e_ovlp')
4545

46-
ls12 = scipy.linalg.solve(s[:nao,:nao], s[:nao,nao:], sym_pos=True)
46+
ls12 = scipy.linalg.solve(s[:nao,:nao], s[:nao,nao:], assume_a='pos')
4747
s[nao:,nao:] -= s[nao:,:nao].dot(ls12)
4848
w, v = scipy.linalg.eigh(s[nao:,nao:])
4949
c2 = v[:,w>lindep]/numpy.sqrt(w[w>lindep])

pyscf/pbc/scf/addons.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ def project_mo_nr2nr(cell1, mo1, cell2, kpts=None):
4848
s22 = cell2.pbc_intor('int1e_ovlp', hermi=1, kpts=kpts)
4949
s21 = pbcgto.intor_cross('int1e_ovlp', cell2, cell1, kpts=kpts)
5050
if kpts is None or numpy.shape(kpts) == (3,): # A single k-point
51-
return scipy.linalg.solve(s22, s21.dot(mo1), sym_pos=True)
51+
return scipy.linalg.solve(s22, s21.dot(mo1), assume_a='pos')
5252
else:
5353
assert (len(kpts) == len(mo1))
54-
return [scipy.linalg.solve(s22[k], s21[k].dot(mo1[k]), sym_pos=True)
54+
return [scipy.linalg.solve(s22[k], s21[k].dot(mo1[k]), assume_a='pos')
5555
for k, kpt in enumerate(kpts)]
5656

5757

0 commit comments

Comments
 (0)