<datafile label="Swap00" filename="Swap00.png">
<image source="Swap00.png" width="66%" />
</datafile>
Section 2.1 Using the Circuit Builder to learn gates
The circuit builder allows us to see the behavior of a simple gate by trying all of the combinations of inputs. We are going to use it two discover the functionality of the two other gates you used last time - SWAP and CNOT.
When qubits are in their simplest states, and there are four combinations of inputs and four combinations of outputs: 00, 01, 10, and 11. To see how a gate works on these simple states, we try each on in the circuit builder.
The circuit builder will be set to a starting state of and We can also write this state in a more compact form: So, first you will see how the SWAP gate acts when given the input Using the circuit builder below, construct a circuit that matches this picture:
View Source for datafile
Data: Swap00.png
Notice that there is a bar graph that shows the probability of each outcome. Because we are using the simple state, there will be a 100% probability of one of the four choices of outcomes. The qubits shown top to bottom are expressed left to right. That is, the state means the top qubit is and the bottom qubit is
Checkpoint 2.1.1. Swap Output with 00.
orView Source for datafile
<datafile label="Swap_00_Balls00" filename="Balls00.png"> <image source="Balls00.png" width="66%" /> </datafile>
Data: Balls00.png
- Yes! The swap had no effect!
orView Source for datafile
<datafile label="Swap_00_Balls01" filename="Balls01.png"> <image source="Balls01.png" width="66%" /> </datafile>
Data: Balls01.png
- Make sure you hooked up your circuit correctly!
orView Source for datafile
<datafile label="Swap_00_Balls10" filename="Balls10.png"> <image source="Balls10.png" width="66%" /> </datafile>
Data: Balls10.png
- Make sure you hooked up your circuit correctly!
orView Source for datafile
<datafile label="Swap_00_Balls11" filename="Balls11.png"> <image source="Balls11.png" width="66%" /> </datafile>
Data: Balls11.png
- Make sure you hooked up your circuit correctly!
What is the output of the SWAP gate with as the input?
Hint.
Make the circuit and look at the bar graph below the circuit. The answer is the choice on the bar graph at 100%
Now we are going to vary the input. We do this by putting a NOT gate on the input that we want to be a So now construct the gate that will give us the output when the input is
In other words, if we want to determine the output to this circuit:
View Source for datafile
<datafile label="Swap01" filename="Swap01.png">
<image source="Swap01.png" width="66%" />
</datafile>
Data: Swap01.png
Then we construct this circuit:
View Source for datafile
<datafile label="NotSwap00" filename="NotSwap00.png">
<image source="NotSwap00.png" width="66%" />
</datafile>
Data: NotSwap00.png
Checkpoint 2.1.2. Swap Output with 01.
orView Source for datafile
<datafile label="Swap_01_Balls00" filename="Balls00.png"> <image source="Balls00.png" width="66%" /> </datafile>
Data: Balls00.png
- Make sure you hooked up your circuit correctly!
orView Source for datafile
<datafile label="Swap_01_Balls01" filename="Balls01.png"> <image source="Balls01.png" width="66%" /> </datafile>
Data: Balls01.png
- Make sure you hooked up your circuit correctly!
orView Source for datafile
<datafile label="Swap_01_Balls10" filename="Balls10.png"> <image source="Balls10.png" width="66%" /> </datafile>
Data: Balls10.png
- Yes! It traded the values but not locations of the two qubits!
orView Source for datafile
<datafile label="Swap_01_Balls11" filename="Balls11.png"> <image source="Balls11.png" width="66%" /> </datafile>
Data: Balls11.png
- Make sure you hooked up your circuit correctly!
What is the output of the SWAP gate with as the input?
Hint.
Make the circuit and look at the bar graph below the circuit. The answer is the choice on the bar graph at 100%
You have attempted 1 of 4 activities on this page.