def _assemble_rdm2_spinfree(evals) -> numpy.ndarray:
    ' Returns spin-free two-particle RDM built by symmetry conditions '
    ctr: int = 0
    rdm2 = numpy.zeros([n_MOs, n_MOs, n_MOs, n_MOs])
    for (p, q, r, s) in product(range(n_MOs), repeat=4):
        if ((((p * n_MOs) + q) >= ((r * n_MOs) + s)) and ((p >= q) or (r >= s))):
            rdm2[(p, q, r, s)] = evals[ctr]
            rdm2[(r, s, p, q)] = rdm2[(p, q, r, s)]
            ctr += 1
    for (p, q, r, s) in product(range(n_MOs), repeat=4):
        if ((p >= q) or (r >= s)):
            rdm2[(q, p, s, r)] = rdm2[(p, q, r, s)]
    return rdm2
Returns spin-free two-particle RDM built by symmetry conditions
def _assemble_rdm2_spinfree(evals) -> numpy.ndarray:
    '  '
    ctr: int = 0
    rdm2 = numpy.zeros([n_MOs, n_MOs, n_MOs, n_MOs])
    for (p, q, r, s) in product(range(n_MOs), repeat=4):
        if ((((p * n_MOs) + q) >= ((r * n_MOs) + s)) and ((p >= q) or (r >= s))):
            rdm2[(p, q, r, s)] = evals[ctr]
            rdm2[(r, s, p, q)] = rdm2[(p, q, r, s)]
            ctr += 1
    for (p, q, r, s) in product(range(n_MOs), repeat=4):
        if ((p >= q) or (r >= s)):
            rdm2[(q, p, s, r)] = rdm2[(p, q, r, s)]
    return rdm2