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."
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?
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...
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.
schrodingers cat paradox in perl
Try to learn at least one of the theories of quantum mechanics before you start throwing around principles, okay?
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.
I believe that RSA relies on the intractability of undoing an exponentiation in the integers mod some prime. In other words:
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.
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.