# Measurement of qubit w.r.t basis
A qubit can be measured w.r.t to a basis. The result is one of the two basis. The output basis is sampled with probability equal to square norm of the qubit projection on that basis.
Let $\ket\psi$ be a qubit and we want to measure it w.r.t basis $\{\ket{b_0},\ket{b_1}\}$, then compute $|\langle \ket\psi,\ket{b_0} \rangle|^2$ .
Why is the inner product the projection?
assume $\ket\psi=\alpha\ket{b_0}+\beta\ket{b_1}$ , then inner product with $\ket{b_0}$ result in $\alpha$ as required.
## Computation basis and Hadamard basis
![[Pasted image 20260526112349.png|331]]
## Breidbart basis
![[Pasted image 20260526112444.png|332]]
note: this basis is used in [[CHSH game]]
There are many possible basis. The most common are the computational basis and the Hadamard basis.
## Examples
- $\ket\psi=\frac{3}{5}\ket0+\frac{4}{5}\ket1$ , measured in the computational basis $\{\ket0,\ket1\}$ . compute $P(0),P(1)$. Solution: $P(0)=(3/5)^2,P(1)=(4/5)^2$.
- $\ket\psi=\ket0$, measured in the Hadamard basis $\ket+:=\frac{\ket0+\ket1}{\sqrt 2},\ket-:=\frac{\ket0-\ket1}{\sqrt 2}$. compute $P(\ket+),P(\ket-)$ . Solution: the projection is $1\cdot\cos(\pi/4)=\sqrt2/2$ so $P(\ket+)=1/2$. The projection on $\ket -$ should be seen on its opposite site with angle $-\pi/4$.
- $\ket\psi=\ket0$, measured in the Breidbart basis $\{b_0,b_1\}$ where $b_0=\cos(\frac{\pi}{8})\ket0+\sin(\frac{\pi}{8})\ket1$ , $b_1=-\sin(\frac{\pi}{8})\ket0+\cos(\frac{\pi}{8})\ket 1$ compute $P(b_0),P(b_1)$. Solution: The projection on $b_0$ is $\langle b_0,\psi\rangle=\cos(\pi/8)$ so $P(b_0)=cos^2(\pi/8)=0.85$ and so $P(b_1)=1-P(b_0)= 0.15$ .
- $\ket\psi=\frac{\ket0+\ket1}{\sqrt 2}$, measured in the Breidbart basis $\{b_0,b_1\}$ where $b_0=\cos(\frac{\pi}{8})\ket0+\sin(\frac{\pi}{8})\ket1$ , $b_1=-\sin(\frac{\pi}{8})\ket0+\cos(\frac{\pi}{8})\ket 1$ . compute $P(b_0),P(b_1)$. Solution: reminder $\cos(\theta)=\langle v_1,v_2\rangle/\|v_1\|\|v_2\|$ . as the norm of qubits is $1$ we have that the projection equals to $\langle v_1,v_2\rangle$. The projection on $b_0$ is $\langle b_0,\psi\rangle=(\cos(\pi/8)+\sin(\pi/8))/\sqrt 2$ so $P(b_0)=0.8536$. Similarly for $P(b_1)$.
## Created 2026-07-12 16:19