Pauli Expectation Values
Pauli Expectation Values
The expectation value of an observable in quantum state is:
This is the average outcome of measuring many times when the system is in state . Expectation values are the fundamental output of variational quantum algorithms such as VQE and QAOA.
The Pauli Matrices
Every single-qubit Hermitian observable can be written as a linear combination of the three Pauli matrices and the identity:
Each has eigenvalues .
Computing Expectation Values
For a qubit state , write out the matrix products:
Z expectation:
This is simply the probability of measuring minus the probability of measuring .
X expectation:
Y expectation:
Special States
| State | |||
|---|---|---|---|
| $ | 0\rangle = (1, 0)$ | ||
| $ | 1\rangle = (0, 1)$ | ||
| $ | +\rangle = \frac{1}{\sqrt{2}}(1, 1)$ | ||
| $ | -\rangle = \frac{1}{\sqrt{2}}(1, -1)$ | ||
| $ | +i\rangle = \frac{1}{\sqrt{2}}(1, i)$ |
These correspond exactly to the six face-centres of the Bloch sphere: states aligned with the positive and negative , , and axes have expectation value or along their axis and along the others.
Bloch Sphere Connection
A pure state on the Bloch sphere at polar angle and azimuthal angle is:
Its Pauli expectation values give the Cartesian coordinates of the Bloch vector:
Your Task
Implement pauli_expectation(state, pauli) where state is a 2-element list (possibly complex) and pauli is 'X', 'Y', or 'Z'. Return the real-valued expectation value.