Using this answer
Clear[x, y];
$Assumptions = (x | y) \[Element] Vectors[2];
tensorExpand[expr_] :=
Simplify[TensorExpand[expr] /.
Thread[{x, y} -> IdentityMatrix[2]]] /.
l_List :> SparseArray[l] /. s_SparseArray :> toSymbols[ArrayRules@s]
toSymbols[ruleList_] :=
Total[ruleList /.
HoldPattern[Rule[a_, b_]] :>
Times[Apply[TensorProduct, a /. Thread[{1, 2} -> {x, y}]], b]]
I want to do something like (it don't even run):
Inner[Dot, a TensorProduct[x, x] + c TensorProduct[y, x],
b TensorProduct[x, y], Plus]
to get zero as result and
Inner[Dot, a TensorProduct[x, x] + c TensorProduct[y, x],
b TensorProduct[x, x], Plus]
a b for this case, just like if I was working with Dirac's notation:
$$
(a\vert + + \rangle + c \vert -+\rangle,b\vert + +\rangle) = ab
$$
where $(\,,\,)$ is the dot product.
I think that Inner is inadequate for this task, but is the only approach that I have.
Edit: I'm trying this because I'm using 20 qubits and using something like KroneckerProduct isn't suitable for my case.
Simplify,Dot, orInnerdon't really do anything too useful with them. You would have to useTensorContractin place ofDotorInner, andTensorReducein place ofSimplify, which can be awkward. – Oleksandr R. Jan 25 '16 at 12:12