Quantum Computing, Qiskit, Linear Algebra, Mathematics, Python.
det = 0 for j in range(n): # Create a submatrix without the first row and the j-th column submatrix = [[a[i][col] for col in range(n) if col != j] for i in range(1, n)] # Calculate the determinant of the submatrix recursively sub_det = determinant(submatrix) # Calculate the cofactor by multiplying