Tensor

Tensor is a function that produces the Kronecker (tensor) product of two or more matrices, and thus extends MATLAB's built-in kron function.

Syntax

 * KRN = Tensor(A)
 * KRN = Tensor(A,M)
 * KRN = Tensor(A,B,C,...)

Argument descriptions

 * A: If A is a cell, then KRN is the Kronecker product of all matrices within A.
 * M</tt> (optional): A scalar indicating how many times A</tt> should be tensored with itself (if M</tt> is provided, A</tt> must be a matrix).
 * B,C,...</tt> (optional): Matrices. If these are provided, then A</tt> must be a matrix, and the output is $A \otimes B \otimes C \otimes \cdots$.

Several different input formats
The Tensor</tt> function accepts input in many different formats, so that you may use whichever is most convenient at a particular time. For example, the following three code snippets all result in the same operator: Tensor(A,3)</tt>, Tensor(A,A,A)</tt>, and Tensor({A,A,A})</tt>.

Multiple copies of Werner states
When investigating the NPPT bound entanglement conjecture, you may want to tensor Werner states with themselves multiple times. The following code tensors a particular Werner state with itself 6 times:

Note that rho6</tt> is a 531441-by-531441 matrix, so we don't display it here.