Quantum Computing – Playing with Gates

11

In the previous Quantum Computing Tutorial, we learned how to get started with the IBM Cloud and get started with some basic concepts. Today, we are going to play with more gates. Please study the previous tutorial in order to understand the current tutorial.

Controlled NOT Gate – CNOT

The CNOT Gate operates on Quantum Register consisting of 2 Qubits. The CNOT gate flips the second Qubit iff the first Qubit is | 1 >

cnot_gate-svg

The ‘+’ is the Target and ‘.’ is the Control. Now, to understand it better let us start composing.

Case 1 : Control – | 0 > and Target – | 0 >

If both the Control and Target are | 0 > , they will remain | 0 > after the CNOT Gate is applied.

1

Now , we stimulate it.

2

Thus, we see that the final values of the two Qubits remains | 0 > .

Case 2 : Control – | 0 > and Target – | 1 >

In this case, we will again see that the Control remains | 0 > and Target remains | 1 > .

3

Now , we stimulate it.

4

 

Case 3 : Control – | 1 > and Target – | 0 >

Since the Control is | 1 > in this case so the target will be flipped to | 1 > .

5

After stimulating it,

screenshot-from-2016-12-19-16-47-23

Thus, we see that the Control remains the same and the Target is flipped.

Case 4 : Control – | 1 > and Target – | 1 >

Now, when the Control is | 1 > , the target will be  again flipped but this time to | 0 > .

7

Again stimulating it,

8

Thus, the target is flipped again.

A Random Experiment

I want you to look at the following circuit and analyze the output.

11

The final output is 10 at Q1Q2. This is because when Control Q2 was initially | 1 > , the Target Q1 flipped to | 0 > with Q2 retaining | 1 > . Then, Pauli Gate was applied which again changed the value of Q1 to | 1 > . Now when CNOT gate was applied when both Control and Target were | 1 > , it resulted in 10 at Q1Q2.

To get good hands on the gates try playing around with it and see how the output are related.

Bloch Sphere

This is a short description of the Bloch Sphere. It is a geometrical representation of the pure state of the Qubit. What is a pure state ?

A Pure Sate is the quantum state of an isolated quantum system.

Pure State = Superposition of | 0 > and |1 > .  Not touching the Mathematics part of it because I face a lot of difficulty in the same.

 

12

 

Hadamard Gate – H

Here comes the interesting part, before the measurement forced it to choose, the Qubit was in both states at once.

shors-algorithm-the-ppt-9-638

H was applied on state | 0 > which was (1 ; 0)  and | 1 > which was (0 ; 1). It entangles 0 and 1 bit.

111

Now, we stimulate it.

222

There you see that the Qubit Q2 spends 50% time in | 0 > and 50% time in | 1 >.

Final Comments

I suggest you should try out combining different gates and see how it goes. Nothing is better than self exploring. In the coming tutorials, I’ll explain few more gates and integrate them. If you have any questions feel free to reach out to me. Meanwhile, Happy Composing!

Saumitra Kapoor

 

 

Leave a Reply

Bitnami