# WernerState

 Other toolboxes required WernerState Produces a Werner state none IsotropicState Special states, vectors, and operators

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 is the bipartite swap operator.
• If ALPHA 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-dimensional space. More explicitly, the state returned is the normalization of I - ALPHA(1)*P(2) - ... - ALPHA(p!-1)*P(p!), where P(i) is the operator that permutes the p subsystems according to the i-th permutation (when the permutations are ordered in ascending lexicographical order).

## Examples

### A qutrit Werner state

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

>> full(WernerState(3,1/2))

ans =

0.0667         0         0         0         0         0         0         0         0
0    0.1333         0   -0.0667         0         0         0         0         0
0         0    0.1333         0         0         0   -0.0667         0         0
0   -0.0667         0    0.1333         0         0         0         0         0
0         0         0         0    0.0667         0         0         0         0
0         0         0         0         0    0.1333         0   -0.0667         0
0         0   -0.0667         0         0         0    0.1333         0         0
0         0         0         0         0   -0.0667         0    0.1333         0
0         0         0         0         0         0         0         0    0.0667

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.

>> WernerState(3,1/2)

ans =

(1,1)       0.0667
(2,2)       0.1333
(4,2)      -0.0667
(3,3)       0.1333
(7,3)      -0.0667
(2,4)      -0.0667
(4,4)       0.1333
(5,5)       0.0667
(6,6)       0.1333
(8,6)      -0.0667
(3,7)      -0.0667
(7,7)       0.1333
(6,8)      -0.0667
(8,8)       0.1333
(9,9)       0.0667

### A multipartite Werner state

In the multipartite setting, the family of Werner states is specified by more than 1 parameter ALPHA, so we need to provide more than 1 parameter to the WernerState 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$:

>> full(WernerState(2,[0.01,0.02,0.03,0.04,0.05]))

ans =

0.1127         0         0         0         0         0         0         0
0    0.1300   -0.0066         0   -0.0106         0         0         0
0   -0.0053    0.1260         0   -0.0080         0         0         0
0         0         0    0.1313         0   -0.0066   -0.0119         0
0   -0.0119   -0.0066         0    0.1313         0         0         0
0         0         0   -0.0080         0    0.1260   -0.0053         0
0         0         0   -0.0106         0   -0.0066    0.1300         0
0         0         0         0         0         0         0    0.1127