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."
I have a quantum computer. I just #include stdqc.h.
So how are they going to handle an infinite number of variables? Oh right, dont worry... Someone else's problem?
Someone should create a quantum programming language named "Q" in the fine tradition of "C".
too slow!!!!
Isn't this a bit like trying to figure out which year we're going to time travel to first, or the best type of outfit to wear when you're teleporting to a party millions of light years away?
Try not. Do or do not, there is no try.
-- Dr. Spock, stardate 2822-3.
c??
-- Thou hast strayed far from the path of the Avatar.
attempts to write a programming language for quantum computers, if and when they appear
Just don't observe them and they will appear!
I mean, C is portable across endless architectures. It would seem far more sensical to put efforts into a new C compiler. If parallelism is required, surely the compiler can simply find bits of code which can execute in parallel without affecting each other.
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.
"[A] high IQ is like a Jeep; you will still get stuck, just farther from help!" --Just d' FAQs, c.g.a
I was getting tired of the repetitiveness of hexadecimal. A base 6561 representation of 8 cubits should be fun to learn. Mandarin Chinese ASCII anybody?
because of the uncertainty principle, you'll never know exactly how to write your program in it and still have it run 100% correctly.
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."
http://tph.tuwien.ac.at/~oemer/qcl.html
It does a good job of putting the challenges of qubits versus regular bits into layman's terms.
:-)
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
www.christopherlewis.com
I think it's a good idea. I mean, if quantum computation is actually a viable means by which to base PC computation (or any computer for that matter) I would think that it will put our traditional 1s and 0s in the history books.
With all the power that lies in the quantum domain, we won't just have to be writing new software, infact, all of the computer science and computer engineering we learned in school will be taught much differently. As a CS/CE student, everything I'm learning is pretty much linear, 1s and 0s, == and != kinda theories. With quantum computing, we'll have to start thinking in hyper-parallelism and in continuous framesets, not descrete!
What from the keyboard will we use to designate variables that are somewhat the same, but not really? Maybe !?==. How will gate logic be designed? NANDkinda gates?? Stuff like that interests me.
Holy moley, this could be really interesting. Or, it could not. But I think so!!
. . . before this makes it into the Gnu Compiler Collection?
Al Qaeda has ninjas!
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.
Friends don't help friends install M$ junk.
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
If I didn't know the difference between quantum superposition and tachyons, I'd probably have found that funny too.
Yeah, and underneath the compiler, there will have to be new OSes, machine code, and who knows what the hardware will be like.
I agree though, the compiler would be the fastest way to migrate the traditional C/C++ programmer to the quantum based computer. They keep typing like they've always known, and the compiler does the translation.
But I wonder, like going from 32-bit to 64-bit processors, what the hell kind of programming adaptations will have to be made going to quantum bits? You know where each of those 32/4 bits can be a bazillion variables itself? I bet researchers will have work to do in that area.
The compiler would have to be super smart, and able to detect where events take place which would be parallal operations, and somehow not confuse "int a" from the "int a" in the other universes or whatever craziness quantum computing has.
I bet it can be done, but the compiler will probably have to be designed by CS guys sitting along side EE and Quantum Physics guys as well.
too bad this is just another Troll from the Troll Compendium.
otherwise I'd say, "thank god, finally."
Death to all who oppose
If we build something with qubits, should we call it an ark?
...I don't think that quantum computing will allow us to go back in time.
Unless of course, you can swing around the sun at warp 10.
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.
In Soviet Russia the Quantum Computer programs YOU.
...paper a couple of years ago. Programming goes quantum, TRN March 28/April 4, 2001
Eric Smalley
are you sure that manning the fries machine is really more important that "lettuce fetcher".
I'm not so sure it's worth giving up your time on slashdot over. Maybe if they make you assitant manager or something.
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
watch this
if(1 && 0)
{
DoBothBranches();
}
else
{
DoBothBranchesAnyways();
}
else
{
WhatTheHellIsGoingOn();
goto PrintAnswerToQuestionYouWereThinkingOf();
}
After the "Hello, maybeworlds" jokes/programs trundle down, well start sifting through Qubits running Q-Bert. These will be linked to cubicles and Dilbert almost immediately after that. From there, it's an easy downhill slide to memory banks which are and aren't running proprietary software, illegal music coexisting with Bach, cybermaybewarfare and a whole new dimensional lattice of blonde jokes. I wonder if anyone will understand them anymore? Superimposition of superintendants! Double Dragon like you never may have played it before! No more uncertainty about whether you've lost your car keys! Stand up and smile, gentles all. The lawyers are finally screwed six states from Sunday.
El Jynx
A positive attitude may not solve all your problems, but it will annoy enough people to make it well worth the effort.
I'll just wait for Sun Microsystems to come out with J2QE (Java 2 Quantum Edition). For example:
;
;
;
;
package java.lang.quantum
public strange abstract QuantumObject {
public abstract void deconfine ( )
public abstract void charm ( )
public Object clone ( ) {
throw new RelativisticException("You can't clone a QuantumObject, you insensitive clod!")
}
}
A programmer is a machine for converting coffee into code.
Compiling a Quantum Computer program is NP-hard on problem size. DOH!!
I've put a little thought (very little) and it's a very interesting issue. First, for the doubters, they do have some quantum computing successes, the basics are proven. It's worth figuring out what the language is like. A couple things occur to me.
(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?
Hey neal n bob, you forgot to list me!
Don't you remember all the fun we had goofing around on Slashdot.
Anyway, I'll miss you! Take care chief! I'll keep the cause alive and well while your gone!!!!
-Anonymous Coward
hehehehehehehehehehehehehehehehehehehehehehehehehe hehehehehehehehehehehehehehehehehehehehehehehehehe hehehehehehehehehehehehehehehehehehehehehehehehehe hehehehehehehehehehehehehehehehehehehehehehehehehe hehehehehehehehehehehehehehehehehehehehehehehehehe hehehehehehehehehehehehehehehehehehehehehehehehehe hehehehehehehehehehehehehehehehehehehehehehehehehe x 8923745234625634562152572456
/.gestapo at work for ya, ya damn socialist tyrant
damn "postercomment" compression filter. that's the
Let's not forget QCL (Quantum Computing Language) developed by Bernhard Oemer (a slashdotter) in 1998.
GOTO will be all the rage. Maybe they'll call it LEAP instead!
... when programs have Shroedinger's bugs.
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)
In the paper they wrote, they claim that Grover's algorithm provides an exponential speed up over classical search algorithms. If I'm not mistaken, Grover's algorithm takes time O(N^(1/2)) while classical search algorithms take time O(N), which is only a quadratic speedup, not an exponential one... I'm sure the rest of their paper is well done, but this bothers me anyway.
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: /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 program's operating environment significantly enough that buggy code, such as that which relies on the values of uninitialized memory, behaves quite differently.) Antonym of Bohr bug; see also mandelbug, schroedinbug. In C, nine out of ten heisenbugs result from uninitialized auto variables, fandango on core phenomena (esp. lossage related to corruption of the malloc arena) or errors that smash the stack.
Does anyone have a link to any intros on Quantum Computing? The only things I've seen so far are (all but) complete frauds. They're about as bad as the early literature on Object Oriented programming.
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?
yeah, go gnu!
Is it just me, or is it weird to imagine a computer whose registers get blown away every time you try to read their contents? I don't know if this is always the case, but I read something like that in the early literature about quantum machines.
Then again, since it's only a few atoms we're talking about I think we can spare it. It's not like we'd be frying an Athlon or P4 every time we played a Quake death match!
THIS is news for nerds!
By the way, The Economist is Bill Gate's favorite magazine (according to a really old interview).
Having a superposition of states is really the exciting thing about quantum computing but as a concept there is really nothing new for any cs-majors.
Abstractions of this concept can be pretty well cooked up by nondeterministic programming and lazy evaluation 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.
I see on google, that various quantum computer simulators are available. Would this make the actual machines emulators of the simulators when they're built? Between the now and lators, I'm a bit confused . . .
I'm no physicist, but if there are supposedly infinite universes and that in at least one of those universes, let's suppose a person already has a working quantum computer. Could that quantum computer's computing power be combined with other quantum computers in parallel universes?
:)
In short, is it possible to have these computers work with each other?
And can I have a Beowulf cluster of these please?
I can either tell you what milestone we're on, or how fast the project is progressing, but not both.
Error: Missing ';' near identifier 'qubit0'
(Could be you left out a semicolon, could be background cosmic radiation messing with your qubits)
hehe... Microsoft'll love this...
-------
"In times of universal deceit, telling the truth becomes a revolutionary act."
-- George Orwell
Gradual development....
I've seen several posts that imply that the its the job of the compiler to handle the parallelism. Quantum computers can only be exploited with highly specialized algorithms and as such, the compiler has no place. In fact people who study quantum computers today dont even use assembly language, they use gates.
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.
This post was funny until you read it
"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!!!
With apologies to Bill Cosby
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?
"My fingers Emit sparks of fire in Expectation of my future labours." William Blake
It's called QCL and you can get an emulator for it that runs on Linux.
It's called QCL and you can get an emulator for it that runs on Linux.
An infinite number of ways to get from here to there?
... try qark ... or quark ...
Infuriate left and right
I remember that a very high level of parallelism can be achieved with great ease, with pattern matching and similar features.
(a classical example: Fibonnaci numbers:)
-- Sig down
A programming language already exists. It's called QCL by Bernhard Oemer.
It also includes an emulator with 64 qubits. Pretty neat.
He also wrote some very useful papers on understanding quantum computing.
------
wildmage
Memoirs of a Mad Scientist
Mommy, Mommy! She's looking at me again! and we won't be able to say "just ignore her".
For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
There is a discussion going on right now in the sci.physics.research newsgroup (moderated) on the subject of quantum computer programming languages
How do you think this relates to quantum computers exactly? The very idea here is way way off base. Quantum computation is statistical. Solutions are built into a superposistion of answers, which must be clevery designed to positively interfere in order to create a signal that has a statistical chance of objectifying.
Take a good long look at Shor's algorithm to get an idea how this actually works.
Phase 1: Steal Underwear Phase 1: ??? Phase 1: Profit!
Unfortunately, though the concepts seem similar to quantum computing models, they are in fact different.
Don't know of another way to tell you this, but the link to the article in the Economist is non-functional. Takes you to an error page.
You cant even do SAT in polynomial time with a quantum computer.
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 possible that an algorithm can be written which is just as "fast" using non-quantum hardware.
Ok, yes, quantum computers can make really good random numbers, but thats just a dongle on a classical computer stuck in a cup of tea.
It's a great idea, though I feel it would be better to make a header file for another language rather than write a new language from scratch. I intended to write such a beast in C++, mainly cos' thats what I know best.
Finally, it has to be said thay any new quantum language/library ultimatly suffers from 2 defects:
1: It is slow, after all it has to emulate the 'speedy' aspects of quantum computing: for example, an 8-qbit operation will be some 256x slower than an equivalent 8-bit variable operation.
2: Most normal computers cannot generate a true random number, needed for 'real' quantum computing.
(2) can be fixed with hardware, but (1) is much tougher. Remember a tool such as this can only really be used to see *WHAT* a quantum computer will be like, not to actually use it.
Anyway, thats my 2c, you can vist
to see what I'm currently working on.
Seriously: if you feel you must muck around with quantum states, a simple library like QDD will probably do. Or have a look here.
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.
Q*Bert ...everyone was thinking it.
There is already tons of software for quantum computers, I know this because out team at Georgia Southern University has a grant from the National Science Foundation to design the very first atomic chip.
Here's a question I've wondered about since I heard about 'Schrodinger's Cat':
Won't the cat be able to observe whether it is (itself) alive or dead?
Of course it won't suddenly realize 'Oops, I'm dead'; but it will certainly be able to tell that it is still alive. Therefore the decision would have to be made while the cat is still in the unopened box, because the cat is constantly 'observing' itself during that time.
Have I got the concept of Schrodinger's Cat totally wrong, or is there something I am missing?
According to the article these quantum computers will use registers and operators. The registers will be useful for holding pointers to memory locations. The operators will include boolean operators.
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
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 until exit conditions are true)
Parallel computing - because you different threads the same local variables might have different states
PS: knowing more about basic principles might help finding the best algorithm (somewhat like knowing about cache and writing algorithms around small buffers)
"Seriously?! Now I have to change my PGP key..."
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.
DNA is a Turing machine. You, however, being dynamic and emergent, are not.
Here's a question to the Slashdot crowd: What resources on quantum computing and quantum mechanics are out there? I'm asking from the perspective of a computer scientist who has heard of quantum computing and know the very basics, but has yet to delve any deeper into it.
Which websites would be useful? What books would be useful? What else would you do to gain a better understanding of the theory?
Your last paragraph seemed significant somehow, but I haven't had time to think it through. Perhaps it is just the "quantum" context that is causing the illusion.
John Searle used the Chinese room thought experiment to try and debunk some theories about hard AI. He prefers to think that minds are quantum devices rather than classical computers. The thought of having a computer language for an abacus seemed to connect with this problem. Anyone?
Does quantum computing mean that the question 'array or list ?" is eliminated ? since quantum searches will become constant time.
Does this also mean that DB indexing would be a thing of the past ?
At least not compared to the history of ordinary computers. The theory of computation predates actual hardware with more than a decade.
The Sinclair QL - the worlds first 32bit home computer
QL = Quantum Leap
According to his book Just for fun Linus Torvalds cut his teeth on this old classic
I don't remember superbasic having any qubits or quantum registers or quantum operators though, perhaps someone can backport the quantum programming language to it's rightful home
the standard first program on a quantum computer.
hehe
I agree that solutions are built into a superposition of answers, but that is at the hardware level, or at least IMHO that's where it belongs. In order for the true merits of quantum computing to be useful to a programmer, I believe the language should encapsulate the physics, especially when dealing with finite algorithms such as factoring numbers. The programmer should not need to think (or even know) about probablities when writing algorithms based on discrete mathematics.
Just think, in all those universes they can have monkeys programming. With an infinite number of monkeys they could accomplish anything!
Shakespeare, Stephen King, Windows, its all endless. Guess I'll have to find a job at McDoodles.
Sigh...
"You're on my side and the dark side, like Lando Calrissian?" --Gimpy, Undergrads
So now we are really hi tech we can make programming languages for computers before we make them....
could we have thoght about that a 1000 years ago....
this human species is funny kawrrakclw dont u think
The lunatic is in my head
If you want something more specific, check out Grover's algorithm for quadratic searching. Imagine a database with N entries, and you only need to spend sqrt(N) time to search the whole thing! For you cipherpunks out there, see Shor's algorithm for quantum computers. This is the algorithm everyone says will destroy public-key crypto.
Wouldn't a language that is purely procedural, like ML (or derivatives...) be useful here? I remember that a very high level of parallelism can be achieved with great ease, with pattern matching and similar features.
ML and friends are functional languages...
So...she needs a Mac?
If Mr. Edison had thought smarter he wouldn't sweat as much. --Nikola Tesla