In my last post, I shared five questions to help you get really good at the linear algebra needed for quantum computing. Let’s dive in and solve the fourth one step by step.
Question 4
Given two matrices A and B:
Compute the commutator
[A,B] = AB − BACheck if
AandBcommute.
Solution 4
A commutator tells us whether the order of multiplying two matrices matters.
For two matrices A and B, it is defined as:
[A,B] = AB − BA
If the result is zero, or AB = BA, we say that A and B commute.
Let’s first calculate AB as follows:
Next, we calculate BA as follows:
The commutator is calculated as follows:
Since [A,B] ≠ 0, A and B do not commute.
Thanks for being a curious reader of ‘Into Quantum’, a publication that teaches essential concepts in quantum computing from the ground up. To get even more value from this publication, consider becoming a paid subscriber.




