Algorithms and cookie recipes
When speaking about solving problems with a computer, whether it being in simulation, optimization or machine learning, we often hear the term algorithm. But an algorithm is actually not automatically tied to a computer. Also a cookie recipe can be thought of as an algorithm.
This cookie recipe has many characteristics that we also expect from algorithms that are supposed to run on a computer.
- Finite description: An algorithm must be described by a finite number of instructions. In our cooking recipe there are 7 instructions, for a quantum computer it means that it must use a finite amount of gates.
- Input and output: An algorithm should have one or more well-defined inputs and also one or more well-defined outputs. For the cookie recipe this includes the ingredients, for a quantum computer algorithm it could mean data describing the problem we want to solve.
- Elementary operations: Whoever executes the algorithm, whether human or computer, must know how to perform the elementary operations used to describe the algorithm. The instructions should therefore also be unambiguous. In case of our cookie recipe this includes operations such as stiring or heating an oven. In case of a quantum computer it is the gates like H or X.
An algorithm is a finite list of clear instructions used to solve a problem.
Algorithms are not bound to a computer or a language. But in order to run an algorithm on a computer we need to use a language the computer understands – the programming language. There are multiple programming languages that can be used to implement an algorithm on quantum computers. But a good way to display quantum algorithms is to use circuit diagrams as we did in the foundations module. Thus, in this module, we will explore quantum algorithms using our well-known circuit diagrams.