Determinant of Identity Matrix | Linear Algebra using Python

Linear Algebra using Python | Determinant of Identity Matrix: Here, we are going to learn about the determinant of identity matrix and its implementation in Python.
Submitted by Anuj Singh, on May 29, 2020

Prerequisites:

In linear algebra, the determinant is a scalar value that can be computed for a square matrix and represents certain properties of the matrix. The determinant of a matrix A is denoted det(A) or det A or |A|. The identity matrices have determinant one and this is one of the properties of the identity matrix. Using python library function, we will try to find the determinant of identity matrices.

Python code for demonstrating the determinant of identity matrix

# Linear Algebra Learning Sequence
# Determinant of Identity Matrix

import numpy as np

print(np.eye(4))
det_M = np.linalg.det(np.eye(4))
print("Determinant : ", det_M)

print("\n\n", np.eye(7))
det_M = np.linalg.det(np.eye(7))
print("Determinant : ", det_M)

Output:

[[1. 0. 0. 0.]
 [0. 1. 0. 0.]
 [0. 0. 1. 0.]
 [0. 0. 0. 1.]]
Determinant :  1.0


 [[1. 0. 0. 0. 0. 0. 0.]
 [0. 1. 0. 0. 0. 0. 0.]
 [0. 0. 1. 0. 0. 0. 0.]
 [0. 0. 0. 1. 0. 0. 0.]
 [0. 0. 0. 0. 1. 0. 0.]
 [0. 0. 0. 0. 0. 1. 0.]
 [0. 0. 0. 0. 0. 0. 1.]]
Determinant :  1.0





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.