Hello everyone I am trying to use the Kronecker Product, aka the Tensor Product of sympy.physics.quantum: from sympy.physics.quantum import TensorProduct from sympy.physics.quantum.pauli import SigmaZ
When applied to the product of an identity matrix with a Pauli Matrix, say sz, I get: I =sym.eye(2) SzA = TensorProduct(SigmaZ(),I) print(SzA) > SigmaZ()xMatrix([ [1, 0], [0, 1]]) The problem is with the product of I x Sigmaz: SzB = TensorProduct(I,SigmaZ()) I get an error: TypeError: Sequence of Matrices expected, got: (Matrix([ [1, 0], [0, 1]]), SigmaZ()) I can however get out of this issue by using the represent function from sympy.physics.quantum import represent I =sym.eye(2) SzA = TensorProduct(represent(SigmaZ()),I) SzB = TensorProduct(I,represent(SigmaZ())) But I would like to understand why the second product ( TensorProduct(I,SigmaZ())) is not allowed - or conversely why the first product (TensorProduct(SigmaZ(),I)) does not yield an error. Thank for your help Romuald -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/a3d5589a-02e3-4b70-8ed0-bb98a37de53bn%40googlegroups.com.
