-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathDephasingChannel.m
28 lines (24 loc) · 1018 Bytes
/
DephasingChannel.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
%% DEPHASINGCHANNEL Produces a dephasing channel
% This function has one required argument:
% DIM: the dimensionality on which the channel acts
%
% DELTA = DephasingChannel(DIM) is the Choi matrix of the completely
% dephasing channel that acts on DIM-by-DIM matrices.
%
% This function has one optional argument:
% P (default 0)
%
% DELTA = DephasingChannel(DIM,P) produces the partially dephasing
% channel (1-P)*D + P*ID, where D is the completely dephasing channel
% and ID is the identity channel.
%
% URL: http://www.qetlab.com/DephasingChannel
% requires: iden.m, MaxEntangled.m, opt_args.m
% author: Nathaniel Johnston ([email protected])
% last updated: January 22, 2015
function delta = DephasingChannel(dim,varargin)
% set optional argument defaults: p=0
[p] = opt_args({ 0 },varargin{:});
% compute the Choi matrix of the depolarizing channel
psi = MaxEntangled(dim,1,0); % gives a sparse non-normalized state
delta = (1-p)*diag(diag(psi*psi')) + p*(psi*psi');