# How to get probability when the coefficient in wave function is a matrix?

Following this circuit:

With $$\mathcal{G}, A$$ being unitary matrices and $$|\psi\rangle$$ the initial state.

First, the system is:

$$\frac{1}{\sqrt{2}}(|0\rangle+|1\rangle)\;\otimes|\psi\rangle$$

Next:

$$\frac{1}{\sqrt{2}}(|0\rangle\otimes\mathcal{G}|\psi\rangle+|1\rangle\otimes A|\psi\rangle)$$

This paper shows that:

A measurement of the ancilla selects one of the two branches and results in either the state $$\mid\psi^{'}_0\rangle=\frac{1}{2 \sqrt{p_0}}(\mathcal{G}+A)\mid\psi\rangle$$ with probability $$p_0=\frac{1}{4}\langle\psi\mid(\mathcal{G}+A)^\dagger(\mathcal{G}+A)\mid\psi\rangle$$

This sentence makes me confused about how to get the amplitude when it is a matrix? And how about the state $$\mid\psi^{'}_0\rangle$$, I think it should be $$\frac{1}{2}(\mathcal{G}+A)$$

The initialization of the $$\psi$$ state is more than one qubit. For n qubits, it's state is in $$2^n$$ dimensions. Coming back to your question, compute your state with the operator $$G+A$$, i.e. $$\frac{1}{2}(G+A) |\psi\rangle=|\phi\rangle$$, for some state $$|\phi\rangle$$.
Now the probability of $$|\phi\rangle$$ is $$\langle\phi|\phi\rangle=p_0=\frac{1}{4}\langle\psi|(G+A)^{\dagger}(G+A)|\psi\rangle$$.
The state $$|\psi^{'}_0\rangle$$ is normalized, that's why it has co-efficient $$\frac{1}{2\sqrt{p_0}}$$.
$$\langle\psi^{'}_0|\psi^{'}_0\rangle$$= $$\frac{1}{4p_0}\langle\psi|(G+A)^{\dagger}(G+A)|\psi\rangle$$=1.
• Oh, thanks. But how about the state $\mid\psi^{'}\rangle$, why $\sqrt{p_0}$ is still here? Jun 11 at 2:14