(n)
return imat
Generates a :math:`N \\times N` identity matrix.

    :param n: size of the matrix
    :type n: int
    :return: identity matrix
    :rtype: list
Generates a :math:`N \\times N` identity matrix.
Generates a : math : N \\ times N identity matrix .
def matrix_identity(n):
    """ Generates a :math:`N \\times N` identity matrix.

    :param n: size of the matrix
    :type n: int
    :return: identity matrix
    :rtype: list
    """
    imat = [[1.0 if i == j else 0.0 for i in range(n)] for j in range(n)]
    return imat
def matrix_identity ( n ) : imat = [ [ 1.0 if i == j else 0.0 for i in range ( n ) ] for j in range ( n ) ] return imat