# Examples of stochastic matrices that are also unitary?

In general there is no relationship between stochastic matrices and unitary matrices because they are used in different fields.
The stochastic matrix presents all the non-negative elements with sum on each row (or column) equal to 1.

The unitary matrix, if real, presents inverse and transposed equal to each other.

Is a unit matrix (or identity matrix) an example of stochastic & unitary matrix at same time ?

• "Is a unit matrix (or identity matrix) an example of stochastic & unitary matrix at same time" - yes. It is both stochastic (actually even left and right stochastic!) and unitary. Same is true for an exchange matrix btw (all ones on its antidiagonal). – Florian Jul 20 '18 at 20:39

The only matrices that are both stochastic and unitary are permutation matrices (i.e. those with one $$1$$ in each row and in each column). Let the rows be vectors $$a_i$$ with entries $$a_{ij}$$. Firstly, note that to be unitary we need $$a_i^{\dagger}a_i = 1$$; to be stochastic, $$1^{\dagger}a_i = 1$$, where $$1 = (1,1,\dotsc,1)$$, and we also need $$a_{ij}>0$$. It follows that $$0 \leq a_{ij} \leq 1$$, since each summand in a sum of positive numbers is smaller than the sum. Of course this condition also means that $$a_i^{\dagger}=a_i^T$$. By subtracting, we find $$(1-a_i)^Ta_i = 0.$$ But this is the same as $$\sum_j (1-a_{ij})a_{ij} = 0,$$ and since $$0 \leq a_{ij} \leq 1$$, every term in this sum is nonnegative. Hence every term is zero, so $$a_{ij}$$ is either $$0$$ or $$1$$. There can then only be exactly one nonzero entry in $$a_i$$ since $$\sum_j a_{ij} = 1$$. Since $$a_i^T a_j = 0$$ for orthogonality, we also find that each column can only have one nonzero term in it (if there were more, the corresponding vectors would not be orthogonal). Hence the matrix is as stated, with one $$1$$ in each row and in each column. It is easy to check that every such matrix is both stochastic and unitary.