Home / Science / Physics / Quantum mechanics / Operator algebra helperTool #929

Commutator and operator algebra helper: Pauli, spin, ladder operators, commutators and eigenvalues

Work with quantum operators as matrices: Pauli matrices, spin-j angular momentum (Jx, Jy, Jz, J±, J²) up to j = 5, two spin-½ particles, and the truncated harmonic oscillator (a, a†, n, x, p). Type any expression with products, powers, commutators, anticommutators and daggers, and get the matrix, whether it is Hermitian or unitary, its eigenvalues, trace and determinant, and a check against what you expect.

Keep it one tap away for everyday use.

Bookmark Operator algebra helper?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Space
  2. Expression
  3. Matrix
  4. Check
Nothing is uploadedWorks offline once open

Operators

Write products as A*B or A B, powers as A^2, commutators as [A, B], anticommutators as {A, B}, the adjoint as A' or dag(A); also tr(A), det(A), sqrt(…), i and pi. A number added to an operator means that number times the identity. ħ = 1 (and m = ω = 1 for the oscillator).

Result

Matrix

Download

What it does

Much of quantum mechanics is the algebra of operators: [Jx, Jy] = iħJz, {σx, σy} = 0, [a, a†] = 1. Checking such relations by hand means multiplying matrices, which is slow and easy to get wrong. This helper builds the standard operators as matrices, evaluates any expression you type, and tells you what the result is.

Choose a space:

  • Spin j from ½ to 5: Jx, Jy, Jz, Jp (J₊), Jm (J₋), J2 (J²) and the identity I, in the basis m = j, j − 1, …, −j. For spin ½ there are also the Pauli matrices X, Y, Z and the Hadamard H.
  • Two spins ½: Pauli matrices on each spin (X1, Y1, Z1, X2, Y2, Z2), spin operators Sx1 … Sz2, the total S2 and SWAP.
  • Harmonic oscillator cut off after N states: a, ad (a†), n, x, p and H = n + ½, with ħ = m = ω = 1.

How to use it

  1. Pick the space (and N for the oscillator).
  2. Type an expression. Products are A*B or just A B, powers A^2, commutators [A, B], anticommutators {A, B}, the adjoint A’ or dag(A). Numbers, i, pi, sqrt(…), tr(…) and det(…) work too. A number added to an operator counts as that number times the identity, as physicists write it.
  3. Optionally type what you expect in Check that it equals, for example i*Jz.
  4. Tap one of the ready-made examples to start.

What the results mean

  • The headline names the result when it is zero, a multiple of the identity, or a multiple of a named operator (so [Jx, Jy] comes out as i Jz).
  • Kind: Hermitian operators are observables with real eigenvalues; anti-Hermitian ones are i times an observable (every commutator of two observables is one); unitary ones keep lengths, as time evolution and quantum gates must.
  • Eigenvalues with their multiplicities, the trace and the determinant.
  • Check: whether your expected answer matches, with the largest difference between entries.

Worked example

The page opens on spin ½ with [Jx, Jy]. The result is [Jx, Jy] = i Jz: anti-Hermitian, eigenvalues −0.5i and 0.5i, trace 0, and the check “equal to i*Jz” passes. Switch to spin 3/2 and type J2: the headline reads J2 = 3.75 I, j(j + 1) = 15/4, with the eigenvalue 3.75 four times. In the oscillator with N = 6, [x, p] compared with i says not equal: the matrix is i on the diagonal except −5i in the last place, because cutting off the states breaks the relation at the top.

FAQ

Why is ħ missing? Everything is in units with ħ = 1, the usual choice; put it back by counting powers of J.

Are the eigenvalues exact? To about twelve figures. For matrices that cannot be diagonalised, such as a truncated a, repeated eigenvalues are less accurate, and the page says so. It is for study and checking, not a substitute for professional judgement.

Does anything get uploaded? No. All the algebra happens in your browser.

Where the numbers come from

  • Angular momentum matrices (with ⟨j, m ± 1|J±|j, m⟩ = √(j(j+1) − m(m±1))), Pauli matrices and harmonic oscillator ladder operators: standard textbook results, for example Sakurai, J. J. and Napolitano, J., Modern Quantum Mechanics.
  • Checked against NumPy (numpy.linalg.eigvals, eigvalsh, det and direct matrix products) written for the tests.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Related tools

Hydrogen orbital viewer #925 See any hydrogen-like orbital up to n = 7, real (pₓ, d_z², f_xyz ...) or complex: a slice of ψ coloured by sign, a turnable cloud of dots drawn from |ψ|², and the radial function and radial probability, with the energy, mean and most probable radius, nodes and the radius holding 90 % of the electron. Spin and Bloch sphere #926 Start a spin-½ or qubit in any state, apply H, X, Y, Z, S, T and rotations about any axis, and watch its path on a turnable Bloch sphere with the final amplitudes and probabilities. Drive it with a Rabi frequency and detuning, add T1 and T2 relaxation, and see the oscillation, the π-pulse length and the steady state. Quantum circuit simulator #927 Write or open an OpenQASM 2.0 program, or build a circuit gate by gate, and simulate it exactly in your browser for up to 20 qubits: circuit diagram, outcome probabilities and simulated shot counts, each qubit's Bloch vector, the full state vector, and the circuit saved back as OpenQASM 2.0. Perturbation theory checker #928 Type or paste a Hamiltonian H₀ and a perturbation V as matrices (real or complex, up to 40 × 40), choose λ, and get every level's first, second and third order corrections, degenerate levels included, side by side with the exact eigenvalues of H₀ + λV, a convergence warning and a plot of the exact levels against the second-order curves. 1D Schrödinger solver #923 Choose a textbook potential, type a formula or draw your own, and get the lowest energy levels and wavefunctions of the one-dimensional Schrödinger equation by the matrix (finite-difference) method, with the exact levels alongside for the box, harmonic oscillator, finite well, Morse, linear and Pöschl–Teller potentials. Wave packet tunnelling #924 Send a Gaussian wave packet at a rectangular barrier, double barrier, step, well or smooth barrier and watch it split into reflected and transmitted parts. The time evolution runs in your browser by the split-step Fourier method, and the reflection and transmission it finds are compared with the exact stationary transmission averaged over the packet's energies.