Concurrence of a 2-Qubit System
by
Mark S. Tame
School of Mathematics and Physics, Queen's University, Belfast.  UK.
m.tame@qub.ac.uk

Introduction

When analysing quantum systems in Quantum Information Theory it is sometimes necessary to compute the amount of entanglement that exists between two qubits. For example, suppose Alice and Bob share a pair of entangled qubits described by the density matrix (Subscript[ρ, AB]). If we would like  to determine the amount of entanglement present between the two qubits, then the concurrence represents a measure of entanglement that can be used [1]. 
However, it becomes quite a task to calculate the concurrence for a complicated matrix if we would like to see how the entanglement changes as a particular parameter α is varied. For example, this parameter could describe imperfections in the ideal case, such as decoherence acting on the system (Subscript[ρ, AB]) :  (Subscript[ρ, AB])(α), with the density matrix losing purity as α increases. Calculating the concurrence by hand in this case becomes unmanageable. What the Concurrence  function does, is allow you to do this by letting Mathematica do the work for you:
Concurrence[(Subscript[ρ, AB]),α,(Subscript[α, min]),(Subscript[α, max]),(Subscript[α, points])].
To use the function, you must evaluate it first in The Code section. Then it is straightforward to use, see the Example section for its possible use. 
If you would like to know more about the theory behind the concurrence measure of entanglement, see [1, 2].

The Code

Here is the code for the Concurrence  function to calculate the amount of entanglement between 2 qubits as a parameter α is varied. Evaluate the cell below and you can use it. For more help, please see the Examples section:

<< 
        LinearAlgebra`MatrixManipulation`;
MDP[
          a_List?MatrixQ,  b_List?MatrixQ]  :=  
        BlockMatrix[Outer[Times,  a,  b]];
Concurrence[
        c_List?MatrixQ, α_, αmin_, αmax_, dα_] := (
sigy=(({{0, -I}, {I, 0}}));
sigsigy = MDP[sigy, sigy];
rhototal = c;
α = Γ;
rhototal2 = 
            sigsigy . (Conjugate[c]) . sigsigy;
Tabconc = Range[dα + 1];
For[w = 0, 
            w < dα + 1, w++; 
Γ = 
              N[αmin + (1/dα) (w - 
                        1) (αmax - αmin)]; 
Print[
              Eigenvalues[rhototal . rhototal2]]; 
g = 
              Length[Eigenvalues[
                  rhototal . 
                    rhototal2]]; 
Conc = (Sqrt[Chop])[Eigenvalues[rhototal . rhototal2][[1]]] - (∑_(i = 2)^g)(Sqrt[(Chop[Eigenvalues[rhototal . rhototal2][[i]]])]); 
Tabconc[[w]] = {Γ, 
                Conc};
];
Print[Tabconc];
Γ =. ;
α =. ;
;Return[
            ListPlot[Tabconc,  
              PlotRange -> {{αmin, αmax}, {0, 1}},  
              PlotJoined ->  True,  Frame ->  True,  
              FrameLabel ->  {"α", "Concurrence"}, 
              TextStyle -> {FontSize -> 14}]])

Example

Here is an example of how it works. Concurrence has 5 arguments, the density matrix (Subscript[ρ, AB])(α), the parameter that is being varied α, the minimum and maximum values of α given by (Subscript[α, min])and (Subscript[α, max]) respectively and the number of points you would like (Subscript[α, points]) (the resolution of your data).
- Example 1.
In this example we have a density matrix describing the maximally entangled state: \(TraditionalForm\`\(1\/\@2\) \((\(|\)\(00 > +\)\(|\)\(\(11\)\(>\)\))\)\_AB\) undergoing what is known as a  depolarizing channel:

(Subscript[ρ, AB]) = (1/2) {{1, 0, 0, 1}, {0, 0, 0, 0}, {0, 0, 0, 0}, {1, 
              0, 0, 1}};
(Subscript[ρ, AB])  // MatrixForm
ThroughChannel(Subscript[ρ, AB]) = (1 - α) (Subscript[ρ, AB]) + α (1/4) IdentityMatrix[4];
ThroughChannel(Subscript[ρ, AB])  // MatrixForm
Concurrence[ThroughChannel(Subscript[ρ, AB]),  α, 0, 1, 10]

This provides us with the behaviour of the amount of entanglement present (in terms of the concurrence) between the two qubits as they experience decoherence induced from a noisy environment (depolarizing channel).

References

[1] W. K. Wooters, Phys. Rev. Lett. 80, 2245 (1998).
[2] F. Mintert, A. R. R. Carvalho, M. Ku\(s\&'\) and A. Buchleitner, Phys. Rep. 415, 207 (2005).