Tensor

From QETLAB
Revision as of 16:41, 27 November 2012 by Nathaniel (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
MultiKron
Kronecker tensor product of two or more matrices

Other toolboxes required none

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

Syntax

  • KRN = MultiKron(A)
  • KRN = MultiKron(A,M)
  • KRN = MultiKron(A,B,C,...)

Argument descriptions

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

Examples

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:

>> rho = WernerState(3,1/2,1);
>> rho6 = MultiKron(rho,6);

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