Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quantum-kittens
GitHub Repository: quantum-kittens/platypus
Path: blob/main/notebooks/summer-school/2021/lec2.1.ipynb
3855 views
Kernel: Python 3

Simple Quantum Algorithms (part 1)

Elisa covers the basics of qubits, Dirac notations, basic gate operations (e.g. Hadamard gate, NOT gate, Controlled-NOT gate, etc.), and the Bloch sphere representation of a qubit. Elisa then introduces few basic quantum algorithms to show how quantum computers work, and to show certain advantages over the classical system.

Elisa introduces oracle operators, and we want to work out their properties using the fewest queries possible. We can build a phase oracle from a classical oracle for use in the Deutsch-Jozsa algorithm. Deutsch-Jozsa algorithm determines whether a given function is constant (i.e. output will be always 0 or always 1) or balanced (i.e output is 0 for half the inputs and 1 for the rest). Elisa gives the intuition of this algorithm and follows through the mathematics step-by-step.

FAQ

What is an oracle? It’s just a black-box like device, that performs implementation in a function as a unitary operator.

In other words, an oracle is like a 'black box'. It gets an input and creates an output that one can measure but actually cannot see inside the black box, which means one doesn't know its property (in this case, one doesn't know if the function is constant or balanced). The goal is to find the property of the oracle.

Due to Superposition, we have to run quantum computers once. This is a huge speed advantage over classical systems. However, to measure a probability, we must run the quantum algorithm many times to get the meaningful probability given real-life noise. How does this speed factor vary between classical and quantum? It depends on a lot of noise. In the example of the Deutsch-Jozsa Algorithm, users can quickly determine whether the function is balanced or constant. Because you can only get one output from the circuit and the rest of the combinations are zero, the probability distribution is also based on it. Then you can a few shots at the same time, do the measurements, and get a higher chance (above 90%) to get the correct output.
What are Balanced Function and Constant Function in the Oracle? If a function with n-qubits input gives n number of 0s (all 0s) or n number of 1s (all 1s) regardless of the input, then that function is known as Constant Function whereas, If a function with n-qubits gives half-of the n numbers of 0s and another half as 1s, then the function is balanced.

In another way, we can mention that a function ‘f’ is called balanced if it is equal to 1 for exactly half of all the possible x, and 0 for the other half.

For the Quantum solution of the algorithms, how to determine the number of qubits need to use in this algorithm? It depends on the function on which this algorithm is implemented.

Other resources