def _merge_weights(spin_d1, spin_d2):
    """Sum the weights stored in two dictionaries with keys being the spins"""
    if len(spin_d1) != len(spin_d2):
        raise RuntimeError("Critical - mismatch spin-dict length")
    out = {}
    for spin in spin_d1:
        out[spin] = spin_d1[spin] + spin_d2[spin]
    return out