def get_vectors(mat1, mat2):
    """
    Uses sparse matrix tricks to convert
    into a vector the matrix values such
    that zero values that appear in only
    one of the matrices is kept. But
    zeros in two matrices are removed

    Requires two sparse matrices as input
    """
    assert mat1.shape == mat2.shape, 'Matrices have different shapes. Computation of correlation is not possible.'
    _mat = mat1 + mat2
    _mat.data += 1
    values1 = (_mat - mat1).data - 1
    values2 = (_mat - mat2).data - 1
    return values1, values2
