WernerState

WernerState is a function that returns the Werner state (i.e., a state of the following form): $$\displaystyle\rho_\alpha := \frac{1}{d^2-d\alpha}\big(I \otimes I - \alpha S\big) \in M_d \otimes M_d,$$ where $S$ is the swap operator. This function is also capable of producing multipartite Werner states. The output of this function is always sparse.

Syntax

 * RHO = WernerState(DIM,ALPHA)

Argument descriptions

 * DIM: Dimension of the local subsystems on which RHO acts.
 * ALPHA: A parameter that specifies which Werner state is to be returned as follows:
 * If ALPHA is a scalar, the Werner state returned is the normalization of I - ALPHA*S, where I is the identity matrix and S</tt> is the bipartite swap operator.
 * If ALPHA</tt> is a vector of length p! - 1 for some integer p, the Werner state returned is a multipartite state acting on p copies of DIM</tt>-dimensional space. More explicitly, the state returned is the normalization of I - ALPHA(1)*P(2) - ... - ALPHA(p!-1)*P(p!)</tt>, where P(i)</tt> is the operator that permutes the p subsystems according to the i-th permutation (when the permutations are ordered in ascending lexicographical order).

A qutrit Werner state
To generate the Werner state with parameter $\alpha = 1/2$, the following code suffices:

Werner states in general have a lot of zero entries, so this function always returns a sparse matrix. If you want a full matrix (as above), use MATLAB's full function.

A multipartite Werner state
In the multipartite setting, the family of Werner states is specified by more than 1 parameter ALPHA</tt>, so we need to provide more than 1 parameter to the WernerState</tt> function. In the tripartite case, there are 3! - 1 = 5 parameters that we need to specify: one for each of the non-identity permutations of the systems. The lexicographical ordering of the permutations of three elements is: 123, 132, 213, 231, 312, 321. Thus the following code produces the Werner state that is the normalization of $I - 0.01 P_{1,3,2} - 0.02 P_{2,1,3} - 0.03 P_{2,3,1} - 0.04 P_{3,1,2} - 0.05 P_{3,2,1}$, where $P_{x,y,z}$ is the permutation operator that maps $|v_1\rangle \otimes |v_2\rangle \otimes |v_3\rangle$ to $|v_x\rangle \otimes |v_y\rangle \otimes |v_z\rangle$: