Robert Johansson
from sympy import *
init_printing()
from sympy.physics.quantum import *
ket1 = FermionFockKet(0)
ket2 = FermionFockKet(1)
tp = TensorProduct(ket1, ket2)
p = Dagger(tp) * tp
p, p.doit() # Does not evaluate
The Qubit class has its own way of managing composite quantum systems (tensorproducts)...
from sympy.physics.quantum.qubit import *
q1 = Qubit("0")
q2 = Qubit("1")
p = Dagger(q1) * q2
p, p.doit() # OK
tp = TensorProduct(Qubit("0"), Qubit("1")); tp
p = Dagger(tp) * tp
p, p.doit() # Does not work.
TensorProduct(Qubit("10"), Qubit("10")) # not working properly either
bra = Bra("psi")
ket = Ket("phi")
bra * ket # OK
TensorProduct(bra, bra) * TensorProduct(ket, ket) # Double vertical bars
type(bra * ket)
sympy.physics.quantum.innerproduct.InnerProduct
type(TensorProduct(bra, bra) * TensorProduct(ket, ket)) # not recognized as an InnerProduct
sympy.core.mul.Mul
bra = Bra("psi")
ket = Ket("phi")
TensorProduct(bra, ket)