PartialMap
Jump to navigation
Jump to search
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.