4 ms·
My guess is that at first it will look like existing programming languages, but with some extra commands (apply Hadamard or QFT or whatever to a register). Over
by Strilanc 9y ago
My guess is that at first it will look like existing programming languages, but with some extra commands (apply Hadamard or QFT or whatever to a register). Over time, people will find good ways to incorporate concepts like reversibility, coherent conditions, phasing, and mixing quantum/classical data deep into the language semantics.
For example, Grover's algorithm could be written like this:
def grover_search_sample(bit_count, predicate):
qureg = qalloc(bit_count)
apply X to qureg
apply H to qureg
n = pi/4 * 2**(bit_count/2)
for _ < n:
if predicate(qureg):
phase_by pi
if all(x_axis(qureg)):
phase_by pi
return measure qureg