kings7 said:
I know quantum computing is in its infancy (or for all practical purposes completely out of reach). But, assuming that one day we'll have mass-produced quantum computers, does anyone know how computer science will change? Will all the data structure, computer architecture, programming language, etc. classes be a waste of time and will CS majors have to start over? Specifically, how will this change the high-level programmer? Will quantum programs be able to have a similar syntax to major ones today like C, C++, or Java?
Quantum Computers are entirely different from conventional computers and are great at solving specific problems, but are either impractical or don't offer substantial gains, in terms of performance, for the types of problems solved by today's computers.
In Computer Science, the class BQP is associated with the problems that a Quantum Computer is able to solve quickly. The "P" in BQP stands for
Polynomial time (with respect to the size of the input to the problem) which is informally synonymous with "fast". Any instance of a problem in BQP may be readily solved by a QC, even for large instances.
Another class, P, is analogous to BQP but for conventional computers - that is, it contains the problems that today's computers are able to solve efficiently. Many frequently occurring problems live in P, e.g. sorting, searching a list, matrix multiplication, computing the greatest common divisor and even testing for primality. In other words, many of the tasks performed by today's popular software applications are already efficiently solved by laptops and mobile devices - in some cases they're already as fast we need them to be because they act on data sets of almost insignificant size.
For large data sets, we're able to cluster computers or CPUs to improve performance. For example in Parallel Computing, sorting n numbers with log(n) CPUs is done in O(n) (linear) time, as opposed to the n \times log(n) time it would take for a single CPU. It's faster, but has the additional cost associated with the extra CPUs. Additionally some problems are not efficiently parallelizable - in particular problems that interact with a user or other devices. This is one reason why a working QC won't replace our existing CPUs, there's no inherent gain (with some possible exceptions such as games and math or data analysis software running with ambitious data sets).
One problem that Quantum Computers are substantially better at solving is Integer Factorization - given a number, output its prime decomposition. This problem is in BQP and outside P, meaning that conventional computers require exponential time to solve it (with respect to the number of bits in the number), whereas QCs are able to solve it in b^3 - where b is the number of bits - much faster by comparison. As an example, a large number with hundreds of digits on a QC can be factored in roughly a few million operations, or instantly as perceived by a person. In a conventional computer, factoring the same number requires a number of operations possibly exceeding the estimated number of atoms in the universe.
This dramatic difference in performance is only visible for very large numbers. Since computer software doesn't routinely have to deal with such large quantities there's no pressing need to switch to Quantum Computers. The more significant impact of QCs would be in cryptography since RSA, a popular algorithm used in public key encryption is vulnerable to fast integer factorization.
As useful as Quantum Computers would be they're not proven to offer any advantage in solving a class of difficult and frequently occurring problems (called NP-Complete problems). As an example, even a QC would take forever to solve a very large Sudoku - it's curious that lots of games are particularly difficult theoretical problems, GO for instance is completely intractable.
Quantum Computers are probabilistic (rather than deterministic) machines so there's a very small probability that they'll output the wrong answer, but by using repeated runs we can reduce the probability of error to that of corruption or hardware failure, so it's not very significant in practice. There's a computational class, called BPP (bounded error probabilistic polynomial time) which contains the problems that can be efficiently solved by randomized algorithms running on conventional computers, and some offer improved performance with negligible risk of error.
There are some QC simulators available which use specific notation, more comparable to assembly than Java/C given the nature of QCs.
How do you program for Quantum Computers? Suppose you have a particle or quantum bit, with some measurable property with value 0 or 1. Until the value is measured there is some probability of the value being 0 and some probability of the value being 1. If you have n such qubits, you have a probability distribution that indicates the probability of each possible state. If there are n bits then there are 2^n states, each possibly with a non-zero probability depending on how the bits arrived at that state.
The fact that the "Universe" is, or seems to be, tracking the probability of each possible outcome is what Quantum Computers exploit. If we were living inside a computer and that computer were simultaneously tracking every possible outcome in our day-to-day lives, we would be able to exploit this for computation by determining how our actions affect the possible number of outcomes and corresponding probabilities. With each action the universe would have to update this large set of probabilities that it's tracking. Each such update resembles a mathematical operation, an operation that's performed against a set of 2^n numbers.
The idea is to take an initial state of n qubits and apply successive operations to get into a state whose probability distribution matches a useful state (in integer factorization for example, the set of numbers with a given period). Finally we perform additional operations that cause the desired solution to be the most likely state, such that when we do measure the final state it yields the correct solution with high probability. A QC simulator allows you to analyze the probabilities for each state and apply operations corresponding to Quantum gates, so in the end it resembles assembly language more than anything.