3.4 Classical recursion in quantum programming

The notion of recursion allows the programming of repetitive tasks without a large number of similar steps to be specified individually. In the previous sections, we have studied the quantum extension of the while-language, which provides a program construct, namely the quantum while-loop, to implement a special kind of recursion – iteration – in quantum computation. The general form of recursive procedure has been widely used in classical programming. It renders a more powerful technique than iteration, in which a function can be defined, directly or indirectly, in terms of itself. In this section, we add the general notion of recursion into the quantum while-language in order to specify procedures ...

Get Foundations of Quantum Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.