import torch


def is_complex_symmetric(z: torch.Tensor, atol=3e-5, rtol=1e-5):
    """
    Return whether the complex symmetric matrices are symmetric or not.

    Parameters
    ----------
    z : tensor
        Complex symmetric matrix
    atol : float
        absolute tolerance for allclose
    rtol : float
        relative tolerance for allclose

    Returns
    -------
    boolean
        whether the points in x are complex symmetric or not
    """
    real_z, imag_z = z.real, z.imag
    return torch.allclose(
        real_z, real_z.transpose(-1, -2), atol=atol, rtol=rtol
    ) and torch.allclose(imag_z, imag_z.transpose(-1, -2), atol=atol, rtol=rtol)