diff --git a/pyscf/fci/rdm.py b/pyscf/fci/rdm.py index 58be01c4fe..284053c014 100644 --- a/pyscf/fci/rdm.py +++ b/pyscf/fci/rdm.py @@ -101,8 +101,8 @@ def make_rdm1_spin1(fname, cibra, ciket, norb, nelec, link_index=None): link_indexa, link_indexb = link_index na,nlinka = link_indexa.shape[:2] nb,nlinkb = link_indexb.shape[:2] - assert (cibra.size == na*nb) - assert (ciket.size == na*nb) + assert (cibra.size == na*nb), '{} {} {}'.format (cibra.size, na, nb) + assert (ciket.size == na*nb), '{} {} {}'.format (ciket.size, na, nb) rdm1 = numpy.empty((norb,norb)) fn = getattr(librdm, fname) fn(rdm1.ctypes.data_as(ctypes.c_void_p), diff --git a/pyscf/mcscf/newton_casscf.py b/pyscf/mcscf/newton_casscf.py index 941def1e56..b6e4d9c352 100644 --- a/pyscf/mcscf/newton_casscf.py +++ b/pyscf/mcscf/newton_casscf.py @@ -293,7 +293,8 @@ def g_update(u, fcivec): # h_diag[ncore:nocc,ncore:nocc] -= v_diag[:,ncore:nocc]*2 h_diag = casscf.pack_uniq_var(h_diag) - hci_diag = [hd - ec - gc*c*4 for hd, ec, gc, c in zip (_Hdiag (h1cas_0, eri_cas), eci0, gci, ci0)] + # Fix intermediate normalization? - MRH 2023/09/15 + hci_diag = [hd - ec - gc*c*2 for hd, ec, gc, c in zip (_Hdiag (h1cas_0, eri_cas), eci0, gci, ci0)] hci_diag = [h * w for h, w in zip (hci_diag, weights)] hdiag_all = numpy.hstack((h_diag*2, _pack_ci (hci_diag)*2)) @@ -308,9 +309,10 @@ def h_op(x): ci1 = _unpack_ci (x[ngorb:]) # H_cc + # Fix intermediate normalization? - MRH 2023/09/15 hci1 = [hc1 - c1 * ec0 for hc1, c1, ec0 in zip (_Hci (h1cas_0, eri_cas, ci1), ci1, eci0)] - hci1 = [hc1 - 2*(hc0 - c0*ec0)*c0.dot(c1) for hc1, hc0, c0, ec0, c1 in zip (hci1, hci0, ci0, eci0, ci1)] - hci1 = [hc1 - 2*c0*(hc0 - c0*ec0).dot(c1) for hc1, hc0, c0, ec0, c1 in zip (hci1, hci0, ci0, eci0, ci1)] + hci1 = [hc1 - (hc0 - c0*ec0)*c0.dot(c1) for hc1, hc0, c0, ec0, c1 in zip (hci1, hci0, ci0, eci0, ci1)] + hci1 = [hc1 - c0*(hc0 - c0*ec0).dot(c1) for hc1, hc0, c0, ec0, c1 in zip (hci1, hci0, ci0, eci0, ci1)] # H_co rc = x1[:,:ncore]