from typing import Tuple
import torch


def permute_adjacency_twin(t1,t2) -> Tuple[torch.Tensor,torch.Tensor]:
    """
    Makes a permutation of two adjacency matrices together. Equivalent to a renaming of the nodes.
    Supposes shape (n,n)
    """
    n,_ = t1.shape
    perm = torch.randperm(n)
    return t1[perm,:][:,perm],t2[perm,:][:,perm]