A matrix is said to be idempotent matrix if matrix multiplied by itself return the same matrix. The matrix M is said to be idempotent matrix if and only if M * M = M. In idempotent matrix M is a square matrix.
Python program to check idempotent matrix:
https://www.geeksforgeeks.org/python-program-to-check-idempotent-matrix/