Pauli Operator, Commutator, Bloch sphere, Binary Operation, and Cyclic Group¶
Sometimes a thing called "Commutator" is being used in Quantum Computing. In some particular algorithm that solve certain equation, Commutator is used extensively. However the problem is, how can we implement this function fast. The current implementation expecially in the quantum simulation package called OpenFermion is super slow, and I think maybe I can do a better job.
- What is commute
- What is Binary Operation
- Commutator in 20 word
- Pauli Operator
- What is Bloch Sphere
- Pauli Operator form a Cyclic Group
- How to Make Fast Commutator
What is commute¶
"Commute" is a algebraic property in mathematics. Let say that you have some operation. Say "go to toilet" and "wash hand". And when you execute those operation, in different order, the outcome and meaning is completely different.
Text Only | |
---|---|
1 2 |
|
However the best option should be
Text Only | |
---|---|
1 |
|
Then we say "go to toilet" and "wash hand" is NOT COMMUTE. We cannot change the their order arbitrarily. So this is "not commute". Then what is "commute"?
Think of "walking front" and "walking left". No matter what order you walk, you must go to the same after position. Then we say walking front" and "walking left" is COMMUTE.
When two operation is COMMUTE, they are INDEPENDENT operation with respect to each other. Doing one operation do not affect anything in another operation. Like moving up and down will not have any affection on the horizontal position of that thing.
So a commutator is a function that we use to check whether two operation is commute with each other or not. It is a binary operation.
What is Binary Operation¶
"Plus" and "Muliplication" is binary operation. They are used to make a relationship of two object.
Text Only | |
---|---|
1 2 3 |
|
There is a machine called "PLUS" and you can only input two value into it. And then after that it produce a new value.
Text Only | |
---|---|
1 |
|
This machine/function can take only two number. Likewise, commutator is binary operation.
Commutator in 20 word¶
Text Only | |
---|---|
1 2 3 |
|
Explain: if A and B commute, then AB should have the same value as BA. And because of that, when you subtract them, you are subtracting the same value. So the result must be zero.
State it inversely. If AB subtract BA is not equal to zero, A and B is not commute to each other.
Pauli Operator¶
Pauli Operator a set of operation in quantum computing. They are denoted as
Text Only | |
---|---|
1 |
|
In their matrix form
Text Only | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Why is this name. Because they represented the rotation axis of Bloch Sphere. Each Pauli Operator mean that you rotate the Bloch Sphere in the same axis of its name.
Text Only | |
---|---|
1 2 3 4 |
|
What is Bloch Sphere¶
Bloch Sphere is used in vistualizing a quantum state. It is a ball, or a sphere, or a globe.
But in fact this thing is totally useless in everyday quantum computing. But I think it might help you understanding more about how the proterty of "commute" related to Pauli Operator.
So a sphere has three axis namely X Y Z.
To introduce those axis. I would not tell you to take out you hand and say "right hand rule" or something like that because some folks may not have right hand. So instead I will use your head.
Think of you head. There is a arrow sticking through your right and left ears. That is the X axis.
Another arrow sticking through your nose and back of your head. That is Y axis.
And the last arrow go through your neck and top of you head. That is Z axis.
So you try rotating X axis. Rotate you head with respect to ear axis. Doing so, you point your head to the groud. And you find that your nose will not be facing the front any more. Your nose is facing the back now. And of course your head is pointing at different direction. Therefore you know that rotating X axis is not independent from Y and Z axis.
Likewise, try rotate the Z axis. Namely, facing front, then turn your body 180 degree and now you are facing the back. And you know that you cannot do this without changing the direction of your nose and ears. Again, Z axis is not independent from X and Y axis.
Therefore the action of rotating X Y Z axis is complely NOT COMMUTE. Same for the Pauli Operator.
Text Only | |
---|---|
1 2 3 |
|
But one thing is independent. Let say you and your friend is standing side by side. No matter how your friend's head rotate, that do not affect you. Your head and your friend's head is completely independent from each other. This is the principle of Pauli Operator's tensor product. It is internally independent.
Text Only | |
---|---|
1 |
|
See that Z2 is unchanged. Because X1 only act on index 1. Although X1 is NON COMMUTE with Z1, it is COMMUTE with Z2.
Pauli Operator form a Cyclic Group¶
You do not need to know what mathematically a "Group" is. The only thing you need to know is this "Cyclic Group".
So the problem is, yup Pauli Operator is NON COMMUTATIVE. But how can we predict the outcome of it? Here I write all the combination out. Let see you can spot out the pattern.
Text Only | |
---|---|
1 2 3 4 5 6 |
|
For the I, because it stand for Identity and do nothing, IX = X and XI = X, etc, so I omit it.
And you can see whatever you do, the result must be something within {X, Y, Z}. That "i" is imaginary number. Usually we ignore it because i is also independent with all Pauli Operator.
So the rule is, think of it as a circle of triangle. Counting XYZ clockwise and anticlockwise.
Text Only | |
---|---|
1 2 |
|
X -> Y is clockwise, which is positive, and you got the next element Z. Hence iZ
Y -> X is anticlockwise, so you must have negative, and then the next element Z. Hence -iZ.
Same law apply to all others.
Or you can do this. List out all possible combination in a string.
Text Only | |
---|---|
1 |
|
Say, ZY, so you look for it and find the matching pattern
Text Only | |
---|---|
1 |
|
And follow the direction of the arrow, the next element is X. Thus ZY = -iX because the arrow is pointing at left.
This property is said to be the Cyclic Group.
But what about XX, or YY, or ZZ?
This is kind of simple. If the same thing happened twice, nothing happened after all. i.e
Text Only | |
---|---|
1 2 3 4 |
|
Why is that. Because just as what I mention earlier,
Text Only | |
---|---|
1 |
|
So what happen if you do operation X twice?
Text Only | |
---|---|
1 |
|
That is the same as
Text Only | |
---|---|
1 |
|
You can verify all these in the matrix form if you know how to do matrix multiplication. Or with some help of computer program, you should be able to get the same result.
How to Make Fast Commutator¶
So these knowledge lay the foundation for implementing Commutator in a faster way.
To avoid getting too theoretical, I will first show you how to work on real world example.
Here is a matrix generated from H2 molecule. Don't worry if this is your first time to do chemical calculation. It is just a bunch of number and stuffs. I don't even know what they mean exactly. Knowing how to deal with Pauli Operator is just enough for the task.
Text Only | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
The task is, we have to check that if this is commute with the thing below.
Text Only | |
---|---|
1 2 |
|
Let A be the first upper one, and B be the below one. We need to compute AB - BA ?= 0 .
As we can see, A is a sum of a bunch of Pauli Operator. For this kind of thing, we can use distribution law.
Text Only | |
---|---|
1 |
|
Therefor instead of doing the whole big thing at once, we can just do a single slice of it at a time. Like taking the first term out of A and check whether AB = BA.
Text Only | |
---|---|
1 2 3 4 5 6 |
|
We can just treat the coefficient as a coefficient, and Pauli Operator as a variable. We can split the task into two seperate part. Like 3y - 3y = 0, all we need to look at is
Text Only | |
---|---|
1 2 3 4 |
|
For the coefficient, since they are all number, they obey all law from algebra. Namely, commutative law and associative law of multiplication.
Text Only | |
---|---|
1 2 3 4 |
|
Therefore it do not matter you multiple two number left of right. Any order can produce the same value. Let say Ac is coefficient of A and Bc is of B,
Text Only | |
---|---|
1 2 3 4 5 6 |
|
Absolutely we can ignore the coefficient, however, the only thing in coefficient that we have to worry about is the i produced after two non commute Pauli Operator multiplied together i.e. XY = iZ etc.
Text Only | |
---|---|
1 2 3 4 5 6 |
|
So although both side got the same Pauli Z, the sign of i disagree. If you got more than one set of Pauli Operator multiplied, you have to count for how many i are produced and keep track of the sign.
Text Only | |
---|---|
1 2 3 4 5 6 7 |
|
Almost the same configuration but this time commute. To conclue on issue among coefficient, only the i and their sign you should pay attention to. Other do not worth the effort because they are 100% sure to be the exact same value.
So, lets focus on the Pauli Operator.
Text Only | |
---|---|
1 2 3 4 5 6 7 8 9 |
|
You can see index 1 is not contained in B, so instead of doing the full length multiplication, we can just extract those index both A0 and B share. So the problem size is smaller.
Text Only | |
---|---|
1 |
|
Those index both A0 and B share are the main target. Still we need to see what is outside of main target. Here we can use the property of Pauli Operator that different index COMMUTE. So we don't need to care where to put them. Front of back, do not matter.
Text Only | |
---|---|
1 2 |
|
As I mention earlier, I stand for Identity thus it do nothing, therefore
Text Only | |
---|---|
1 |
|
And since A0 contains only I, it is automatically known as commute. 100% sure. You don't even need to compute it.
Text Only | |
---|---|
1 |
|
Let see what if it is non commute.
Text Only | |
---|---|
1 2 3 4 |
|
Again, only need to check the targeted part.
Text Only | |
---|---|
1 2 3 4 5 6 7 8 9 |
|
Appending the non targeted part,
Text Only | |
---|---|
1 |
|
In fact you don't even need to check for the non targeted part to see whether all term match. The real power of Cyclic Group property of Pauli Operator is that it ensured that all tensor product of Pauli Operator is unique.
Text Only | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Turn out there is no such situation.
Let say
Text Only | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
So by this uniqueness, we can do all comparison separately.
Created: 2023-06-28