Generates the generic spin matrices for the system

def spin_gen_op(oper, gauge):
    """Generates the generic spin matrices for the system"""
    slaves = len(gauge)
    oper['O'] = np.array([spin_gen(slaves, i, c) for i, c in enumerate(gauge)])
    oper['O_d'] = np.transpose(oper['O'], (0, 2, 1))
    oper['O_dO'] = np.einsum('...ij,...jk->...ik', oper['O_d'], oper['O'])
    oper['Sfliphop'] = spinflipandhop(slaves)