Quantum Computing Programming Language 232
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."
Future work... (Score:5, Funny)
that'll never happen (Score:2)
Re:that'll never happen (Score:5, Funny)
Re:that'll never happen (Score:2)
Re:that'll never happen (Score:2)
Re:that'll never happen (Score:5, Funny)
Re:that'll never happen (Score:2, Funny)
*All* the time, when you order your quantum computer and you open the box, it will be *both* DOA *and* fully functional. You simply won't know until you open the box.
It will, however, *always* contain a dead cat in the box.
Re:that'll never happen (Score:2)
That's about the failure rate of 7200rpm hard drives today.
Re:that'll never happen (Score:3, Funny)
Re:Future work... (Score:5, Funny)
Re:Future work... (Score:2, Funny)
Sorry, I couldn't resist.
Curse my physics background! (Score:5, Funny)
Re:Curse my physics background! (Score:2)
Will, are you listening?
Re:Future work... (Score:3, Funny)
And dont forget TACO posting dupes *before* the original posts
There is a QC language already (Score:2)
Re:Future work... (Score:2, Funny)
function foo(x) {
return(result);
result = x + bar(x);
}
A name for the new quantum language (Score:5, Funny)
Re:A name for the new quantum language (Score:5, Funny)
New name for programs (Score:3, Funny)
Close ... (Score:2)
Re:New name for programs (Score:2)
Re:A name for the new quantum language (Score:5, Funny)
(|Perl> + |Python>)/sqrt{2}
And as soon as I get a quantum cable connection, you can warez my copy of "The Qubbit, or (|There> + |Back again>)/sqrt{2}".
Re:A name for the new quantum language (Score:2)
I never thought I'd ever see it. A bra-ket/computer joke. Dirac would be proud, I'm sure.
Re:A name for the new quantum language (Score:2)
( |c++> + |c--> ) / sqrt(2)
Re:A name for the new quantum language (Score:2)
We can run the complier on a machine stored in a Klein bottle
Jason
ProfQuotes [profquotes.com]
Heisenberg says... (Score:5, Funny)
attempts to write a programming language for quantum computers, if and when they appear
Just don't observe them and they will appear!
Heisenburg Works for code, too (Score:5, Funny)
Personally, I'm just waiting for someone to complain to me that they found a bug in my quantum code:
"It wasn't like that when I originally coded it! You must have looked at it or something! So it's really your bug now, isn't it?
GMD
Please Don't Tell The Kids About This (Score:2)
Mommy, Mommy! She's looking at me again! and we won't be able to say "just ignore her".
Re:Heisenberg says... (Score:2)
Isn't this the job of the compiler? (Score:2)
And of course, C++ objects can execute independently of one another.
Blah, I must just be missing the point. Fuzzy bits, which are read in a non-fuzzy manner? The applications are endless!
Never mind.
Re:Isn't this the job of the compiler? (Score:5, Insightful)
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.
Re:Isn't this the job of the compiler? (Score:2)
Seen Quantum::Superpositions (Score:5, Interesting)
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
Re:Seen Quantum::Superpositions (Score:5, Insightful)
Two criticisms I have from 20 seconds reading the CPAN page are
1. It only seems to handle equal superpositions
2. He seems to be unaware that even though you can perform computations in parallel on a superposition , you can only access the result of a SINGLE computation. So the primality testing example he includes isn't going to be running on a quantum computer.
The language Betteli et al describe isn't breaking any new ground in physics, but it's aim is probably to enable computer scientists to start trying to apply formal methods in analyzing quantum computer programs. Maybe they'll have more luck coming up with new algorithms.
Re:Seen Quantum::Superpositions (Score:2, Informative)
Re:Seen Quantum::Superpositions (Score:5, Interesting)
To give people an example of what Quantum::Superpositions does, take the following snippet of code:
With traditional Perl, such a condition could never evaluate to true. After all, if $foo is 1, how can $foo be 2 and 3 as well? Now take a look at the following:
Thanks to our Quantum-powered Perl (heh), this condition is true. $foo is 1, 2, and 3 all at once. Sort of. In quantum terms, $foo isn't any of those values. But once you test $foo to see if it is 1, it becomes 1. And when you look to see if it's 2, it becomes 2, etc. But if you test $foo to see if it is 4, it is not - that's not one of the possible values.
Re:Seen Quantum::Superpositions (Score:2, Funny)
use Quantum::Superpositions;
my $foo = any(1, 2, 3);
if($foo == 1 && $foo == 2 && $foo == 3) {
print "hooray";
}
(end quote)
Can it be encapsulated behind API's like?:
if(spookyShit($foo,[1,2,3])) {
print "hooray";
}
Re:Seen Quantum::Superpositions (Score:2)
Quantum::Entanglement takes this a step further and behaves more like you expect. The act of testing/observing the value of a variable permanently fixes its value (along with the other variables entangled with it).
for those who cant wait (Score:3, Informative)
layman's terms... yea right (Score:5, Funny)
Yea right. A sample run past my mom...
(Mom reads the article...)
Mom: Will this make FreeCell any easier?
Me: Well, a quantum computer could actually solve all the possible shuffles of FreeCell in one pass.
Mom: That wouldn't be any fun... Would the Internet be faster?
Me: Not until we get rid of your dialup and get you a cable modem.
and so on
Re:layman's terms... yea right (Score:3, Interesting)
Hey, at least your mom has the sense to ask how the technology applies to what she wants to do. My mom tries to understand all the details and then gets all confused. I remember when she went to the computer store to buy her first computer. She told me afterwards that a "very nice young (sales)man" helped her understand exactly what she needed in a computer. She told me that she was pretty sure that she wanted to get a computer with a ROM since that was necessary to get the computer to do what she wante
How long . . . (Score:3, Funny)
Re:How long . . . (Score:2)
http://www.physics.uq.edu.au/gqc/ [uq.edu.au]
Don't tell Stallman.
Sample line of code (Score:5, Funny)
my $occupants = [$cat];
my $room = new Room($occupants);
$room->kill_occupant($cat);
# is he dead?
$room->status_occupant($cat);
# doh!
- James
Re:Sample line of code (Score:2)
(actions when condition is true)
} else {
(actions when condition is false)
} maybe {
(actions when you don't know)
}
languages that assume answers (Score:2)
factor ( int c ){
int a, b;
a * b = c;
a > 1;
b > 1;
c > a;
c > b;
b >= a;
print a, b;
}
if c = 91, then it would print 7, 13 - because that's the only answer, and if there was no answer than it would be null, it there were multiple answers it would print a random working answer.
Re:languages that assume answers (Score:2)
I think a quantum language would half to assume the answer. eg: factor ( int c ){ int a, b; a * b = c; a > 1; b > 1; c > a; c > b; b >= a; print a, b; } if c = 91, then it would print 7, 13 - because that's the only answer, and if there was no answer than it would be null, it there were multiple answers it would print a random working answer.
Well done you have just written a prolog program
Re:languages that assume answers (Score:5, Insightful)
No... quantum computing will not allow you to factor in constant time or anything, or by "assuming the answer", get back the factors. Your idea seems to be "let's take the result and then calculate backwards" so to speak. But that won't work. Now if we could create two superpositions of "all numbers between 0 and sqrt(c)" (to put it in an easy way), calculate the product and then find a way to filter out all results equal to c (which seems to be what you're looking for), then we'd of course be able to simply measure the factors. But the problem is that you can't "filter out" only the results you want to look at. You might be able to slightly increase the likelihood of measuring the 'correct c' and therefore getting correct factors. That's (very simply put) what Shor's algorithm is doing - it only manages to increase the likelihood to measure the right result and therefore retrieve correct factors.
Note that I'm grossly oversimplifying...
Another example is trying to solve 3CNF-SAT - figure out whether a formula in 3CNF can be satisfied - in O(1). Classically, it's an NP-complete problem with exponential complexity. Now the naïve attempt would be to create a superposition of all possible inputs, filter out only those that yield "true" as a result, and then measure the "filtered" superposition to get a solution. Same problem; you can't really filter out the "true" results, you can only make it slightly more likely to measure a "1" as a result and therefore retrieve a solution for the input. You'd still need to repeat that for a couple of times, only less often as in the classical case - but still not in O(1), or even O(n).
So no, quantum computing is not that much of a magic solve-everything-instantly machine... e.g. Grover's algorithm to find an element in an unsorted list will not bring you from classical O(n) to O(1), but rather O(sqrt(n)).
But then again, maybe you're just trolling :)
Anyway, I found this paper [uni-augsburg.de] here very interesting: it's called "Quantum Computing for Non-Physicists".
Even worse than that... (Score:2)
In fact, there really is no proof that quantum computers can do anything that (specialized) classical computers cant do.
I have seen hardware that uses content-addressable memory to data-search, or even sort, in O(1) time, and it doesnt use any quantum mumbo-jumbo.
Interestingly, even Shor's factoring algorithm may not be special. You see, nobody knows what the actually operating time of factoring on a determistic machine is; it is quite poss
We ran a longer story about this... (Score:2, Interesting)
Sample code: (Score:5, Funny)
{
DoBothBranches();
}
else
{
DoBothBranchesAnyways();
}
else
{
WhatTheHellIsGoingOn();
goto PrintAnswerToQuestionYouWereThinkingOf();
}
Strangeness (Score:4, Interesting)
(1) Loops. Don't need them. You just have one line, when you use index "i", it contains all the possible values, so all loops are single statements.
OK, so in general, you won't have issues with flow logic, you write a forumula and theoretically all possible answers are in the output and the input also represents all possible inputs. So this languages is going to have less to do with flow control and more to do with filtering out all the unwanted answers. Not just "wrong" answers that don't fit, but extra answers. To use the looping analogy, if you have a qbyte index and would normally loop through to the total number of elements, the qbyte will loop through all it's values, some of which might be out of range, create numerical problems like divide by zero.
Ok, this should be easy for you to tear apart since it's not well thought through, but what do you expect, a freaking Quantum genius to post this?
Quantum Computing Language exists. (Score:3, Informative)
Yay (Score:5, Funny)
Re:Yay (Score:2)
[ducks]
Re:Yay (Score:3, Funny)
The real problem will be... (Score:4, Funny)
Imagine debugging those. Are they squashed? Or are they squashed/unsquashed at the same time?
(Apologies to real physicists. I'm just being silly. In case you can't tell)
A nitpick... (Score:2, Interesting)
Now, we can have real Heisenbugs. (Score:2, Interesting)
Debugging quantum programs is going to be a real pain. This will allow a whole new type of bug. Before, people blamed bugs on faulty software, non-compliant compilers, and bad hardware. Soon they can blame their bugs on physics itself.
heisenbug [astrian.net]: /hi:'zen-buhg/ n. [from Heisenberg's Uncertainty Principle in quantum physics] A bug that disappears or alters its behavior when one attempts to probe or isolate it. (This usage is not even particularly fanciful; the use of a debugger sometimes alters a pr
Perhaps the new language might be Set oriented? (Score:5, Insightful)
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?
Re:Perhaps the new language might be Set oriented? (Score:2)
Does not bear any relationship to quantum computer (Score:2)
Take a good long look at Shor's algorithm to get an idea how this actually works.
superpositions are nothing new in cs! (Score:3, Interesting)
Abstractions of this concept can be pretty well cooked up by nondeterministic programming [mit.edu] and lazy evaluation [mit.edu] but should one actually be able to run these on a quantum computer the speed-ups could be enormous.
The point being that with the above two concepts you can create even more general problem solving strategies than quantum computers would allow for, however in the same spirit, and use them with current computers. Having a language does not mean that you can really run it with any quantum computers. That's more of a job for a compiler.
not the same thing (Score:2)
A natural feature for a quantum computer language (Score:3, Funny)
Quantum Computing Jobs (Score:4, Funny)
Re:Quantum Computing Jobs (Score:3, Funny)
Interviewer: How many years of experience in quantum programming do you have and in which languages?
Applicant: Last time I checked it was 4 years in Q++ and Turbo Q.
Interviewer: So you have 4 years of experience in Q++ and Turbo Q?
Applicant: To be honest I can't be sure of it anymore.
Interviewer: Gnah!
Re: (Score:2)
Quantum Project Management... (Score:3, Funny)
Debugging (Score:3, Funny)
(Could be you left out a semicolon, could be background cosmic radiation messing with your qubits)
hehe... Microsoft'll love this...
A little premature? (Score:4, Insightful)
Gradual development....
Not premature (Score:2)
Not just a simple abstraction (Score:4, Interesting)
It is clear to me that most people who think they have an idea of how quantum computers work don't. Now I'm not an expert, but I have studied up enough to know that they aren't just a happy parrallel abstraction. Most of the information you get on internet about quantum computers is completely bogus (as someone points out this paper appears to be).
Quantum computers are not universal; they cannot be used to do anything you want in "parallel universes".
I highly suggest people who even ponder quantum computers first get a reputable book on the subject.
Re:Not just a simple abstraction (Score:2)
Think back to the ENIAC. Did the hardware or software come first? Did they write a language before the computer? No they didn't, they toggled the switches manually and the languages and refinements came later.
Correct me if I'm wrong here, (it may be still too 2 dimensional) but I envision:
{
if( bitstate ) !& maybe
result = maybe(bitstate) & not(bitstate)
Re:Not just a simple abstraction (Score:3, Insightful)
The main point that they make is that a final quantum computer will be a hybrid of a classical computer and a quantum "add-on". The classical computer handles all portions of the algorithm that are deterministic, and sets up the quantum portions and controls the measurements.
There are
Re:Not just a simple abstraction (Score:2)
As far as a general purposes quantum computer setup, I think it is naive to assume it can b
Double take! (Score:2)
"The trick is to find a way to describe, in a
manner useful to computer scientists, the
urinary transformations that underlie a
program."
Quantum pee!!!
Qubits (Score:2, Funny)
God: I want you to build an ark.
Noah: Right! What's an ark?
God: Get some wood. Build it 300 cubits by 80 cubits by 40 cubits.
Noah:Right! What's a cubit?
There is a QC language already (Score:2)
Isn't that Perl? (Score:2, Funny)
Programming Language Already Exists (Score:2, Informative)
A programming language already exists. It's called QCL [tuwien.ac.at] by Bernhard Oemer.
It also includes an emulator with 64 qubits. Pretty neat.
He also wrote some very useful papers [tuwien.ac.at] on understanding quantum computing.
superposed phases (Score:4, Funny)
Coming Next: Electron Programming Language (Score:2)
Seriously: if you feel you must muck around with quantum states, a simple library like QDD [sourceforge.net] will probably do. Or have a look here [ex.ac.uk].
If quantum computers ever do anything useful--and that's a big "if"--then most likely you will just be using it through high-level operations and datatypes.
Revolutionary (Score:2)
Also according to the article these low-level constructs will eventually combined into "objects" consisting of both commands and data.
Wow. It's hard to imagine such a computer. This is some futuristic stuff!
-Peter
How will/does it look like? (Score:2, Interesting)
So I would like to know if we could cope up any similar concepts, just to get us starting.
Until now I see two concepts which might be similar, both or only one of them - you tell me, I'm a real new bee in Quantum Programming:
Backtracking - because this is an exponential fractal like algorithm (you call the function and this will repeat itself unti
Did you hear... (Score:2, Funny)
"Seriously?! Now I have to change my PGP key..."
Like early computing; closer to PROLOG than LISP (Score:3, Insightful)
And to the poster who suggested a LISP-type language: no way. Too procedural. A parallel PROLOG is probably closer; you set up some initial conditions (both in terms of data and quantum 'procedures': i.e. the quantum objects), but since the solution is all simultaneous, you don't have to worry about back-tracking.
Serious question: Quantum computing resources (Score:2)
Which websites would be useful? What books would be useful? What else would you do to gain a better understanding of the theory?
Re:Serious question: Quantum computing resources (Score:2, Informative)
I found this [tu-bs.de] article to be a very useful. A nice starting block.
Elimination of 'array vs list' and indexing ? (Score:2)
Does this also mean that DB indexing would be a thing of the past ?
Re:Elimination of 'array vs list' and indexing ? (Score:2)
Perhaps, but it also means that when you're running the accounts batch at night, NOBODY LOOK AT THE COMPUTER! You might change the balances....
Re:Q! (Score:5, Funny)
Re:Q! (Score:2)
You are correct! (Score:5, Interesting)
Yes. With an infinite number of universes, there are an infinite number of you typing the code. Most of you will get it right and the computer will average the correct answer for you. So there, an infinite number of monkeys CAN write Shakespere, GUIs or anything else they please.
Microsoft has been working on this for a long time with their robot code from thier IDE. It still looks random and does not work quite right because they have not figured out how to make regular digital logic uncertian. When they figure that out, they will have it.
A gold star for you.
Re:You are correct! (Score:2)
Quantum computers are based on interactions of qubits, which may be atoms, SQUIDs, or any number of things. They've got working quantum computers up to 7 qubits now, which means 64 operations per cycle, or what ever you want to call it. Quantum computers have nothing to do with parelell universes! Physicists aren't quite sure tha
Re:Ok... (Score:5, Insightful)
Jason
ProfQuotes [profquotes.com]
Re:Turns out that... (Score:4, Interesting)
On a side note, I really don't think quantum computers will overrun the market much though. There really is no need for them in your average application. Where they will be popular is in add-on cards. It will do wonders I presume for mathematical applications such as: graphics(will OpenGL work?), encryption, perhaps even some kind of strange storage device or network device will make use of quantum shenanigans someday. Anyone with mork knowledge on the subject care to comment about the possible uses in the non-research world other than breaking encryption? I can't think of many cases where NP problems are even used in day to day tasks. Besides traveling salesmen or theives trying to optimize their theivery, what else is actually a practical use?
Re:Turns out that... (Score:2)
Okay, maybe this is weirdo logic, but here goes:
Consider how much faster our processors are now than they were 20 years ago.
Consider that even now, there are programs that we have to wait on as they use the processor.
My guess is that as quantum computers become available, we will get software that needs that level of computing power.
Non-existent quotes concerning 64K aside, I don't think many people in the compu
Re:Turns out that... (Score:2, Interesting)
I won't bet on it. Quantum computing is a fundamentally different idea. For most of the user experience, you don't need to solve N-P complete problems. There is a difference between doing something 20 times faster, and 2^20 times faster. A vast majority of algorithms that exist currently on the desktop are solvable in polynomial time - quantum computing for these is probably an overkill.
Re:Turns out that... (Score:2)