QCET

Circuits
Gates
Hardware
Documentation

Deutsch's Algorithm

input
0
output
1

Algorithm Overview

The Deutsch Algorithm offers arguably the simplest example of how quantum computers can utilise superposition to solve problems more efficiently than standard computers.

The problem:

Given an arbitrary function, , that accepts a single bit as input and returns a single bit, determine whether the function is balanced or constant. That is, whether both outputs are the same, or differ.



With traditional computation, two queries would be required to solve this problem, simply evaluating and and confirming whether or not they are equal.

For simple functions, this is trivial, however consider an arbitrary function that offers some challenge in its computation, solving this problem with a single query would certainly be beneficial.


The solution:

Begin with the initial state,

After the passing through the first set of Hadamard gates, the initial state is transformed into

Recall that

Next the phase oracle is applied, since the input is in a superposition, the matrix is distributed into each of the superposition states, leaving us with a state of

However, recalling that

The state can be further simplified to

Before applying the final Hadamard gate to the first qubit, consider each case individually, firstly that is constant

Applying the final gate gives a final state of

The first qubit will always be measures as a 0.

In the other case, where is balanced

Applying the final gate gives a final state of

The first qubit will always be measures as a 1.

Hence, if is constant, then a 0 will be measured in the first qubit and conversely if is balanced a 1 will be measured.

Use Cases

Whilst currently lacking commercial use cases, the Deutsch algorithm serves as a proof of concept, demonstrating the ability of quantum computing to solve problems in a more efficient way than traditional computation.

Extra Information

https://www.youtube.com/watch?v=7MdEHsRZxvo

https://www.youtube.com/watch?v=QcK0GK7DUh8

https://quantum.cloud.ibm.com/learning/en/courses/fundamentals-of-quantum-algorithms/quantum-query-algorithms/deutsch-algorithm