Understanding Hadamard Gates on Quantum Circuits

In summary, the Hadamard gate is a quantum gate that can be applied to qubits, or quantum bits, to generate mixed states with equal probabilities. When applied to a combined state of |000> and |111>, the resulting state is a mixture of all 8 possible combinations of 3 qubits. This is due to quantum interference and the symmetry of the basis states. The Hadamard gate is an important tool in quantum computing and can be used to produce specific states, such as a state with an even number of 1's in a 4-bit sequence. Its effects on mixed states can be understood through a deeper understanding of quantum mechanics and the concept of interference.
  • #1
jayjones01
5
0
Lets say I have the following quantum state:

[itex]\frac{1}{\sqrt{2}}[/itex][itex]\left| 000\right\rangle[/itex] + [itex]\frac{1}{\sqrt{2}}[/itex][itex]\left| 111\right\rangle[/itex]

And that I apply a Hadamard gate to each of these qubits (H[1,2,3]).
The math shows that the resulting state will be:

[itex]\frac{1}{2}[/itex][itex]\left| 000\right\rangle[/itex] + [itex]\frac{1}{2}[/itex][itex]\left| 010\right\rangle[/itex] + [itex]\frac{1}{2}[/itex][itex]\left| 101\right\rangle[/itex] + [itex]\frac{1}{2}[/itex][itex]\left| 111\right\rangle[/itex]

I know how to do the math to get to the result, but i don't understand the logical reason why a [itex]\left| 000\right\rangle[/itex] and [itex]\left| 111\right\rangle[/itex] combined state generate that result. If anyone could help me understand why this happens i would appreciate it.

Thanks in advance :smile:
 
Physics news on Phys.org
  • #2
Does a qubit have 3 quantum numbers?
 
  • #3
It's a system with 3 qubits, hence the operator H[1,2,3].

When I have 1 qubit, let's say a [itex]\left| 0\right\rangle[/itex], I understand that a Hadamar gate will create an equally probable quantum state that mixes [itex]\left| 0\right\rangle[/itex] and [itex]\left| 1\right\rangle[/itex], cause a Hadamar gate combines states.

I also understand that when I have a quantum state like [itex]\left| 000\right\rangle[/itex], a Hadamar gate applied to all qubits (a H[1,2,3] operator) will generate mixed states on all qubits and produce an equally probable mix of all 8 combinations (000 001 010 011 100 101 110 111).

But when i have the state described on the first post, i can't understand why the generated state has those apparently random combinations.
 
  • #4
I am not familiar with the operation, however I think there is a flaw in the math, because your not conserving probability.

Also why are you starting with a state of two (out of eight) possibilities and why did you pick those two?
 
  • #5
Forgive my lack of formalism, but when i say a mix of 0 and 1, I am actually referring to the state:
[itex]\left| \psi\right\rangle = \frac{1}{\sqrt{2}} \left( \left| 0\right\rangle + \left| 1\right\rangle \right)[/itex]

The same applies to the state of all 8 combinations with 3 qubits i mentioned, i just didnt type the probabilities cause they are equally weighted.

There is no flaw in the math, the states in the first post are valid quantum states. You can start with whatever state you want, as long as it's a valid quantum state. I chose those two because they give a result (after applying the Hadamard gate to each qubit) that doesn't seem obvious to me and I can't understand why does the math give such a result.
 
  • #6
jayjones01 said:
Lets say I have the following quantum state:

[itex]\frac{1}{\sqrt{2}}[/itex][itex]\left| 000\right\rangle[/itex] + [itex]\frac{1}{\sqrt{2}}[/itex][itex]\left| 111\right\rangle[/itex]

And that I apply a Hadamard gate to each of these qubits (H[1,2,3]).
The math shows that the resulting state will be:

[itex]\frac{1}{2}[/itex][itex]\left| 000\right\rangle[/itex] + [itex]\frac{1}{2}[/itex][itex]\left| 010\right\rangle[/itex] + [itex]\frac{1}{2}[/itex][itex]\left| 101\right\rangle[/itex] + [itex]\frac{1}{2}[/itex][itex]\left| 111\right\rangle[/itex]

I know how to do the math to get to the result, but i don't understand the logical reason why a [itex]\left| 000\right\rangle[/itex] and [itex]\left| 111\right\rangle[/itex] combined state generate that result. If anyone could help me understand why this happens i would appreciate it.

Thanks in advance :smile:

Well, the short answer to your question is "quantum interference". Remember that the Hadamard transforms of |0> and |1> have different phases, so the operation of the 3-bit H-matrix on |000> and |111> will add those phases together in a well-defined way. As far as an intuitive reason why the symmetric superposition of |000> and |111> would transform that way, I don't have an answer. The only thing that jumps out is that the basis states that survive the transform are the symmetric ones .. where by symmetric I mean the ones where the bit-sequences read the same forward and backward. What happens when you apply that H-matrix to the antisymmetric superposition of |000> and |111> (i.e. [itex]\frac{1}{\sqrt{2}}\left[\left|000\right\rangle - \left|111\right\rangle\right][/itex])? I am guessing that you get the combination of the other 4 possible bit sequences?

I am not sure what significance might be attached to this symmetry (if it is even correct) .. it could just be coincidence. It's interesting though .. I haven't thought about quantum computing for a while .. I bought a book on it once upon a time, but didn't get very far into it. Maybe I'll dig it out again.
 
Last edited:
  • #7
Thanks a lot for your reply SpectraCat. Yeah I thought it should be due to interference, but I can't really understand why it works that way. I'm studying some error correction schemes for quantum circuits and there are some 4 qubit circuits to produce certain mixture of states. I wan't to understand how does it work cause I'm sure there must be a logical way to explain it, I don't think the people that made those 4 qubit circuits started multiplying ALL possible operators hoping that by chance they would mathematically get the answer, they should have a deeper understanding so they can predict what operators will produce which combination of states (which can be seen as a sum of bit sequences in some way). I have tried using other initial states and i couldn't find a pattern that could explain the results.

The idea was to create a circuit that would produce this state:

[itex]\frac{1}{\sqrt{8}}\sum\left| v\right\rangle[/itex]

where [itex]v[/itex] is a 4 bit sequence with even number of 1's (fex 0000, 0101, 1111, etc)

How did Shor (the guy who created a circuit to do this) know that starting with [itex]\frac{1}{\sqrt{2}} \left(\left| 1111\right\rangle + \left| 0000\right\rangle \right)[/itex] and just doing a Hadamard operation to each qubit he could produce the state mentioned above. I don't think he tried all possible combinations of operators, he somehow knows how the Hadamard gate works with mixed states.
 
Last edited:
  • #8
Hmm ... I did the Hadamard transform of your problem, and I got different results:

I used the following definition of the 3-bit Hadamard matrix (ignoring normalization):

Code:
1  1  1  1  1  1  1  1
1 -1  1 -1  1 -1  1 -1
1  1 -1 -1  1  1 -1 -1
1 -1 -1  1  1 -1 -1  1
1  1  1  1 -1 -1 -1 -1
1 -1  1 -1 -1  1 -1  1
1  1 -1 -1 -1 -1  1  1
1 -1 -1  1 -1  1  1 -1

In that basis, the vector representing your initial |000> + |111> state is just the transpose of:
Code:
1 0 0 0 0 0 0 1

When I carry through the multiplication, I get
Code:
2 0 0 2 0 2 2 0

indicating the the result of the transform should be:

|000>+|011>+|101>+|110>

assuming I have the basis correct. I have been assuming the that indices of the column vector are ordered such that the q-bits represent binary numbers 0-7, i.e.

Code:
|000>
|001>
|010>
|011>
|100>
|101>
|110>
|111>

If that is not correct, then perhaps I have drawn the wrong conclusion, but I still don't see how to get the answer you gave. Am I making a mistake somewhere?

One thing I do see however, is a likely way to predict the results of the transforms .. at least for equally weighted superpositions like the ones we have been considering. The bits in the column vector select columns of the matrix, which are just added together to get the final result. In other words, if you want to get the result you initially indicated (i.e. |000> + |010> + |101> + |111>) using the indexing scheme I laid out, you would apply the transform to |000> + |101>. I imagine that if you spend some time thinking about this, you can develop a deeper intuition that allows you to predict more complicated results, like the one you mentioned in your last post.

For that specific example with 4-bits, I understand the logic. It works like this: The Hadamard gate on each bit transforms a |0> into the symmetric linear combination, |0> + |1>, while it transforms |1> into the antisymmetric linear transform, |0> - |1>. Thus, for any even bit sequence, adding the transforms of "all bits off" (i.e. |0000> in your example) and "all bits on" (|1111> in your example) will mean that only the sequences with an even number of "on" bits can survive, because the other ones will have their phases flipped in the "all on" transform, and thus get canceled out.
 
  • #9
You are right, I didn't really check my H[1,2,3] matrix and I did a careless mistake writing it down, that's why my 3 qubit examples were wrong and I could not see any logic in them :-p

The last paragraph explains it very well and I now understand why |0000>+|1111> generates a mix of even bit sequences. Thanks a lot SpectraCat for taking the time to answer this, I'm eternally grateful :biggrin:
 

FAQ: Understanding Hadamard Gates on Quantum Circuits

1. What is a Hadamard gate?

A Hadamard gate is a fundamental quantum gate that is used in quantum circuits to manipulate qubits. It is represented by the letter H and has the ability to put a qubit into a superposition of states.

2. How does a Hadamard gate work?

A Hadamard gate works by taking an input qubit and transforming it into a superposition of states. This means that the qubit will exist in both the 0 and 1 states simultaneously. It does this by rotating the qubit's state vector by a certain angle, which is determined by the gate's matrix representation.

3. What are the applications of Hadamard gates?

Hadamard gates have many applications in quantum computing, including creating superposition states, implementing quantum algorithms, and performing quantum error correction. They are also used in creating entangled states and in quantum teleportation.

4. How do Hadamard gates differ from classical gates?

Classical gates operate on classical bits, which can only exist in one of two states (0 or 1). Hadamard gates, on the other hand, operate on qubits, which can exist in a superposition of states. This means that Hadamard gates have more flexibility and power in manipulating information compared to classical gates.

5. Are Hadamard gates reversible?

Yes, Hadamard gates are reversible. This means that the input qubit can be retrieved from the output qubit, making the gate suitable for use in quantum computing where reversibility is a crucial requirement. In fact, Hadamard gates are their own inverse, meaning that applying the gate twice will return the qubit to its original state.

Similar threads

Back
Top