# PartialMap

 Other toolboxes required PartialMap Applies a superoperator to a subsystem of an operator none ApplyMapPartialTracePartialTranspose 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```