Note that [[Matrix Product]] is a [[Computational Problem]]. # Standard Matrix Multiplication Algorithm Using entry-by-entry definition: ```run-python def multiply_matrices(A,B): # inp A & B are matrices represented as lists of column n-vectors orderA, orderB = (len(A), len(A[0])), (len(B), len(B[0])) if orderA[1] != orderB[0]: print("Cannot multiply matrices!") return None # Initialize result matrix C with zeros C = [[0] * orderB[1] for _ in range(orderA[0])] for i in range(orderA[0]): for j in range(orderB[1]): for k in range(orderA[1]): C[i][j] += A[i][k]* B[k][j] return C # test A = [[1, 0, 0], [0, 1, 0], [0, 0, 1]] B = [[2, 3, 4], [5, 6, 7], [8, 9, 10]] print(multiply_matrices(A,B)) ``` We could use [[Numpy]]. ```run-python import numpy A = numpy.matrix([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) B = numpy.matrix([[2, 3, 4], [5, 6, 7], [8, 9, 10]]) print(A*B) ``` # Strassen Algorithm [[Strassen Algorithm]] uses divide & conquer.