Quantum Computing, Qiskit, Linear Algebra, Mathematics, Python.
second matrix by every element of the first matrix Exercise 12: Tensor Product. Inputs: An n×m matrix A. A k×l matrix B. Output: Return an (n⋅k)×(m⋅l) matrix A⊗B, the tensor product of A and B. def tensor_prod(A, B): # Get the dimensions of matrices A and B rows_A, cols_A = len(A), len(A[0])