Slashdot Mirror


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."

12 of 177 comments (clear)

  1. oh, by the way... by solistus · · Score: 2, Informative

    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

  2. Re:A little ahead of ourselves? by vslashg · · Score: 2, Informative

    Regardless, to the best of my knowledge there are no working quantum computers.

    How quickly we forget.

  3. sorting, factoring by rebelcool · · Score: 2, Informative
    algorithms have been worked out for sorting things and factoring primes using quantum techniques. However, only those 2 things have been settled at the moment (if you're getting a degree in philosophy, figuring out the quantum equivalent of boolean algebra is the way to make your mark on the world this century).

    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 :)

    --

    -

    1. Re:sorting, factoring by Uller-RM · · Score: 2, Informative

      "An Introduction to Quantum Computing Algorithms" by Arthur Pittenger, published by Birkhauser. 1999 text - I'm actually taking a class on QC at the moment. Starts out with a review of quantum statics (you will need a good grounding in Heisenberg's interpretation of QM and linear algebra, make no mistake) and then dives into the basics of quantum computing, covers the major algorithms of the last few years (Deutsch-Jozsa, Simon, Grover, Shor, and finite Fourier transforms), and error correction.

  4. Stupid function names by TeknoHog · · Score: 2, Informative
    They use the entangle() function to create a variable whose value is a superposition of several possibilities. Simply having a superposition does not mean entanglement (even in Perl, believe it or not) so they could have named it better.

    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.
  5. Re:thats nice but.. by jfonseca · · Score: 2, Informative

    http://www.internetnews.com/dev-news/article/0,,10 _943731,00.html

    Scientists at IBM Corp.'s (NASDAQ:IBM) San Jose, Calif.-based Almaden Research Center this week rushed to report that they have performed a challenging quantum computer calculation, causing a billion-billion custom-designed molecules in a test tube to become a seven-qubit quantum computer.

    With that breakthrough, they solved a simple version of the mathematical problem that is the crux of many of today's data-security cryptographic systems. According to Nabil Amer, manager and strategist of IBM Research's physics of information group, this was quite a feat.

    "This result reinforces the growing realization that quantum computers may someday be able to solve problems that are so complex that even the most powerful supercomputers working for millions of years can't calculate the answers," said Amer.

    --
    Broken Hearts are for Assholes. - Frank Zappa
  6. Not only for Perl by Anonymous Coward · · Score: 4, Informative

    There's a C++ version of the library here.

    Just thought you'd want to know

  7. Re:Perl and Research by Anonymous Coward · · Score: 2, Informative

    Perl is a terrible language for Bioinformatics. Perl is an excellent language for the subset of Bioinformatics dealing with sequence analysis and searching. Particularly for being the interface between the user and the database. There's a lot of work going on not dealing with DNA that Perl is essentially useless for (it's mostly high-performance numerics so a lot of Fortran). Even for some sequence work, such as fragment assembly, Perl probably wouldn't be a good language because it's a high-dimension integer optimization problem that's been abstracted past the point of string manipulation.

  8. "Quantum" programming in Perl, oh brother.. by amitola · · Score: 5, Informative

    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.

  9. The real use of this... by Fnkmaster · · Score: 5, Informative
    I think this seems to be a bit lost on some people here. Obviously, it takes exponential time to simulate a lot of interesting things that would take polynomial time on a real quantum computer. This Perl simulator module is cool, but it's not going to prove or disprove P==NP.


    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.

  10. Re:Quantum::Superpositions by twoshortplanks · · Score: 2, Informative
    Dr Damian Conway is one cool dude. And he's doing some cool stuff with Perl, which you can read about in his diary,The Conway Channel as linked to by the previous poster.

    Of course, Damian is paid by the Perl Community to do this cool stuff. We're still looking to make up the funding for the later half of this year. Want to donate? Get yourself across to the donations page

    --
    -- Sorry, I can't think of anything funny to say here.
  11. Damian on Quantum::Superpositions at Zurich, CH by zaucker · · Score: 2, Informative

    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