# DepolarizingChannel

 Other toolboxes required DepolarizingChannel Produces a depolarizing channel none DephasingChannel Superoperators

DepolarizingChannel is a function that returns the Choi matrix of the partially depolarizing channel, which acts as follows:

$\Delta(X) := (1-p)\mathrm{Tr}(X)\frac{I}{d^2} + pX,$

where $I$ is the identity matrix, $d$ is the local dimension, and $0 \leq p \leq 1$ is a given parameter ($p = 0$ by default).

## Syntax

• DELTA = DepolarizingChannel(DIM)
• DELTA = DepolarizingChannel(DIM,P)

## Argument descriptions

• DIM: The dimension of the channel. That is, the channel will act on DIM-by-DIM matrices.
• P (optional, default 0): A parameter (from 0 to 1, inclusive) that specifies which partially depolarizing channel to produce. P = 0 gives the completely depolarizing channel, and P = 1 gives the identity channel.

## Examples

### The completely depolarizing channel

The completely depolarizing channel maps every density matrix to the maximally-mixed state:

>> ApplyMap(RandomDensityMatrix(3),DepolarizingChannel(3))

ans =

0.3333         0         0
0    0.3333         0
0         0    0.3333

## Source code

Click on "expand" to the right to view the MATLAB source code for this function.

1. %%  DEPOLARIZINGCHANNEL    Produces a depolarizing channel
2. %   This function has one required argument:
3. %     DIM: the dimensionality on which the channel acts
4. %
5. %   DELTA = DepolarizingChannel(DIM) is the Choi matrix of the completely
6. %   depolarizing channel that acts on DIM-by-DIM matrices.
7. %
8. %   This function has one optional argument:
9. %     P (default 0)
10. %
11. %   DELTA = DepolarizingChannel(DIM,P) produces the partially depolarizing
12. %   channel (1-P)*D + P*ID, where D is the completely depolarizing channel
13. %   and ID is the identity channel.
14. %
15. %   URL: http://www.qetlab.com/DepolarizingChannel
16. 
17. %   requires: iden.m, MaxEntangled.m, opt_args.m
18. %   author: Nathaniel Johnston (nathaniel@njohnston.ca)
19. %   last updated: March 4, 2014
20. 
21. function delta = DepolarizingChannel(dim,varargin)
22. 
23. % set optional argument defaults: p=0
24. [p] = opt_args({ 0 },varargin{:});
25. 
26. % compute the Choi matrix of the depolarizing channel
27. psi = MaxEntangled(dim,1,0); % gives a sparse non-normalized state
28. delta = (1-p)*speye(dim^2)/dim + p*(psi*psi');