What is a symmetric matrix?
A symmetric matrix is a matrix which is transpose of itself. In other words, if A is a square matrix such that AT = A, then A is a symmetric matrix.
Let’s look at an example. Let’s say A is a 3×3 square matrix with the following elements.
At this point, if Ai,j is the element in the ith row and jth column of the matrix A and AT is the transpose of A, then we can say that:
So, the transpose of the matrix A will be:
Hence, AT = A and A is a symmetric matrix.
How to create a symmetric matrix using Python NumPy?
If A is a square matrix, then (AT)T = A. So, we can say that, if A is any square matrix, then (A + AT)/2 is a symmetric matrix.
We can use the following Python code to create a symmetric matrix from a square matrix A…
0 Comments