import numpy as np
create matrix
A = np.array([[1, 2], [3, 4]])
B = np.array([[5, 6], [7, 8]])
multiply @ (__matmul__)
transpose .T
result1 = A.T@B
result2 = A@B.transpose()
det det(A)
det_A = np.linalg.det(A) # -2.0
A_inv = np.linalg.inv(A)
rules
identity matrix (for i,j => aij = 1)
identity = A@A_inv # I
# or
identity = np.identity(2)
matrix transformation
eigenvector
created on: Wed Jul 08 2026