Quantum Computing Master Course — 009. Bases and Coordinate Changes
Lesson 009: Bases and Coordinate Changes
Smartyfy Quantum Computing Master Course
Prerequisites and objectives
Use the vector, norm, and inner-product rules from Lessons 003–008. You will identify an orthonormal basis, extract coordinates with inner products, reconstruct a state, and distinguish a change of description from a physical gate. The goal is to make basis-dependent statements precise rather than to memorize several unrelated representations.
A basis supplies reference vectors
A basis is an independent set of vectors whose linear combinations span the space. Independence means no vector in the set is redundant; spanning means every vector in the space can be constructed. In a two-dimensional complex space, two independent vectors form a basis. The MIT lesson on basis and dimension develops this general algebraic definition.
Our standard basis is |0⟩ = [1, 0] and |1⟩ = [0, 1]. It is orthonormal: each vector has unit norm, and their inner product is zero. The vector |ψ⟩ = α|0⟩ + β|1⟩ has coordinate list [α, β] relative to this basis. The list is not a description independent of its reference vectors.
Another orthonormal basis is |+⟩ = [1, 1]/√2 and |−⟩ = [1, −1]/√2. Their norms are one, their inner product is zero, and their independent combinations cover the same two-dimensional space. Changing the basis does not add an extra qubit or expand the number of dimensions.
Extracting coordinates by inner products
Suppose |ψ⟩ = c0|f0⟩ + c1|f1⟩ in an orthonormal basis. Taking the inner product with f0 gives ⟨f0|ψ⟩ = c0⟨f0|f0⟩ + c1⟨f0|f1⟩ = c0. The first factor is one and the cross term is zero. Similarly c1 = ⟨f1|ψ⟩.
This is why orthonormal bases are especially convenient: overlaps directly return coefficients. For a general independent but nonorthonormal basis, the coefficients still exist uniquely, but this simple extraction formula usually fails. You must solve the relevant linear equations or use a suitable dual basis, which is outside today’s scope.
Worked example in the plus/minus basis
Take |ψ⟩ = [3, 1]/√10. Its norm is one because (9 + 1)/10 = 1. In the standard basis, measurement probabilities are 9/10 and 1/10. To find its plus/minus coordinates, calculate c+ = ⟨+|ψ⟩ = (3 + 1)/√20 = 2/√5 and c− = ⟨−|ψ⟩ = (3 − 1)/√20 = 1/√5.
The same state can therefore be written |ψ⟩ = (2/√5)|+⟩ + (1/√5)|−⟩. Reconstruct it to check: the first standard coordinate is (2 + 1)/√10 = 3/√10, while the second is (2 − 1)/√10 = 1/√10. This independent reconstruction is a powerful defense against swapped basis vectors or missing conjugates.
The coefficient magnitudes squared sum to one: 4/5 + 1/5 = 1. A projective measurement in the plus/minus basis consequently has probabilities 0.8 and 0.2. There is no contradiction with the standard-basis probabilities 0.9 and 0.1. These are predictions for two different measurement choices applied to the same preparation.
![The same normalized state[3,1]/square root10 branches into two measurement choices. Computational amplitudes3/square root10 and1/square root10 give probabilities0.9 and0.1. Plus/minus coefficients2/square root5 and1/square root5 give0.8 and0.2, shown with common-scale bars.](https://smartyfy.mrindigi.com/wp-content/uploads/2026/10/quantum-009-measurement-bases.png)
Superposition depends on the basis
The state |+⟩ has two nonzero coordinates in the standard basis, but coordinates [1, 0] in the plus/minus basis. Thus the statement “this state is a superposition” needs a reference basis to be informative. It does not designate a mysterious extra category of object independent of our representation.
Every normalized pure state can be included as a vector in some orthonormal basis. That mathematical fact does not mean a person holding one unknown copy can discover the state or freely select its exact measurement basis. Describing a known model and learning an unknown preparation are different tasks with different resource requirements.
A complex basis and the conjugation check
Define |r⟩ = [1, i]/√2 and |l⟩ = [1, −i]/√2. Their inner product is (1 + (−i)(−i))/2 = (1 − 1)/2 = 0. They are normalized, so they provide another orthonormal basis. The names r and l are labels here, not claims about a particular physical implementation.
For |ψ⟩ = |r⟩, the coordinates in this basis must be [1, 0]. Calculating ⟨r|r⟩ without conjugating the first vector would wrongly give zero. This simple self-test makes complex bases useful for detecting an inner-product implementation that accidentally uses the real dot-product rule.
Changing coordinates versus applying a gate
Let B have the new basis vectors as columns. Multiplying B by a list of new-basis coefficients reconstructs the old-basis coordinates. For the plus/minus basis, B = [[1, 1], [1, −1]]/√2. This particular matrix is its own inverse, so applying it to standard coordinates also produces the plus/minus coefficients.
The same numerical formula can describe a different operation: physically applying a Hadamard gate while keeping the measurement basis fixed. A passive coordinate change describes the original state using new reference vectors. An active gate changes the state in the existing description. Change-of-basis mathematics helps keep these interpretations separate.
Operationally, measuring in a chosen basis can often be implemented by a corresponding inverse basis transformation followed by standard-basis measurement. We will derive this carefully using adjoints. Today, state clearly whether you are relabeling coordinates, choosing a different measurement, or applying a physical transformation.
Local reconstruction check
The code calculates new coefficients with inner products and rebuilds the original vector. The probability output is [0.8, 0.2], and the reconstruction check returns true. Everything is calculated locally from a specified state; no experiment learns these amplitudes from a device.
from math import sqrt, isclose
def inner(u, v):
return sum(complex(a).conjugate() * b for a, b in zip(u, v))
plus = [1/sqrt(2), 1/sqrt(2)]
minus = [1/sqrt(2), -1/sqrt(2)]
psi = [3/sqrt(10), 1/sqrt(10)]
coordinates = [inner(plus, psi), inner(minus, psi)]
reconstructed = [coordinates[0]*plus[k] + coordinates[1]*minus[k]
for k in range(2)]
print("new-basis probabilities:",
[round(abs(c)**2, 10) for c in coordinates])
print("reconstruction matches:",
all(abs(a-b) < 1e-12 for a, b in zip(psi, reconstructed)))
assert isclose(abs(coordinates[0])**2, 0.8, abs_tol=1e-12)
assert isclose(abs(coordinates[1])**2, 0.2, abs_tol=1e-12)
assert all(abs(a-b) < 1e-12 for a, b in zip(psi, reconstructed))
Four exercises
- Express |0⟩ in the plus/minus basis, then reconstruct its standard coordinates.
- Find the plus/minus coefficients of [1, 2]/√5 and their corresponding measurement probabilities.
- Are [1, 0] and [1, 1] orthonormal? If ψ = [0, 1], show why their inner products with ψ are not its expansion coefficients.
- For r and l defined above, calculate the r/l coordinates of |1⟩ and verify reconstruction.
Exercise solutions
- Both overlaps equal 1/√2. Then (|+⟩ + |−⟩)/√2 = [1, 0], because the second coordinates cancel.
- The coefficients are 3/√10 and −1/√10. Their squared magnitudes are 9/10 and 1/10. The negative coefficient remains important for reconstruction.
- No: the second norm is √2 and the cross inner product is one. The overlaps are zero and one, which would reconstruct [1, 1]. The correct coefficients are −1 and one, since −[1, 0] + [1, 1] = [0, 1].
- The coefficients are −i/√2 and i/√2. Their first-coordinate contributions cancel; their second-coordinate contributions each equal one half, reconstructing [0, 1].
Five multiple-choice checks
-
In an orthonormal basis, a coefficient is obtained by: A. Summing probabilities. B. Taking the appropriate inner product. C. Ignoring phases. D. Counting nonzero entries.
Answer: B. Orthogonality removes cross terms and normalization sets the remaining factor to one.
-
A passive basis change alters: A. The physical state automatically. B. Its number of qubits. C. Its coordinate description. D. The laws of measurement.
Answer: C. The reference vectors change while the underlying state remains the same.
-
The coordinates of |+⟩ in the plus/minus basis are: A. [1, 0]. B. [0, 1]. C. [1, 1]. D. [0, 0].
Answer: A. It is the first basis vector itself.
-
Which check best tests a calculated coordinate change? A. Discarding imaginary parts. B. Reconstructing the original vector. C. Sorting coefficients. D. Rounding all entries to integers.
Answer: B. Correct coefficients and basis vectors must reproduce the original representation.
-
Different probabilities in two measurement bases imply: A. A contradiction. B. An invalid state. C. Failed normalization. D. Different measurement questions.
Answer: D. A single preparation can yield different distributions under different measurements.
Pitfalls and summary
Write the basis and its order, verify orthonormality before using overlap coefficients, and reconstruct your answer. Coordinates, gates, and measurement choices are related but distinct. The next lesson combines these ideas in a cumulative foundations checkpoint.
Primary sources and further study
These sources support the definitions and context. The numerical examples, exercises, and explanations here were prepared for this lesson. Research papers are optional advanced reading.