Quantum Computing Programming Language
William Walker writes "The Economist has an article in its new issue describing attempts to write a programming language for quantum computers, if and when they appear. It does a good job of putting the challenges of qubits versus regular bits into layman's terms. ... The original paper is here."
Port Slashcode to this, and we'll have FP comments *before* the articles appear!
"Mod, mod, mod...and another troll bites the dust."
attempts to write a programming language for quantum computers, if and when they appear
Just don't observe them and they will appear!
Perl's had support for quantum computing for three years, thanks to Damian Conway's Quantum::Superpositions module. I saw him do a presentation in Portland few months back, and it was pretty mind-blowing. It may seem odd to talk about programming a computer that doesn't exists yet, but Q::S actually works.
... in multiple universes :)
The promise of quantum computers is doing computations (as Damian says) "in multiple universes, in constant time" and Q::S obviously can't do this. It can and does, however, act like you're programming a quantum computer by allowing you to give one scalar multiple simultaneous values.
Like Perl wasn't confusing enough, now it's like programming line noise
This isn't as much "normalization" as it is "don't take so many drugs when you're designing tables."
Better yet, Q#: the fastest way to negate any speed improvments gained by quantum computers.
my $cat = new Cat('Felix');
my $occupants = [$cat];
my $room = new Room($occupants);
$room->kill_occupant($cat);
# is he dead?
$room->status_occupant($cat);
# doh!
- James
Yes, not to be patronizing, but you're missing the point.
No matter how non-linear the programming of current software seems to be [i.e. through multithreading and object oriented programming], the software nonetheless relies on the fact that certain things will occur in a certain chronological order.
Quantum computing's power is in the ability to perform truly simultaneous, non-sequential operations. As a result, an entirely new language must be written to implement the new types of processes which are possible.
As an anology, consider the "programming language" of an abacus. When a computer is compared, you dont talk about writing a new "compiler" for abacus code on the computer, you write a new language. Similarly, quantum computing is in many ways something wholy different from normal computers.
"Stumble before you crawl"
In honor of Schrodinger: c@
One man's -1 Flamebait is another man's +5 Funny.
If I didn't know the difference between quantum superposition and tachyons, I'd probably have found that funny too.
if(1 && 0)
{
DoBothBranches();
}
else
{
DoBothBranchesAnyways();
}
else
{
WhatTheHellIsGoingOn();
goto PrintAnswerToQuestionYouWereThinkingOf();
}
Here's my take on the new language. (Sorry this is so simple for you seasoned programmers.)
... ,sqrt(N)}
Consider how you might factor a large number:
N = 23489803289
for (i=3;i lessthan N;i=i+2)
{
if (N/i has remainder 0)
FACTORS = i and N/i
}
This algorithm takes up to the square root of N tries to complete. This is really slow for big numbers.
If you look at the algorithm, even a quantum computer would not really be able to improve on it, unless you had an EXTREMELY smart compiler that could recognize that each try is independent and could be separated. But that is wishful thinking. Instead, consider using sets:
S: {3, 5, 7,
(S is the set of odd numbers from 3 to the square root of N)
Now the code might look like this:
Function Divide(S(x), N)
{
if (N/S(x) has remainder 0)
FACTORS = S(x) and N/S(x)
}
Now the Divide function would be called with the entire set. Compilers would still need to be smart, but the intent here is utilize the parallel processing of the New hardware. So I'm guessing a language similar to LISP might be a good starting point.
Thoughts?