Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed sym_pos=True to assume_a='pos' to solve compatibility issues … #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyscf/df/grad/rhf.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def get_j(mf_grad, mol=None, dm=None, hermi=0):

# (P|Q)
int2c = auxmol.intor('int2c2e', aosym='s1')
rhoj = scipy.linalg.solve(int2c, rhoj.T, sym_pos=True).T
rhoj = scipy.linalg.solve(int2c, rhoj.T, assume_a='pos').T
int2c = None

# (d/dX i,j|P)
Expand Down
2 changes: 1 addition & 1 deletion pyscf/lib/linalg_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,7 @@ def cho_solve(a, b, strict_sym_pos=True):
on matrix a
'''
try:
return scipy.linalg.solve(a, b, sym_pos=True)
return scipy.linalg.solve(a, b, assume_a='pos')
except numpy.linalg.LinAlgError:
if strict_sym_pos:
raise
Expand Down
2 changes: 1 addition & 1 deletion pyscf/mcscf/avas.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def _kernel(avas_obj):
s2 = pmol.intor_symmetric('int1e_ovlp')[baslst][:,baslst]
s21 = gto.intor_cross('int1e_ovlp', pmol, mol)[baslst]
s21 = numpy.dot(s21, mo_coeff[:, ncore:])
sa = s21.T.dot(scipy.linalg.solve(s2, s21, sym_pos=True))
sa = s21.T.dot(scipy.linalg.solve(s2, s21, assume_a='pos'))

threshold = avas_obj.threshold
if avas_obj.openshell_option == 2:
Expand Down
2 changes: 1 addition & 1 deletion pyscf/mp/mp2f12_slow.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def find_cabs(mol, auxmol, lindep=1e-8):
nao = mol.nao_nr()
s = cabs_mol.intor_symmetric('int1e_ovlp')

ls12 = scipy.linalg.solve(s[:nao,:nao], s[:nao,nao:], sym_pos=True)
ls12 = scipy.linalg.solve(s[:nao,:nao], s[:nao,nao:], assume_a='pos')
s[nao:,nao:] -= s[nao:,:nao].dot(ls12)
w, v = scipy.linalg.eigh(s[nao:,nao:])
c2 = v[:,w>lindep]/numpy.sqrt(w[w>lindep])
Expand Down
4 changes: 2 additions & 2 deletions pyscf/pbc/scf/addons.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ def project_mo_nr2nr(cell1, mo1, cell2, kpts=None):
s22 = cell2.pbc_intor('int1e_ovlp', hermi=1, kpts=kpts)
s21 = pbcgto.intor_cross('int1e_ovlp', cell2, cell1, kpts=kpts)
if kpts is None or numpy.shape(kpts) == (3,): # A single k-point
return scipy.linalg.solve(s22, s21.dot(mo1), sym_pos=True)
return scipy.linalg.solve(s22, s21.dot(mo1), assume_a='pos')
else:
assert (len(kpts) == len(mo1))
return [scipy.linalg.solve(s22[k], s21[k].dot(mo1[k]), sym_pos=True)
return [scipy.linalg.solve(s22[k], s21[k].dot(mo1[k]), assume_a='pos')
for k, kpt in enumerate(kpts)]


Expand Down