Difference between revisions of "PartialTranspose"

From QETLAB
Jump to navigation Jump to search
(Uploaded v1.01 (fixed a bug when using symbolic matrices))
 
Line 2: Line 2:
 
|name=PartialTranspose
 
|name=PartialTranspose
 
|desc=Computes the [[partial transpose]] of a matrix
 
|desc=Computes the [[partial transpose]] of a matrix
|req=[[opt_args]]<br />[[PermuteSystems]]
 
 
|rel=[[PartialMap]]<br />[[PartialTrace]]
 
|rel=[[PartialMap]]<br />[[PartialTrace]]
 +
|cat=[[List of functions#Superoperators|Superoperators]]
 
|upd=December 28, 2012
 
|upd=December 28, 2012
|v=1.01}}
+
|v=0.50}}
 
<tt>'''PartialTranspose'''</tt> is a [[List of functions|function]] that computes the [[partial transpose]] of a matrix. The transposition may be taken on any subset of the subsystems on which the matrix acts.
 
<tt>'''PartialTranspose'''</tt> is a [[List of functions|function]] that computes the [[partial transpose]] of a matrix. The transposition may be taken on any subset of the subsystems on which the matrix acts.
  
Line 24: Line 24:
 
===A bipartite square matrix===
 
===A bipartite square matrix===
 
By default, the <tt>PartialTranspose</tt> function performs the transposition on the second subsystem:
 
By default, the <tt>PartialTranspose</tt> function performs the transposition on the second subsystem:
<pre>
+
<syntaxhighlight>
 
>> X = reshape(1:16,4,4)'
 
>> X = reshape(1:16,4,4)'
  
Line 42: Line 42:
 
     9    13    11    15
 
     9    13    11    15
 
     10    14    12    16
 
     10    14    12    16
</pre>
+
</syntaxhighlight>
  
 
By specifying the <tt>SYS</tt> argument, you can perform the transposition on the first subsystem instead:  
 
By specifying the <tt>SYS</tt> argument, you can perform the transposition on the first subsystem instead:  
<pre>
+
<syntaxhighlight>
 
>> PartialTranspose(X,1)
 
>> PartialTranspose(X,1)
  
Line 54: Line 54:
 
     3    4    11    12
 
     3    4    11    12
 
     7    8    15    16
 
     7    8    15    16
</pre>
+
</syntaxhighlight>
  
 
Applying the transpose to both the first and second subsystems results in the standard transpose of <tt>X</tt>:  
 
Applying the transpose to both the first and second subsystems results in the standard transpose of <tt>X</tt>:  
<pre>
+
<syntaxhighlight>
 
>> norm(PartialTranspose(X,[1,2]) - X.')
 
>> norm(PartialTranspose(X,[1,2]) - X.')
  
Line 63: Line 63:
  
 
     0
 
     0
</pre>
+
</syntaxhighlight>
 +
 
 +
{{SourceCode|name=PartialTranspose}}

Latest revision as of 15:33, 29 September 2014

PartialTranspose
Computes the partial transpose of a matrix

Other toolboxes required none
Related functions PartialMap
PartialTrace
Function category Superoperators

PartialTranspose is a function that computes the partial transpose of a matrix. The transposition may be taken on any subset of the subsystems on which the matrix acts.

Syntax

  • XPT = PartialTranspose(X)
  • XPT = PartialTranspose(X,SYS)
  • XPT = PartialTranspose(X,SYS,DIM)

Argument descriptions

  • X: A matrix to have its partial transpose returned.
  • SYS (optional, default 2): A scalar or vector containing the indices of the subsystems on which the transpose is to be applied.
  • DIM (optional, by default has all subsystems of equal dimension): A specification of the dimensions of the subsystems that X lives on. DIM can be provided in one of three ways:
    • If DIM is a scalar, it is assumed that X lives on the tensor product of two spaces, the first of which has dimension DIM and the second of which has dimension length(X)/DIM.
    • If $X \in M_{n_1} \otimes \cdots \otimes M_{n_p}$ then DIM should be a row vector containing the dimensions (i.e., DIM = [n_1, ..., n_p]).
    • If the subsystems aren't square (i.e., $X \in M_{m_1, n_1} \otimes \cdots \otimes M_{m_p, n_p}$) then DIM should be a matrix with two rows. The first row of DIM should contain the row dimensions of the subsystems (i.e., the mi's) and its second row should contain the column dimensions (i.e., the ni's). In other words, you should set DIM = [m_1, ..., m_p; n_1, ..., n_p].

Examples

A bipartite square matrix

By default, the PartialTranspose function performs the transposition on the second subsystem:

>> X = reshape(1:16,4,4)'

X =

     1     2     3     4
     5     6     7     8
     9    10    11    12
    13    14    15    16

>> PartialTranspose(X)

ans =

     1     5     3     7
     2     6     4     8
     9    13    11    15
    10    14    12    16

By specifying the SYS argument, you can perform the transposition on the first subsystem instead:

>> PartialTranspose(X,1)

ans =

     1     2     9    10
     5     6    13    14
     3     4    11    12
     7     8    15    16

Applying the transpose to both the first and second subsystems results in the standard transpose of X:

>> norm(PartialTranspose(X,[1,2]) - X.')

ans =

     0

Source code

Click here to view this function's source code on github.