Difference between revisions of "PartialMap"

From QETLAB
Jump to navigation Jump to search
(Created page with "{{Function |name=PartialMap |desc=Applies a superoperator to a subsystem of an operator |req=ApplyMap<br />iden<br />MaxEntangled<br />opt_args<br />[[Perm...")
 
 
Line 2: Line 2:
 
|name=PartialMap
 
|name=PartialMap
 
|desc=Applies a [[superoperator]] to a subsystem of an operator
 
|desc=Applies a [[superoperator]] to a subsystem of an operator
|req=[[ApplyMap]]<br />[[iden]]<br />[[MaxEntangled]]<br />[[opt_args]]<br />[[PermuteSystems]]
+
|rel=[[ApplyMap]]<br />[[PartialTrace]]<br />[[PartialTranspose]]
|rel=[[PartialTrace]]<br />[[PartialTranspose]]
+
|cat=[[List of functions#Superoperators|Superoperators]]
 
|upd=January 2, 2013
 
|upd=January 2, 2013
|v=1.00}}
+
|v=0.50}}
 
<tt>'''PartialMap'''</tt> is a [[List of functions|function]] that applies a [[superoperator]] to a subsystem of an operator. Both the superoperator and the operator may be either full or sparse.
 
<tt>'''PartialMap'''</tt> is a [[List of functions|function]] that applies a [[superoperator]] to a subsystem of an operator. Both the superoperator and the operator may be either full or sparse.
  
Line 22: Line 22:
 
===A random example===
 
===A random example===
 
The following code applies the [[completely depolarizing channel]] to the second subsystem of a random density matrix:
 
The following code applies the [[completely depolarizing channel]] to the second subsystem of a random density matrix:
<pre<noinclude></noinclude>>
+
<syntaxhighlight>
>> rho = [[RandomDensityMatrix|RandomDensityMatrix(4)]]
+
>> rho = RandomDensityMatrix(4)
  
 
rho =
 
rho =
Line 41: Line 41:
 
   -0.0642 - 0.0250i        0            0.2946                  0           
 
   -0.0642 - 0.0250i        0            0.2946                  0           
 
         0            -0.0642 - 0.0250i        0            0.2946           
 
         0            -0.0642 - 0.0250i        0            0.2946           
</pre<noinclude></noinclude>>
+
</syntaxhighlight>
  
 
And the following code instead applies the same map to the first subsystem:
 
And the following code instead applies the same map to the first subsystem:
<pre>
+
<syntaxhighlight>
 
>> PartialMap(rho,Phi,1)
 
>> PartialMap(rho,Phi,1)
  
Line 53: Line 53:
 
         0                  0            0.2231            0.0191 - 0.0079i
 
         0                  0            0.2231            0.0191 - 0.0079i
 
         0                  0            0.0191 + 0.0079i  0.2769           
 
         0                  0            0.0191 + 0.0079i  0.2769           
</pre>
+
</syntaxhighlight>
 +
 
 +
{{SourceCode|name=PartialMap}}

Latest revision as of 15:31, 29 September 2014

PartialMap
Applies a superoperator to a subsystem of an operator

Other toolboxes required none
Related functions ApplyMap
PartialTrace
PartialTranspose
Function category Superoperators

PartialMap is a function that applies a superoperator to a subsystem of an operator. Both the superoperator and the operator may be either full or sparse.

Syntax

  • PHIX = PartialMap(X,PHI)
  • PHIX = PartialMap(X,PHI,SYS)
  • PHIX = PartialMap(X,PHI,SYS,DIM)

Argument descriptions

  • X: A matrix.
  • PHI: A superoperator. Should be provided as either a Choi matrix, or as a cell with either 1 or 2 columns (see the tutorial page for more details about specifying superoperators within QETLAB).
  • SYS (optional, default 2): The subsystem that the superoperator will be applied to.
  • DIM (optional, default has X acting on two subsystems of equal dimension): A vector containing the dimensions of the (possibly more than 2) subsystems on which X acts.

Examples

A random example

The following code applies the completely depolarizing channel to the second subsystem of a random density matrix:

>> rho = RandomDensityMatrix(4)

rho =

   0.3101            -0.0220 - 0.0219i  -0.0671 - 0.0030i  -0.0170 - 0.0694i
  -0.0220 + 0.0219i   0.1008            -0.0775 + 0.0492i  -0.0613 + 0.0529i
  -0.0671 + 0.0030i  -0.0775 - 0.0492i   0.1361             0.0602 + 0.0062i
  -0.0170 + 0.0694i  -0.0613 - 0.0529i   0.0602 - 0.0062i   0.4530          

>> Phi = {[1 0;0 0]/sqrt(2);[0 1;0 0]/sqrt(2);[0 0;1 0]/sqrt(2);[0 0;0 1]/sqrt(2)};
>> PartialMap(rho,Phi)

ans =

   0.2054                  0            -0.0642 + 0.0250i        0          
        0             0.2054                  0            -0.0642 + 0.0250i
  -0.0642 - 0.0250i        0             0.2946                  0          
        0            -0.0642 - 0.0250i        0             0.2946

And the following code instead applies the same map to the first subsystem:

>> PartialMap(rho,Phi,1)

ans =

   0.2231             0.0191 - 0.0079i        0                  0          
   0.0191 + 0.0079i   0.2769                  0                  0          
        0                  0             0.2231             0.0191 - 0.0079i
        0                  0             0.0191 + 0.0079i   0.2769

Source code

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