Michael Krimgen wrote:However, do you see any applications of the concepts of QC algorithms in other areas like concurrent programming?

Hi Michael,

The tricky thing about treating QC like classical forms of concurrency or parallelism is this: when you do things in parallel on a CPU, more work is done and you're able to save all of the results.

On a QPU, it's a bit different. When you execute multiple tasks in superposition, you can't get all of the results, but you can get things like the sum, or the average, or the parity. In general, the total

*amount* of information you get from doing a million things in superposition is the same as the amount of information you get from just executing one, but you can get different information out, which would have required many runs on a classical computer.

The best illustration of this is known as the

Deutsch-Jozsa problem.

Here's (loosely) how it goes:

Imagine you have a function which takes in one bit (0 or 1) and puts out one bit (0 or 1).

The function takes an hour to run. Using it, you answer two questions:

**Question 1: If the input is 0, what's the output?** - This one is easy. Just give it the input, and an hour later you're done.

**Question 2: Is the output the same for 0 and 1, or different?** - In this case, you need to run it twice to get an answer to your question.

Using a QPU function, you can run both in superposition. It runs all values simultaneously in a single run, and then you can transform the output to answer

**either Question 1 or Question 2, but not both**. So you can find out whether the answers for 0 and 1 are different (Question 2), so you're 2x faster than your classical computer (yay), but on this case you collapse the state so that you don't actually get the specific output values. If you'd just run the classical function twice you'd have both answers.

(This is explained a bit better by Mercedes in chapter 14, and there's an accompanying code sample

here.)

...so if someone tells you a QPU can "play all possible chess games at once" that's

*sort of* true, but not as useful as it sounds. :]