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
- Pick the space (and N for the oscillator).
- 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.
- Optionally type what you expect in Check that it equals, for example i*Jz.
- 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.