6 Evaluate classical functions on a quantum computer
This chapter covers
- Implementing classical functions on a quantum computer as reversible computations
- Implementing Boolean logic functions as quantum operations
- Using Q# and Qiskit to implement reversible computations
- Testing reversible computations
The problems we considered in the previous four chapters, versatile as they are, all have something in common. These problems either have no classical analogue — how do you even define an eigenphase of a classical function? — or that analogue is so simple that it doesn’t make sense to think of it as a separate problem, such as assigning a value to a variable or reading out the value of the variable.
But ultimately, the goal of quantum computing is to solve problems that are formulated irrespective of whether they are going to be solved on a classical computer or a quantum one. These problems can be classical or quantum in nature, but they have classical inputs and aim to find classical answers. For example, the N queens puzzle that we’ll consider in chapter 8 is a purely classical problem, with the puzzle dimensions serving as the input and the queens’ placement as the output. Finding the ground state energy of a molecule, on the other hand, is a quantum-mechanical problem, but its input is a set of numbers that describe the molecule structure, and its output is a single number, the ground state energy.