Simple Algorithm
Quantum Computing · Rydberg State · 26 min

Change of Basis & Unitary Equivalence

The same physics in different coordinates.

Measuring "in the XX basis" on hardware that only measures ZZ takes one Hadamard. Behind that trick is a general principle: a change of orthonormal basis is a unitary, and descriptions related by a unitary are the same physics. So when are two operators really the same up to coordinates?

What you’ll learn

  • Derive how coordinates and matrices transform under a change of orthonormal basis, and distinguish passive from active transformations.
  • Decide unitary equivalence: by spectra for normal operators, by trace invariants (Specht) in general.
  • Implement measurements in rotated bases by conjugating with unitaries.
  • Move between the Schrödinger, Heisenberg and interaction pictures.

The transition matrix

Let {∣ei⟩}\{\ket{e_i}\} and {∣fj⟩}\{\ket{f_j}\} be orthonormal bases of Cd\C^d. The transition matrix Wij=⟨ei∣fj⟩W_{ij}=\braket{e_i|f_j} has the new basis vectors, in old coordinates, as its columns; it is unitary because both bases are orthonormal. Inserting resolutions of the identity does everything:

DerivationCoordinates and matrices under a change of basis
  1. ⟨fj∣ψ⟩=∑i⟨fj∣ei⟩⟨ei∣ψ⟩⟹ψ(f)=W†ψ(e)\braket{f_j|\psi}=\sum_i\braket{f_j|e_i}\braket{e_i|\psi}\quad\Longrightarrow\quad\psi^{(f)}=W^\dagger\psi^{(e)}

    New coordinates of a vector:

  2. ⟨fj|A|fk⟩=∑i,l⟨fj∣ei⟩⟨ei|A|el⟩⟨el∣fk⟩⟹A(f)=W†A(e)W\mel{f_j}{A}{f_k}=\sum_{i,l}\braket{f_j|e_i}\mel{e_i}{A}{e_l}\braket{e_l|f_k}\quad\Longrightarrow\quad A^{(f)}=W^\dagger A^{(e)}W

    New matrix of an operator:

  3. (W†W)jk=∑i⟨fj∣ei⟩⟨ei∣fk⟩=⟨fj∣fk⟩=δjk(W^\dagger W)_{jk}=\sum_i\braket{f_j|e_i}\braket{e_i|f_k}=\braket{f_j|f_k}=\delta_{jk}

    Unitarity of WW is itself completeness:

  4. ⟨ψ|A|ψ⟩=⟨W†ψ|W†AW|W†ψ⟩\mel{\psi}{A}{\psi}=\mel{W^\dagger\psi}{W^\dagger AW}{W^\dagger\psi}

    Passive versus active. Rewriting the same state in new coordinates (passive) uses W†W^\dagger; physically rotating the state in fixed coordinates, ∣ψ⟩↦W∣ψ⟩\ket\psi\mapsto W\ket\psi (active), uses WW. Predictions are unchanged when states and observables transform together:

For a qubit, Clifford gates relate the standard bases. With W=HW=H (columns ∣±⟩\ket\pm): HZH=XHZH=X and HXH=ZHXH=Z. With W=SHW=SH (columns ∣±i⟩\ket{\pm i}): (SH)†Y(SH)=Z(SH)^\dagger Y(SH)=Z. To measure an observable A=WZW†A=WZW^\dagger on a ZZ-only device, apply W†W^\dagger and then measure ZZ; outcome 00 then certifies W∣0⟩W\ket0.

Unitary equivalence: what coordinates cannot change

Similarity, B=S−1ASB=S^{-1}AS with SS merely invertible, is weaker. J1=(1101)J_1=\begin{pmatrix}1&1\\0&1\end{pmatrix} and J2=(1201)J_2=\begin{pmatrix}1&2\\0&1\end{pmatrix} are similar (via S=diag⁡(2,1)S=\diag(2,1)), but Tr⁡J1†J1=3≠6=Tr⁡J2†J2\Tr J_1^\dagger J_1=3\neq6=\Tr J_2^\dagger J_2, so no change of orthonormal basis relates them. For normal matrices the two notions coincide.

DerivationCommuting normal operators share an eigenbasis
  1. Pk=∏l≠kA−alIak−al⟹BPk=PkBP_k=\prod_{l\neq k}\frac{A-a_l\id}{a_k-a_l}\quad\Longrightarrow\quad BP_k=P_kB

    Let A,BA,B be normal with AB=BAAB=BA and A=∑kakPkA=\sum_ka_kP_k. Each spectral projector is a polynomial in AA (Lagrange interpolation), so BB commutes with it:

  2. B(ran⁡Pk)⊆ran⁡PkB\big(\operatorname{ran}P_k\big)\subseteq\operatorname{ran}P_k

    So BB (and, taking adjoints, B†B^\dagger) maps each eigenspace of AA into itself, and its restriction there is still normal:

  3. A=∑nan∣n⟩ ⁣⟨n∣,B=∑nbn∣n⟩ ⁣⟨n∣A=\sum_na_n\dyad{n},\qquad B=\sum_nb_n\dyad{n}

    Diagonalize BB by an orthonormal basis inside each eigenspace. Together these diagonalize both, which is why commuting observables can be measured jointly:

Check your understanding

Which pair is unitarily equivalent?

  1. XX and SS
  2. ZZ and 2Z2Z
  3. XX and ZZ
  4. (1101)\begin{pmatrix}1&1\\0&1\end{pmatrix} and I\id
Show the answer

C. XX and ZZ

XX and ZZ are normal with the same spectrum {+1,−1}\{+1,-1\}; explicitly HZH=XHZH=X.

Pictures: time as a change of basis

Time evolution is a time-dependent unitary, so it can act on states or on observables. In the Schrödinger picture ∣ψ(t)⟩=U(t)∣ψ⟩\ket{\psi(t)}=U(t)\ket\psi and observables stay fixed. In the Heisenberg picture states stay fixed and AH(t)=U(t)†AU(t)A_H(t)=U(t)^\dagger AU(t). Predictions agree: ⟨ψ(t)|A|ψ(t)⟩=⟨ψ|AH(t)|ψ⟩\mel{\psi(t)}{A}{\psi(t)}=\mel{\psi}{A_H(t)}{\psi}.

DerivationThe Heisenberg equation and Larmor precession
  1. ddtAH(t)=eiHt(iHA−iAH)e−iHt=i[H,AH(t)]\frac{d}{dt}A_H(t)=e^{iHt}\big(iHA-iAH\big)e^{-iHt}=i\comm{H}{A_H(t)}

    For time-independent HH, U(t)=e−iHtU(t)=e^{-iHt} (ℏ=1\hbar=1). Differentiate AH(t)=eiHtAe−iHtA_H(t)=e^{iHt}Ae^{-iHt}:

  2. X˙H=iω2[Z,XH]=−ωYH,Y˙H=ωXH\dot X_H=i\tfrac\omega2\comm{Z}{X_H}=-\omega Y_H,\qquad \dot Y_H=\omega X_H

    Take H=ω2ZH=\tfrac\omega2Z (so ZH=ZZ_H=Z) and use [Z,X]=2iY\comm{Z}{X}=2iY, [Z,Y]=−2iX\comm{Z}{Y}=-2iX:

  3. XH(t)=Xcos⁡ωt−Ysin⁡ωt,YH(t)=Ycos⁡ωt+Xsin⁡ωtX_H(t)=X\cos\omega t-Y\sin\omega t,\qquad Y_H(t)=Y\cos\omega t+X\sin\omega t

    Solve. The observables rotate while the state stays put; in the Schrödinger picture the Bloch vector precesses instead. The two descriptions differ by the change of basis U(t)U(t).

The interaction picture splits H=H0+VH=H_0+V and moves only the easy part into the basis: ∣ψI(t)⟩=eiH0t∣ψ(t)⟩\ket{\psi_I(t)}=e^{iH_0t}\ket{\psi(t)} evolves under VI(t)=eiH0tVe−iH0tV_I(t)=e^{iH_0t}Ve^{-iH_0t}. For a driven qubit this is the rotating frame, where the rotating-wave approximation becomes visible (see Rabi Oscillations & the Rotating Frame).

Think first If states evolve as ρ↦UρU†\rho\mapsto U\rho U^\dagger, how must observables transform so that Tr⁡(ρA)\Tr(\rho A) is unchanged when you switch pictures?

By cyclicity, Tr⁡(UρU†A)=Tr⁡(ρ U†AU)\Tr(U\rho U^\dagger A)=\Tr(\rho\,U^\dagger AU), so the Heisenberg-picture observable is U†AUU^\dagger AU. For a general channel Φ\Phi this becomes the dual map Φ†\Phi^\dagger, defined by Tr⁡(Φ(ρ)A)=Tr⁡(ρ Φ†(A))\Tr\big(\Phi(\rho)A\big)=\Tr\big(\rho\,\Phi^\dagger(A)\big).

Canonical forms and complementary bases

Unitary equivalence also yields canonical forms. Schur: every A=UTU†A=UTU^\dagger with TT upper triangular. Singular value decomposition: every A=UΣV†A=U\Sigma V^\dagger, with one change of basis on the input and another on the output; this is behind the Schmidt decomposition. Clifford conjugation: the Clifford group consists exactly of the unitaries that map Pauli operators to Pauli operators up to phase, i.e. that permute the Pauli coordinate axes.

Two bases are mutually unbiased if ∣⟨ei∣fj⟩∣2=1d\abs{\braket{e_i|f_j}}^2=\tfrac1d for all i,ji,j: a basis vector of one gives uniformly random outcomes in the other. The ZZ, XX and YY bases of a qubit are pairwise unbiased, and the Fourier matrix Fjk=ωjk/dF_{jk}=\omega^{jk}/\sqrt d maps the computational basis to an unbiased one in every dd. At most d+1d+1 bases of Cd\C^d can be pairwise unbiased, and d+1d+1 are achieved when dd is a prime power (Wootters–Fields).

Key takeaways

  • A change of orthonormal basis is the unitary Wij=⟨ei∣fj⟩W_{ij}=\braket{e_i|f_j}: coordinates become W†ψW^\dagger\psi and matrices W†AWW^\dagger AW.
  • To measure A=WZW†A=WZW^\dagger with a ZZ detector, apply W†W^\dagger first; for YY that is S†S^\dagger, then HH.
  • Normal operators are unitarily equivalent iff their spectra agree; in general Specht's trace-word invariants decide, and similarity is weaker.
  • Commuting normal operators share an orthonormal eigenbasis, so commuting observables are jointly measurable.
  • The Schrödinger, Heisenberg and interaction pictures are the same physics in time-dependent coordinates, with A˙H=i[H,AH]\dot A_H=i\comm{H}{A_H}.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

With Wij=⟨ei∣fj⟩W_{ij}=\braket{e_i|f_j}, what is the matrix of AA in the new basis {∣fj⟩}\{\ket{f_j}\}?

  1. WA(e)W†WA^{(e)}W^\dagger
  2. W†A(e)WW^\dagger A^{(e)}W
  3. WTA(e)WW^TA^{(e)}W
  4. W−1A(e)W−1W^{-1}A^{(e)}W^{-1}
Show the answer

B. W†A(e)WW^\dagger A^{(e)}W

⟨fj|A|fk⟩=∑ilWij∗AilWlk=(W†AW)jk\mel{f_j}{A}{f_k}=\sum_{il}W_{ij}^*A_{il}W_{lk}=\big(W^\dagger AW\big)_{jk}.

Question 2

Two n×nn\times n Hermitian matrices are unitarily equivalent if and only if they have the same...

  1. trace and determinant
  2. rank
  3. eigenvalues, counted with multiplicity
  4. diagonal entries in the computational basis
Show the answer

C. eigenvalues, counted with multiplicity

Hermitian matrices are normal. If both have spectrum DD (with multiplicity), then A=U†DUA=U^\dagger DU and B=V†DVB=V^\dagger DV, so B=(U†V)†A (U†V)B=(U^\dagger V)^\dagger A\,(U^\dagger V).

Question 3

You can only measure in the ZZ basis. Which gates, in time order, should precede the measurement so that outcome 00 certifies ∣+i⟩\ket{+i} and outcome 11 certifies ∣−i⟩\ket{-i}?

  1. S†S^\dagger, then HH
  2. HH, then S†S^\dagger
  3. HH only
  4. S†S^\dagger only
Show the answer

A. S†S^\dagger, then HH

HS†∣+i⟩=H∣+⟩=∣0⟩HS^\dagger\ket{+i}=H\ket+=\ket0 and HS†∣−i⟩=H∣−⟩=∣1⟩HS^\dagger\ket{-i}=H\ket-=\ket1. This is W†W^\dagger for W=SHW=SH, whose columns are ∣±i⟩\ket{\pm i}: undo the basis change, then measure ZZ.

Question 4

Are J1=(1101)J_1=\begin{pmatrix}1&1\\0&1\end{pmatrix} and J2=(1201)J_2=\begin{pmatrix}1&2\\0&1\end{pmatrix} unitarily equivalent?

  1. Yes: they have the same eigenvalues
  2. Yes: they are similar, which is the same thing
  3. No: their traces differ
  4. No: Tr⁡J1†J1=3\Tr J_1^\dagger J_1=3 but Tr⁡J2†J2=6\Tr J_2^\dagger J_2=6
Show the answer

D. No: Tr⁡J1†J1=3\Tr J_1^\dagger J_1=3 but Tr⁡J2†J2=6\Tr J_2^\dagger J_2=6

Tr⁡A†A=∥A∥22\Tr A^\dagger A=\norm A_2^2 is a unitary invariant, and it differs. They are similar via S=diag⁡(2,1)S=\diag(2,1), but similarity allows non-orthonormal bases.

Further reading

  • R. A. Horn & C. R. Johnson, Matrix Analysis, ch. 2 (Cambridge, 2nd ed., 2013).
  • J. J. Sakurai & J. Napolitano, Modern Quantum Mechanics, ch. 2 (Cambridge, 3rd ed., 2020).
  • W. K. Wootters & B. D. Fields, "Optimal state-determination by mutually unbiased measurements," Ann. Phys. 191, 363 (1989).
  • T. Durt, B.-G. Englert, I. Bengtsson & K. Życzkowski, "On mutually unbiased bases," Int. J. Quantum Inf. 8, 535 (2010).
  • D. Janzing, P. Wocjan & T. Beth, "'Non-identity check' is QMA-complete," Int. J. Quantum Inf. (2005).