Difference between revisions of "Tensor"

From QETLAB
Jump to navigation Jump to search
(Created page with "{{Function |name=MultiKron |desc=Kronecker tensor product of two or more matrices |upd=November 27, 2012 |v=1.00}} <tt>'''MultiKron'''</tt> is a [[List o...")
 
m (Nathaniel moved page MultiKron to Tensor: Changed name of function)
(No difference)

Revision as of 15:23, 28 November 2012

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.