A Byte of PhysicsLogo

Operators and observables

An operator is a rule that transforms a quantum state. An observable is a particular kind of operator whose possible measurement results are its eigenvalues. The distinction matters in code: a function that returns a number is not automatically a measurement model; it needs a state representation, basis, domain, and interpretation.

Think like a programmer

Represent complex state as a vector and an operator as a pure function or matrix action over that vector. Keep dimensions, boundary policy, basis, units, and Hermitian requirement beside the implementation. Compute an expectation from a complex inner product; do not average array components and call the result an observable.

Model checklist

Inputs
Complex state samples or coefficients, an operator definition, basis, grid and boundary policy when needed.
State
The original vector ψ, transformed vector Aψ, and norm ⟨ψ|ψ⟩.
Rule
Apply A, take the conjugate inner product with ψ, then divide by the norm.
Output
Expected value, possible eigenvalues, and measurement probabilities in the chosen basis.
Check
A normalized eigenstate of A returns its eigenvalue; an observable's expectation is real within tolerance.

The normalized expectation of an operator  is

\[\langle A\rangle=\frac{\langle\psi|\hat A|\psi\rangle}{\langle\psi|\psi\rangle}\]

For finite vectors, the inner product conjugates the left state:

\[\langle\phi|\psi\rangle=\sum_j\phi_j^*\psi_j\]
const numerator = complexInnerProduct(state, applyOperator(state));
const denominator = complexInnerProduct(state, state);
const expected = complex(numerator.real / denominator.real, numerator.imaginary / denominator.real);

The code rejects empty or mismatched vectors and a nonpositive norm. For a Hermitian operator, the imaginary part of expected should be near zero; reporting a large imaginary component is a diagnostic that the matrix, boundary policy, or arithmetic is wrong. In a two-state basis, an operator that preserves the first component and negates the second has expectation zero for the equal state [1, 1] after normalization. That is a compact regression fixture.

An expectation value is not the outcome of one measurement. If |a⟩ is an eigenstate with eigenvalue a, measuring the corresponding observable produces a with certainty. A superposition can have an expectation between eigenvalues while each individual measurement still returns one allowed eigenvalue according to the Born rule.

Try this experiment

Prediction: A normalized eigenstate is a fixed point up to scaling under its operator, so its expectation equals the associated eigenvalue.

Choose a two-component diagonal operator with eigenvalues +1 and −1. Evaluate its expectation for [1, 0], [0, 1], and [1, 1]. Predict which outputs are possible single measurements and which one is only an average.

Where this model breaks

Finite vectors and matrices are representations, not the full Hilbert-space story. Differential operators need domains and boundary conditions; unbounded operators need extra mathematical care. This lesson omits degeneracy handling, mixed states, generalized measurements, continuous spectra, spin conventions, and the physical mechanism of a detector.

Summary

Treat an observable as a tested complex-state transformation with a declared basis and domain. Use conjugate inner products, normalize explicitly, check real-valued expectations for Hermitian operators, and keep expectation values distinct from individual measurement outcomes.

Glossary

Self-check

  1. Why must the left vector be conjugated in a complex inner product?
  2. What should a Hermitian observable's expectation look like numerically?
  3. Why can an expectation differ from every single measurement outcome?

Sources

Model contract

Treat the lesson as a small function before treating it as a fact to memorize. Give every value a unit, keep only the state needed for the next step, and make the output easy to inspect.

\[\text{observable output} = f(\text{inputs},\,\text{state})\]
Inputs
Quantities you set or measure, with units and useful bounds.
State
Values the program must retain to reproduce the next result.
Rule
The relationship or update that turns inputs and state into a result.
Check
A known limit, unit check, invariant, or measured result that can expose a bad model.

Implement the idea as a model

For Operators and Observables, write down the quantities you can control, the values your program must retain, and the result a reader could inspect. In Quantum Beginnings, the useful program is not the drawing: it is the smallest explicit model that makes a prediction you can test.

Guided experiment

Prediction: changing one declared input while holding the others fixed should change only the outputs that the model connects to that input. Choose one input, predict the direction of change, then check a limiting case such as zero, a symmetric arrangement, or a familiar low-speed or small-change approximation.

Where this model breaks

This lesson is a teaching model, not a complete simulator. Before using it outside the stated question, check which interactions, scales, uncertainties, boundary conditions, and measurement limits it leaves out.

Summary

Treat Operators and Observables as a contract: named inputs and units enter a rule, the rule produces an observable result, and a known limit or invariant checks whether the implementation deserves trust.

Glossary

  • Input: a measured value or chosen parameter supplied to a model.
  • State: the smallest set of values needed to continue or reproduce a model.
  • Validation: comparing an output with a known result, limit, invariant, or measurement.

Self-check

  1. Which values are inputs, and which values must remain state?
  2. What observable result would tell you the model is behaving as expected?
  3. Which assumption would you test first before applying the model to a real system?

Model review: turn Operators and Observables into a test

Implement observables as explicit complex-state transformations with documented representation and tests.

  1. Name the inputs and units that the quantum beginnings model needs.
  2. Separate the state you must keep from values you can calculate when needed.
  3. Write one rule that maps the current state and inputs to an observable result.
  4. Choose a limiting case, unit check, invariant, or known result before trusting an output.
  5. State one assumption you would change before using this simplified model for a real decision.

Share to: