Skip to content

Commit

Permalink
ao2mo: update uno for special mol
Browse files Browse the repository at this point in the history
  • Loading branch information
hczhai committed Jul 22, 2024
1 parent 00dbcdd commit 7224ccc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions pyblock2/_pyscf/ao2mo/integrals.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def label_orb_symm(mol, irrep_name, symm_orb, mo, s=None, check=True, tol=1e-9):
nmo = mo.shape[1]
if s is None:
s = mol.intor_symmetric('int1e_ovlp')
if s.shape == (0, 0):
s = np.identity(nmo)
s_mo = np.dot(s, mo)
norm = np.zeros((len(irrep_name), nmo))
for i, csym in enumerate(symm_orb):
Expand Down
6 changes: 4 additions & 2 deletions pyblock2/_pyscf/mcscf/uno.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ def get_uno(mf, do_loc=True, iprint=True):
# 2. Sanity check, using orthogonality

ova = mol.intor_symmetric("cint1e_ovlp_sph")
if ova.shape == (0, 0):
ova = mf.get_ovlp()
diff = ma.conj().T @ ova @ ma - np.identity(norb)
assert np.linalg.norm(diff) < 1e-7
diff = mb.conj().T @ ova @ mb - np.identity(norb)
Expand Down Expand Up @@ -227,9 +229,9 @@ def get_uno(mf, do_loc=True, iprint=True):
if not do_loc:
mo_occ = eig
index = np.argsort(-mo_occ)
mo_occ = mo_occ[index]
mo_occ = mo_occ[index]
coeff = coeff[:, index]
return coeff, eig
return coeff, mo_occ

# 3. Search for active space

Expand Down

0 comments on commit 7224ccc

Please sign in to comment.