Quantum Programming with Perl 189
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."
Wow (Score:3, Interesting)
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?
Quantum::Superpositions (Score:5, Interesting)
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 [perlmonks.org], check it out some time...
Now to deal with that nasty Halting Problem.... (Score:1, Interesting)
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.
Re:Quantum::Superpositions (Score:4, Interesting)
I have to say that Conway is a brilliant speaker and truly funny. When he announced after a 3 hour talk that what he just spoke about isn't just a nice concept in theory but an actual perl module (only in a single universe and in real, often exponential time), the crowd just lost it and ROTFLed
Re:Quantum::Superpositions (Score:2, Interesting)
i have to admit though
any(@value) all(@values) is cool
why? because you dont have to write loops
for doing every different comparision. i bet
there are other benefits to the new syntax also.
but what does this have to do with quantum mechanics???
all of the operator overloading could
just be as easily called "set operators" or something.
then it wouldn't seem so spooky and mysterious,
and would rather seem like some practical
programming.
Schrodingers cat paradox (Score:2, Interesting)
Re:thats nice but.. (Score:4, Interesting)
For one thing, QCs do exist - in fact, they demonstrated Peter Shor's 1994 factoring algorithm on a recently built 7-qubit box, factoring 15 into 3 and 7. You may say big deal, but it can factor ANY such integer in polynomial time. Usually the NSA is about 10 years ahead of the private sector, so I figure they've got at least 10 qubits by now. You should be worried - most public-key encryption methods rely on the intractibility of factoring.
Secondly, the Heisenberg uncertainty principle only states that you can't predict with 100% accuracy which eigenstate a qubit will collapse into upon measurement. You can, however, compute a probability amplitude (which ends up being a complex number) that it'll be a 0 and another probability that it will be a 1. And it is possible to perform operations upon one or more qubits without measuring it - the idea of creating an operation that doesn't collapse the state is the crux of Quantum Computing.
Unlike macroscopic physics, we don't know WHY things work on the quantum level the way they do. We've gotten relatively decent at predicting the end results though. So, we're just as confused as before... but we're capable of doing useful stuff with it. Don't knock it.
Re:"Quantum" programming in Perl, oh brother.. (Score:2, Interesting)
Pick two probably-prime numbers and call them e and p. Compute (message^e) mod p, and send that along the wire. There's a third number you can pick if you already know e and p, that'll decrypt it. No factoring involved, except for picking your probably-primes in the first place.
Any cryptologists are welcome to correct me.
QCL (Score:5, Interesting)
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 [tuwien.ac.at].