Tutorial Webpage for

Lecture Quantum Computing

Loading...

First gates

This exercise should introduce the use of some basic gates. The identity HXH = Z is one of the most used identities. You should implement the method indetityHXH, which gets one qubit as an argument. Duplicate this qubit and then apply the gates H, X, and H to one qubit and Z to the other. Return them as a tuple. You will see that the values are the same. You can play with the input qubit in the main method.

Editor

Please use the following editor for your exercise. You can run the content of the editor by clicking on the tab 'Run'...

Output of Editor Content

The result of running the editor content is as follows:

Output of the Solution

The output of the solution is as follows:

Solution

Please have a look at the solution only after you have finished working on your own solution. Otherwise the learn effect is much less.