Introduction
This article follows "Fundamentals of Matrix Algebra with Python | Part 1". It introduces more basic concepts of matrix algebra with some Python code to demonstrate results.

Contents
- Trace
- Determinant
- Inverse
- Orthogonality
- Row permutations
This preliminary material on matrix facilitates the exploration of more advanced topics such as simulating dynamic systems using state-space models.
1) Trace
The trace of a matrix is simply the sum of its diagonal elements, as highlighted below in Figure 1.

Gist 1 provides the Python code to calculate the trace of a matrix, which is trivial using Numpy.
2) Determinant
The determinant of a square matrix is a scalar. Non-square matrices do not have determinants.
Take A in Figure 2 as an example.

Figure 3 presents the formula for evaluating a 2×2 determinant.

An essential geometric consequence is that the 2×2 determinant scalar value equals the area formed by a parallelogram made up of the column vectors of A.
Plotting the column vectors of a 2×2 matrix in Matplotlib using the code in Gist 2 shows that v₁ (first column) and v₂ (second column) comprise the sides of a parallelogram.
Figure 4 is a labelled graph generated from the code above. The column vectors form a parallelogram.

Examine and modify the Python code in Gist 2 to produce to see more examples.
Figure 5 depicts two collinear vectors, meaning they are linearly dependent. Therefore, it is not possible to construct a parallelogram.

Therefore, this shows that if rows or columns are linearly dependent, the determinant has a value of 0.
3) Inverse
Figure 6 depicts a 3×3 identity matrix, I.

Multiplying ** a matrix by its inverse gives the Identity Matrix, I, i.e. _A A⁻¹ = I,_ where __ A⁻¹ means the inverse of A. Use the expression in Figure 7 to calculate the inverse of a 2**×2.

Not all matrices are invertible. As seen in Figure 7, the determinant appears in the calculation. Therefore, A must be square (n×n) and have a non-zero determinant to have an inverse.
4) Orthogonality
Orthogonality is synonymous with orthonormality. Orthogonality applies when columns or rows are orthonormal vectors.
Orthonormal vectors are simply perpendicular, as demonstrated in Figure 8.

Test for orthogonality using the condition in Figure 9.

Fundamentally the expression means that A is orthogonal if its transpose is equal to its inverse – use code similar to Gist 3 to check if a matrix is orthogonal.
5) Row permutations
A permutation matrix is a square binary matrix with one entry of 1 in each row and each column and 0s elsewhere.
Having introduced the Identity matrix, permitting rows of matrix A involves multiplying the matrix by an altered version of I.

Take matrix A in Figure 10 as an example.

Permuting rows involves changing the order of rows or columns, for example, moving r₁ to r₂ and r₂ to r₁. Figure 11 depicts examples of both types of permutations using the permutation matrix P defined above.

Gist 4 gives the Python code necessary to perform these operations.
Conclusion
This article has presented five more fundamental concepts of matrix algebra. The topics above are concise in detail, so the reader is encouraged to use this as a starting point for further research.
A recommended next topic to reinforce some of the matrix algebra concepts is solving systems of linear equations ** using the Gaussian elimination algorith**m in Python.
Thanks for reading.
References
[1] Matrix Algebra for Engineers – Jeffrey R. Chasnov[2] Permutation Matrix – Wikepedia