QPlayLearn - Qubit and Operations

Welcome to QuantumComputing.com!
Play with one qubit.
Here, you have a chance to program quantum code to explore some of the actions you can make to manipulate it.
To review qubit is a two level quantum mechanical system.

It allows for superpositions where the qubit can be in superpositions of state and state . For example, the state , where are parameters to describe the superposition.
A way to visualize one qubit is called the Bloch sphere.

The state can be represented by any point on the sphere, depending on . However, in quantum mechanics, one cannot observe a quantum state directly. One can only do a measurement, and from that, find the probability of it being on a state. For example, a measurement to determine if it is or the probabilities are to be and to be .

Measuring superpositions gives probabilistic outcomes.
A qubit by itself is not very useful unless we can control it. For this, we apply operations to a qubit to change the state. The operations can be represented as gates on a quantum circuit gates.
Here we introduce some of the most common gates.

This is the X gate. It rotates by or about the X-axis.
Can you guess what the Y gate does?

Right, it rotates by about the Y-axis. Similarly the Z gate would rotate by around the Z-axis.
There's one more gate we should discuss, the Hadamard gate. It's a combination of two rotations, about the Z-axis and about the Y-axis. The H gate takes a state and creates a equal superpositions of and .

When you look at quantum circuits, note this gate appears often at the beginning of many circuits, as creating superpositions is a common step to start doing quantum computations.
There are a few other common single-qubit gates such as S and T, among others.
In the project linked her, you can get started with one-qubit quantum circuit operations using QASM. Yeah, go ahead. All you need start playing with qubits is to change with the code there. Delete the "//" of some the commented lines to play with some of the gates in the code, and see the effect on the qubit. Then run the code. Due to the probabilistic nature of quantum mechanics, make sure to to play with different numbers of iterations. 10 or more work well, but try also 1 and 100. Think of this as your one-qubit sandbox.
For more details on QASM, check out its documentation here.
Here is a list of some of the one-qubit gates featured in this exercise.
z // pi rotation about the Z-axis x // pi rotation about the X-axis y // pi rotation about the Y-axis h // The combination of two rotations, pi about the Z-axis followed by pi/2 about the Y-axis s // S-gate, square root of Z gate sdg // conjugate of S-gate t // Phase-gate, conjugate of square root of S-gate tdg // conjugate of Phase-gate x(0) // rotation around X-axis y(0) // rotation around Y-axis z(0) // rotation around Z axis
Think you've got the hang of it? Try solving the RubiQ's Sphere!