# Reasoning behind unitary freedom in the ensemble for density matrices theorem

Although my question has the same title of a different question, it is not a duplicate. I am asking a different question. I don't care why it made it into the book.

Here is a theorem from Nielsen & Chuang: the second half of the last sentence doesn't matter

What is a good way to think about why this is true?

My reasoning:

Theorem 2.6 states that a unitary transformation, such as ‘Uij’, does not alter the quantum system's underlying properties.

Intuitively:

The unitary transformation can be viewed as a generalization of the global phase factor. It won't affect the probability of the qubit being in each state.

**However, my reasoning doesn't make sense to me because the Pauli-X gate is a unitary transformation and will change a state from |0> to |1>, so the state vector and density matrix are different for those states and all we applied was a unitary transformation, so I don't see how this theorem can say a unitary transformation is irrelevant. **

Mathematically:

When the outer product of the state vector is calculated, the unitary transformation is multiplied by its conjugate transpose to form the identity, leaving the state unchanged.