Example #1
0
def make_rdm2(myci, civec=None, nmo=None, nocc=None):
    r'''
    Two-particle density matrix in the molecular spin-orbital representation

    dm2[p,q,r,s] = <p^\dagger r^\dagger s q>

    where p,q,r,s are spin-orbitals. p,q correspond to one particle and r,s
    correspond to another particle.  The contraction between ERIs (in
    Chemist's notation) and rdm2 is
    E = einsum('pqrs,pqrs', eri, rdm2)
    '''
    if civec is None: civec = myci.ci
    if nmo is None: nmo = myci.nmo
    if nocc is None: nocc = myci.nocc
    d1 = _gamma1_intermediates(myci, civec, nmo, nocc)
    d2 = _gamma2_intermediates(myci, civec, nmo, nocc)
    return gccsd_rdm._make_rdm2(myci, d1, d2, with_dm1=True, with_frozen=True)
Example #2
0
def make_rdm2(myci, civec=None, nmo=None, nocc=None):
    r'''
    Two-particle density matrix in the molecular spin-orbital representation

    dm2[p,q,r,s] = <p^\dagger r^\dagger s q>

    where p,q,r,s are spin-orbitals. p,q correspond to one particle and r,s
    correspond to another particle.  The contraction between ERIs (in
    Chemist's notation) and rdm2 is
    E = einsum('pqrs,pqrs', eri, rdm2)
    '''
    if civec is None: civec = myci.ci
    if nmo is None: nmo = myci.nmo
    if nocc is None: nocc = myci.nocc
    d1 = _gamma1_intermediates(myci, civec, nmo, nocc)
    d2 = _gamma2_intermediates(myci, civec, nmo, nocc)
    return gccsd_rdm._make_rdm2(myci, d1, d2, with_dm1=True, with_frozen=True)
Example #3
0
def make_rdm2(mycc, t1, t2, l1, l2, ao_repr=False, with_dm1=True):
    r'''
    Two-particle density matrix in the molecular spin-orbital representation

    dm2[p,q,r,s] = <p^\dagger r^\dagger s q>

    where p,q,r,s are spin-orbitals. p,q correspond to one particle and r,s
    correspond to another particle.  The contraction between ERIs (in
    Chemist's notation) and rdm2 is
    E = einsum('pqrs,pqrs', eri, rdm2)
    '''
    if t1 is None:
        t1 = mycc.t1
    if t2 is None:
        t2 = mycc.t2
    if l1 is None:
        l1 = mycc.l1
    if l2 is None:
        l2 = mycc.l2
    if l1 is None:
        l1, l2 = mycc.solve_lambda(t1, t2)

    d1 = _gamma1_intermediates(mycc, t1, t2, l1, l2)
    # ZHC TODO
    # use MPI for distributed intermediates
    t1, t2 = mycc.gather_amplitudes(t1, t2)
    l1, l2 = mycc.gather_lambda(l1, l2)

    if rank == 0:
        d2 = gccsd_rdm._gamma2_intermediates(mycc, t1, t2, l1, l2)
        rdm2 = gccsd_rdm._make_rdm2(mycc,
                                    d1,
                                    d2,
                                    with_dm1=with_dm1,
                                    with_frozen=True,
                                    ao_repr=ao_repr)
    else:
        rdm2 = None
    return rdm2
Example #4
0
def make_rdm2(mycc, t1, t2, l1, l2, eris=None):
    d1 = _gamma1_intermediates(mycc, t1, t2, l1, l2, eris)
    d2 = _gamma2_intermediates(mycc, t1, t2, l1, l2, eris)
    return gccsd_rdm._make_rdm2(mycc, d1, d2, True, True)
Example #5
0
def make_rdm2(mycc, t1, t2, l1, l2, eris=None):
    d1 = _gamma1_intermediates(mycc, t1, t2, l1, l2, eris)
    d2 = _gamma2_intermediates(mycc, t1, t2, l1, l2, eris)
    return gccsd_rdm._make_rdm2(mycc, d1, d2, True, True)