Compute quantum commutators for matrices in physics with ease. Explore noncommutativity, traces, and diagnostics quickly. Validate operator algebra and study symmetry in seconds today.
The commutator of two operators A and B is defined as: [A,B] = AB − BA. For matrix operators, AB and BA are standard matrix products.
The anticommutator is: {A,B} = AB + BA. A and B commute when [A,B] equals the zero matrix.
This calculator also reports the Frobenius norm of [A,B]. It can test commutation using your chosen tolerance.
| Case | Matrix A | Matrix B | [A,B] | Commute? |
|---|---|---|---|---|
| Pauli example | 1 0; 0 -1 |
0 1; 1 0 |
0 2; -2 0 |
No |
| Diagonal pair | 2 0; 0 3 |
5 0; 0 7 |
0 0; 0 0 |
Yes |
The commutator is defined as [A,B] = AB − BA. It measures how strongly the order of two operations matters. When [A,B]=0, A and B commute and can be applied in either order without changing the outcome for matrix multiplication.
In quantum mechanics, observables are represented by operators. A non‑zero commutator indicates incompatibility and links directly to measurement limits through the Robertson relation ΔA·ΔB ≥ ½|⟨[A,B]⟩|. A classic data point is [x,p]=iħ, which embeds Planck’s constant in the algebra.
This calculator treats A and B as square matrices of the same size n×n. It computes two products, AB and BA, then subtracts element‑wise to form [A,B]. The cost scales roughly as O(n³), because each matrix product uses n dot products per entry.
For Pauli‑like matrices A=[[1,0],[0,−1]] and B=[[0,1],[1,0]], the commutator is [A,B]=[[0,2],[−2,0]]. The non‑zero off‑diagonal values show that reversing the order flips signs and changes the resulting transformation.
If the output matrix is all zeros, A and B commute for the chosen inputs. Many diagonal pairs commute, while mixing a diagonal matrix with a rotation‑like matrix often produces a structured, antisymmetric‑looking result. Small values close to zero can also appear from rounding; adjust decimals to check stability.
The optional expectation calculation evaluates ⟨ψ|[A,B]|ψ⟩ / ⟨ψ|ψ⟩ for a real state vector ψ. This is useful when you want a single scalar that summarizes how the commutator “acts” on a particular state rather than inspecting every matrix element.
The commutator inherits units from the product of the two inputs. For example, if A has units of energy and B has units of time, then [A,B] has energy‑time units. Rescaling A by a factor k scales the commutator by the same k.
Commutators appear in angular momentum algebra, ladder operators, quantum harmonic oscillators, and symmetry testing. In linear systems, they also act as a quick diagnostic for whether two transformations can be simultaneously diagonalized, which is valuable in eigen‑analysis and mode decoupling. It also appears in control models and filtering math.
It accepts two square matrices A and B of the same size. Enter rows separated by semicolons or new lines, and values separated by spaces or commas.
A zero commutator means AB equals BA for your inputs. In physics, that often implies compatible operations or observables that can share a common eigenbasis.
Yes. Decimals and scientific notation like 1e−3 are supported. Use the decimals option to control rounding in the displayed table and downloads.
Floating‑point arithmetic can introduce tiny rounding differences, especially for larger matrices or mixed magnitudes. Increase displayed decimals to verify whether values are truly non‑zero.
It computes a single scalar ⟨ψ|[A,B]|ψ⟩/⟨ψ|ψ⟩ using a real vector ψ. This helps connect the commutator to state‑dependent uncertainty or dynamics checks.
This version is designed for real numbers. If you need complex matrices, you can still separate real and imaginary parts, or request an extended version with complex arithmetic.
Start with 2×2 or 3×3 for conceptual work. Computation time grows roughly with n³, so very large matrices will be slower and harder to interpret.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.