Quantum Programming with Perl
moyix writes: "There's an article over at perl.com that describes how to use a perl module called Quantum::Entanglement. Using this module, one can simulate programming for a quantum computer. Developers looking to keep their skills current well into the next decade should check this out ;) Debian folks can grab libquantum-entanglement-perl and libquantum-superpositions-perl."
I always wondered how Larry Wall was seemingly in 10 different newsgroups at one time. I guess he's been using quantum physics all along...
how do we know if its real. Not many people have used quantum computers. The results could only be of non-quantum computers and we would never know, because we could never check.
"No fair! You changed the outcome by measuring it!" -- Professor Farnsworth from Futurama.
I suffer from attention surplus disorder.
Does it accurately simulate quantum processes's runtimes?
"a quote" -me
Given the power of a quantum computer, I'd expect, nay demand that it would DWIT. I don't wanna kludge along with perl or any other language.
And to think people complained that garbage collection was inefficient! Actually, though, this is a huge step forward for Perl. Now, with just a few lines of code, you should be able to consume massive numbers of CPU cycles while still actually accomplishing something.
The module actually looks pretty cool. It says that some simplifying assumptions were made. Does anyone know if the simulation is reasonably accurate? That is, could you actually set up a quantum computer to behave exactly as the simulated one?
I just happened to notice that Perl is being used for so many innovative research fields.
First of all Perl seems to be an excellent language for Bioinformatics, and Dr. Lincoln Stein is a leading voice in this area. Recently O'Reilly has been giving great coverage in this area.
Nanotechnology seems to be another area where Perl is getting much attention.
I believe the platform and vendor independence, absolute openness, and superb data munging capabilities of it are the main reasons for Perl's adoption in such academic research.
But, although I am an aspiring Perl advocate) and big Larry Wall fan myself, I wonder just how optimized these modules are for such intense low level work....
Broken Hearts are for Assholes. - Frank Zappa
The article does not mention quantum computers, devices which do not exist and may not for quite a while. It simply applies the idea of multiple coexistant states, only one of which being observable at a time, to Perl. You'll note that it runs on a conventional computer; mathematically, a quantum computer would have infinite times the processing power of our current supercomputers, as it could use system resources infinite times at once, assuming each state existed seperately. This does not relate in any way to the hypothesized "Quantum Computers" of the not-so-near future; rather, it is an interesting new operation in Perl which could make anything using random numbers more powerful and easier to code. Imagine the possiblities for games... a very easy way to weight values without using tons of variables... yummy.
First off, I thought just about everything was workable in PERL but this is scary. :) Regardless, to the best of my knowledge there are no working quantum computers (tangible at least.) How can we be sure that code created with this will truely work the same way when it's eventually put onto an actual quantum computer? Even were this based on a tangible prototype I'd feel there'd still be cahnges that'd need to be made. *shrugs* Guess I'm just a jerk about toying with theory. :)
( o ) one could say I'm rather baked
Anyone interested in doing any type of quantum computing should check out Dr. Damian Conway's excellent Quantum::Superpositions. It is an extension to the perl language which adds the operators "any" and "all"... it's lets you do *incredible* things like:
... }
... }
use Quantum::Superpositions;
if ($x == any($a, $b, $c)) {
while ($nextval < all(@thresholds)) {
$max = any(@value) < all(@values);
A good place to go and discuss the in's and out's of the cooler aspects of the perl community is perlmonks.org, check it out some time...
For some of us, this is nothing new.
Quantum Perl - "No longer will there be more than one way to do something, but rather there are an infinite number of ways to do everything!"
"Everything you know is wrong. (And stupid.)"
Moderation Totals: Wrong=2, Stupid=3, Total=5.
I know the module is supposed to simulate programming a quantum computer, but it is not trying to simulate a quantum computer, there is a fundamental difference.
Also, I sincerely doubt that quantum computers will function this way, it is not the purpose of quantum computers to store multiple values for a single variable; it is to use physical resources more effectively
This seems to be a complex random number generator rather than a quantum computer simulator. Can someone tell me how to make a program to search an unsorted list in O(sqrt(n)) time with this module?
Schroedinger Perl -- All assertions are assumed to be true and false at the same time until such time as someone observes your website, at which time your site is forced into a particular state. Neat, eh?
In the end they will lay their freedom at our feet and say to us, Make us your slaves, but feed us. - Fyodor Dostoyevsky
After Microsoft's incredible implementation of the recursive crash (anyone remember the crash recovery that crashed?), this module now gives them a chance to have the superpositioned crash: your computer is both crashing and still alive.
--- Sigmentation Fault - Comments Dumped
It's 2:30 am and I'm thinking how exciting quantum computing is. :(
Awwww... I need a life...
At least I might or might not have a life.
use Quantum; my $jump = Quantum::Leap->new(); # nothing happens... Damn! Why doesn't it work??
Dont we have Entangled code already today :D
Can you imagine the bugs in quantum code!
----- Whats wrong with this picture? http://www.revoh.org:1234/whatswrong
"This still leaves us with plenty of ways to make Perl behave in a thoroughly unpredictable fashion."
Is it just me, or doesn't "good Perl code" already work that way unless you've spent the past 10 years developing for it? I for one can't make heads or tails of tight Perl coding methods.
Do you like Japanese imports?
Not only is it spaghetti code, now its entangled. Nice!
Liberty in your lifetime
And when one of these application crashes, itll go with a bang allright.... *Access Violation* there goes the space-time continuim..
----- Whats wrong with this picture? http://www.revoh.org:1234/whatswrong
He obviously knows less about quantum computing than those who wrote the perl program.
> You'll note that it runs on a conventional computer
So what? Any quantum calculation can be simulated on classical hardware, just more slowly.
> a quantum computer would have infinite times the processing power of our current supercomputers
Make that "exponentially faster". Infinity is really really big in case you don't know.
> I know the module is supposed to simulate programming a quantum computer, but it is not trying to simulate a quantum computer
That's a gem.
it is not the purpose of quantum computers to store multiple values for a single variable; it is to use physical resources more effectively
Well that does it, you really don't know what you're talking about at all.
Much like the Quantum module, you can test it on Perl, but don't expand any real time applications any time soon.
Live web cams
In any case, some researchers at IBM and other places have built small quantum cells than can make use of the above algorithms.
The problem with quantum computing is that many answers are revealed at once, most of which are incorrect. The algorithms need to be able to separate the wrong from the right. It's a task for bright logicians :)
-
Also, remember that this does not turn your box into a quantum computer. It's well known already that quantum computers cannot do anything that normal computers can't (they both are Turing machines); they just do some things quite a bit faster.
Escher was the first MC and Giger invented the HR department.
I must admit that I didn't read through the entire article, but what I understand from quantum computation, this development might allow someone to implement a solution to the halting problem. I remember reading that Deutch (I think that is his name can't be sure tho my notes aren't here...perhaps someone who knows could help out) had shown that with quantum computation a decider can be made for the halting problem.
If this module is powerful enough, perhaps we could find ourselves in quite a mess of a 'turing machine' solving the halting problem due an implementation of quantum effects. Of course this should be impossible so the theory goes, but what if?
My knowledge of computation theory is limited and if there is expert that could sway me one way or the other I think quite a few of us would be interested.
might have used Perl :-)
At the beginning was at.
There's a C++ version of the library here.
Just thought you'd want to know
If you go to your local book store and look at the subjects in the computer language section you will find a very good metric that java had its 15 minutes of fame.
In the past the largest sections cycled through Pascal, Ada, Visual Basic, C++, Java or now C#. The section sizes of C, Cobol, Fortran and Perl are very consistant. I see this as a sign of what will be here in 30 years and what won't.
Finally, an application which Perl can't make more confusing.
-Paul Komarek
That people can know how to program a Quantum Computer, when no such device yet exists? (I'm not counting the two Qubit ones when something like six are needed to do anything useful)
this module now gives them a chance to have the superpositioned crash: your computer is both crashing and still alive.
Linux can already do that, and it turns out to be useful for firewalls with static rules.
Will I retire or break 10K?
Although I can't get to the article right now, I do know a little about quantum computing thanks to having just finished a thesis on the subject.
Studying the actual research in the field reveals that a real quantum device does not at all resemble a superintelligent "infinitely-faster-than-my-Pentium-4" computer of the future. To understand the difference requires understanding the fundamental nature of a quantum device and how it differs from a digital device.
The atomic unit of a quantum computer is a physical system of some sort that exhibits quantum behavior, such as a single electron and its spin. Whatever the implementation, the unit is called a qubit. A single qubit contains information sometimes described as a vector of complex numbers.
A digital computer, of course, operates on bits which allow only two states, the most common implementation of which is a high or low voltage at some defined point in an electrical circuit.
Some operations are natural and easy to perform on bits; these are AND, OR, NOT, XOR, and their Boolean friends. These operations, in turn, lend themselves to an easy and natural implementation of integer math. Other operations do not have a natural representation in digital computers, such as real-number arithmetic. For the relatively few occasions that call for irrational numbers, we make do with approximations and call it "floating-point" math.
The qubit's advantage is that, thanks to quantum mechanics, some operations which are very difficult for a digital computer are easy and natural for qubits. Notably, a set of qubits can perform a Fourier transformation in near constant time--an astounding operation that is so far believed to be impossible on any kind of Turing machine.
The other side of the coin, which is rarely understood by mainstream news reporters, is that the qubit is completely unable to address most of the rest of our favorite operations, such as integer addition. To ask a qubit to count from 0 to 9 is extremely difficult, maybe physically impossible.
If that weren't bad enough, quantum algorithms have to deal with other constraints such as the prohibition against creating a copy of an unknown quantum state. Therefore, your quantum Perl is going to have to start by doing away with the assignment operator. Qubits also have a nasty tendency to occasionally do things completely unexpected and unpredictable; this requires massively redundant calculations to reduce the probability of error to something acceptably small. (Of course digital computers suffer from random bit rot as well; it is solved with similar error detection and correction algorithms.)
All these obstacles discouraged any serious interest in quantum devices for some time. However, recently (1997?) Peter Shor published the first important quantum algorithm, which factors large composite numbers in polynomial time. In case you don't know, a computer with such a capability would have staggering implications. Much of the world's data protection is based on the RSA algorithm which relies on the difficulty of factoring large numbers.
Hence, the last few years have seen no shortage of funding or interest in quantum computing. Unfortunately, the mainstream media has caught just enough of the conversation to get the false idea that quantum computers are going to blow away all of the digital technology in existence, coming soon to a Best Buy near you.
Anyway, the moral of the story is, don't start saving for that Pentium-Q just yet; not only is a quantum device completely inappropriate for the overwhelming majority of computing tasks, but the current state of the art is a machine on the order of 10 qubits or so. (A few hundred qubits will be needed before Shor's algorithm presents a threat to current encryption.)
More realistically, you might expect to see one day in your lifetime a "quantum processing unit" that exists as a special-purpose extension to your digital processor--think along the lines of the 80287 floating point coprocessor. Even this kind of application is decades away at best.
I wonder... Who out of anybody would be the first group to adapt and use this...
SendSpamTo(any($a, $b, $c, {....})...
Wow... Quantum Spam... Imagine the possibilities of bandwidth usage...
Or How about...
DOSAttack(any($a, $b, $c, {....})...
A Quantum DOS attack...
Hey just thinking out load how slow the net could be in the future
schrodingers cat paradox in perl
The real use of this is for people who want to experiment with quantum _algorithms_ on small data sets and learn and understand better how quantum computers work and how quantum calculations are put together. Writing quantum algorithms is hard and confusing to somebody familiar with classical computation, even if you are familiar with quantum mechanics. There are very few useful quantum algorithms (Gover's search and Shor's factorization algorithms are the two most famous and interesting IMHO). This module might encourage more people to come up with and experiment with quantum algorithms that take advantage of the "inherently parallel" nature of quantum computing.
Note that though I am no expert, I did actually write something modestly similar to this Perl - an interpreter that read a series of meta-language commands and turned them into physical magnet pulses for spin flipping on an NMR quantum computer we had at MIT. We never bothered to write a simulator for it, but now that I think about it, it would be cool to have this. Kudos to these guys for doing this.
Now if somebody could just make a quantum computer with, say, 20 or 30 qubits I might be convinced that quantum computing could eventually do useful calculations and that the decoherence problems and setup problems for a large number of weakly coupled qubit units are not intractable. Perhaps an alternative to NMR as the substrate for quantum computing might get farther.
IMHO, the Heisenberg Uncertainity Principle kind of makes quantum computing very not useful...
Of course, the same principle applies to it's creator being a Nazi or not.
Between the voodoo and uncertainty of quantum mechanics and \%{$Magical{'Perl'}[$#$syntax]}, who'll ever need to encrypt their code? =)
Let's say you have two qubits representing all superimposed numbers between 0 and 3 and you want to add 1 to all of them simultaneously. According to quantum computing experts, one can perform an operation on all the numbers at once. So after the addition operation the two qubits now have all the results between 1 and 3 (assuming the carry is thrown away). The question is, how does one get just one of the results back and be certain that it is the correct one?
Another way to play around with nonclassical algorithms and get your feet wet with quantum programming would be QCL.
QCL is a procedural quantum programming language which provides nonclassical language elements such as unitary operators, running code in reverse, scratch space management, etc. A Linux interpreter (GPL) which simulates a quantum computer with an arbitrary number of qubits is available here.
Quantum Computing, because spooky action at a distance is more than hobo-love in a dark alley.
Of all the things I've ever heard - this has messed with my head the most...
(This is the Drake equation for the 22nd Century)
The Harter Equation:
*If* it's possible to make a quantum computer that can describe a reality equal to or greater than our own universe in detail, and *if* it's possible to create an infinite number of simulated universes with this level of detail, the chance that our universe is actually a quantum simulation would be nearly infinite*. There would be infinitely more artificial universes (that think they're real) than real ones. Now if an artificial universes (like our own?) can create other artificial universes, the chances that we're an original universe becomes even more implausible. Nice dreams!
Well, to be fair: of course doing non-deterministic programming in parallel is exactly what quantum computing is all about. The thing is just - modules to simulate non-deterministic programming (albeit mostly in NP, not in P) have been around a while. Only when the different subtrees can be traversed in PARALLEL, like on a quantum computer, it gets new again. Not that non-deterministic programming on single-state computers is uninteresting...
-- Beware the Jabberwock, my son!
Damian Conway will give a public talk at ETH Zurich (Swiss Federal Institute of Technology) on Monday, February 11th, 2002 at 17:00h.Everybody is welcome. Location: Departement of Information Technology and Electrical engineering, Gloriastrasse 35; Auditorium E6. http://www.ee.ethz.ch/events/index.en.html Abstract
We just know *how* - if you want "why" talk to a philosopher or theologian or the Pope.
Actually, unlike all of the 2 million times people have posted this comment, a Beowulf Cluster of these would actually run more slowly than a single machine.. given the exponentiality.
the superpositioned crash: your computer is both crashing and still alive.
But you still have to look inside to b0xen before you know which state it's in, right?
They can spend their money on developing the quantum hardware but they will have a language and probably the neccessary algorithms to start decrypting my emails almost immediately.
if ("bomb" foundIn( any(decryptedMail) )) {... send guy round...}
Yours,
An Optimist.
(PS Hey guys, just trying to save you a buck.)
Isn't that pretty much how it works anyway? What, with the fact that most websites seems so well tested.
*cough*
Please mod this post only if you think others should/n't read this. I have enough ego^H^H^Hkarma. Thanks!
It may be, then, that the earlier discussion of deviance is rather different from a parasitic gap construction. Nevertheless, the appearance of parasitic gaps in domains relatively inaccessible to ordinary extraction appears to correlate rather closely with an important distinction in language use. In the discussion of resumptive pronouns following (81), the systematic use of complex symbols is, apparently, determined by the extended c-command discussed in connection with (34).