def is_similarity(m):
    """
    Return ``True`` if ``m`` is a similarity and ``False`` otherwise.

    EXAMPLES::

        sage: from flatsurf.geometry.matrix_2x2 import is_similarity

        sage: is_similarity(matrix([[0,1],[1,0]]))
        True
        sage: is_similarity(matrix([[0,-2],[2,0]]))
        True
        sage: is_similarity(matrix([[1,1],[0,1]]))
        False
    """
    n = m * m.transpose()
    return n[0, 1].is_zero() and n[1, 0].is_zero()
