top | item 14595290

Rigetti Forest 1.0 – programming environment for quantum/classical computing

173 points| reikonomusha | 8 years ago |medium.com

71 comments

order
[+] reikonomusha|8 years ago|reply
Hello HN! We at Rigetti are really excited to announce and release Forest. My colleague @dangirsh and I will be here today to answer any questions that might come up about Forest and quantum computing!

Some potentially HN-interesting links:

pyQuil, a Python library for quantum programming: https://github.com/rigetticomputing/pyquil

pyQuil on RTD: https://pyquil.readthedocs.io/en/latest/

Grove, a collection of quantum algorithms in Python: https://github.com/rigetticomputing/grove

[+] jvns|8 years ago|reply
> We’ve gone from single-qubit devices to fully-functional 8-qubit systems that are now in the final stages of validation.

How hard of a problem can you solve with 8 qubits? For example, if you're implementing shor's algorithm -- it looks (very naively) from the wikipedia article that to efficiently factor a number of size N, you need about log(2N) qubits. So with 8 qubits you could factor the number 32 efficiently (is that calculation right?). Can you do things more difficult than 'factor 32' with 8 qubits?

(not intended as an attack at all, i genuinely just do not understand how to reason about the power of quantum computing devices with X qubits)

[+] reikonomusha|8 years ago|reply
This is a good question. 8 qubits will not solve any problems that a classical computer can't. In fact, considering just how blazing fast modern CPUs are, you can simulate an 8-qubit chip faster and with more fidelity than you can with 8 homegrown qubits.

Shor's algorithm isn't a good candidate for near-term use of a quantum computer. Other algorithms, such as the variational quantum eigensolver or the quantum approximate optimization algorithm are better. These can be used to solve chemistry and optimization problems, for example.

We actually made a little demo to show a little game you can play with 8 qubits. It may not be able to handle the load of HN if it finds its way to the masses, but check it out! [0]

[0] http://demo.rigetti.com

[+] pieteradejong|8 years ago|reply
As a software engineer looking for a highly marketable and differentiated skill set, given your projections for quantum computing roadmap, when should I start exploring this area? (or: when should I start writing code and doing side projects)
[+] reikonomusha|8 years ago|reply
Now. "Exponential" is faster than most people, including myself, can believe. When one unit of resource doubles your computational capacity, it doesn't take many units.

I like to use the analogy. Adding 1 GB of RAM these days isn't that big of a deal. You can maybe open two more tabs in Chrome. :) Adding 1 giga-qubit to your computer would make it 4.6 x 10^301029995 times better. That's unimaginably more powerful than anything any human can think of.

We don't have quantum software engineering figured out. And it's not going to be figured out by a few academics, although they may lay some good foundations. It's going to be figured out by the same folks who figured out traditional computing: people who try stuff, break stuff, and experiment.

[+] teafaerie|8 years ago|reply
Also what percentage of the engineers at Rigetti actually think that you are in any sense "leveraging the multiverse" with this sort of technology, and how many of you prefer an alternative explanation?

I understand if you don't want to make a public statement about such divisive (and perhaps, more importantly, ill-defined) matters in this context. I'm just curious about the way that the people who are actually building these things tend to view them...

[+] dangirsh|8 years ago|reply
I think this is the best question so far :)

After an informal poll of ~30 of our scientists/engineers, ~8 said they subscribe to the many-worlds interpretation [1] [2] of quantum mechanics. To be honest, this is a discussion that comes up surprisingly infrequently at the office!

This result reminds me of Sean Carroll's "Most Embarrassing Graph in Modern Physics" [3]. When top theoretical physicists are polled, it seems like no interpretation of quantum mechanics even takes the majority! In my view, the lack of consensus around this (after ~100 years) underscores the strangeness of the theory.

I should mention that David Deutsch (one of the pioneers of quantum computing), Steven Hawking, Max Tegmark, Sean Carroll, John Preskill, and many other prominent physicists prefer the many-worlds interpretation (citation needed).

If you like the "leveraging the multiverse" view of quantum computing, be sure to watch David Deutsch's video lectures [4]! In his view, multiple universes is the way to explain the power of a quantum computer.

[1]: https://en.wikipedia.org/wiki/Many-worlds_interpretation

[2]: https://plato.stanford.edu/entries/qm-everett/

[3]: http://www.preposterousuniverse.com/blog/2013/01/17/the-most...

[4]: https://www.youtube.com/watch?v=24YxS9lo9so

[+] reikonomusha|8 years ago|reply
@dangirsh is polling people at the company now to answer this question!

As for me, the only way I could even attempt to understand this quantum mechanics business was through the multiverse perspective. Fun fact: The QVM actually implemented the multiverse interpretation of quantum mechanics. Every qubit measurement, in particular, would branch the wavefunction into two separate universes. This was a perfect way to bring my computer to a grinding halt in no time.

[+] drdre2001|8 years ago|reply
Your GitHub account [0] gives Common Lisp some love. Why did you choose to use this language? Specifically, for the implementation of your Quantum Virtual Machine?

[0]https://github.com/rigetticomputing

[+] reikonomusha|8 years ago|reply
That's my doing.

When we started thinking about quantum programming languages, we didn't know what they should look like. Experimenting with different languages efficiently requires a language that makes language-building easy. I find that there are two classes of languages that provide that: Lisp-likes with metaprogramming and ML-likes with a good type system including algebraic data types.

Quil [0], our quantum instruction language, came out of language experimentation in Lisp. In fact, the Quil code:

    H 0
    CNOT 0 1
    MEASURE 0 [0]
used to look like this:

    ((H 0)
     (CNOT 0 1)
     (MEASURE 0 (ADDRESS 0)))
This was a no-hassle way to play around without thinking about how to wrangle lex and yacc with shift/shift and shift/reduce issues. If you've ever used them, it takes a while to get what you want, and integrate it into a product you're trying to create.

In addition to the need to construct languages, we also needed to simulate/interpret the language. Simulating the evolution of a quantum state is very expensive (which is why we are building quantum computers!), and is usually relegated to some closer-to-metal language like C.

Unfortunately, in C, high-speed numerical code (that is also blazing fast) is very difficult to experiment with, extend, maintain, etc.

Fortunately, over the past 30 years, Lisp compilers have become excellent at producing native machine code. With a compiler like SBCL [1], you can produce code which is very nearly optimal. For example, we have a function to compute the probability from a wavefunction amplitude. Here it is:

    > (disassemble #'probability)
    ; disassembly for PROBABILITY
    ; Size: 90 bytes. Origin: #x22B67F5A
    ; 5A:       F20F104901       MOVSD XMM1, [RCX+1]
    ; 5F:       F20F105109       MOVSD XMM2, [RCX+9]
    ; 64:       F20F59C9         MULSD XMM1, XMM1
    ; 68:       F20F59D2         MULSD XMM2, XMM2
    ; 6C:       F20F58D1         ADDSD XMM2, XMM1
    ; ...
There's some additional code that follows, but it disappears because this function is also inlined at the call sites.

Writing the QVM and associated compiler in Lisp has allowed us to move fast. The code is compact, extremely robust, and extremely fast.

I could say a lot more about this, but that's the gist of why we thought it was a sensible decision.

[0] https://arxiv.org/abs/1608.03355

[1] http://www.sbcl.org/

[+] teafaerie|8 years ago|reply
So if I understand it right this process requires some pretty specialised and delicate equipment... for instance you have to be able to get Helium3 down to something like as cold (compared to us) as the sun is hot. For what I'm asking it doesn't matter if that is technically true... point is you need some pretty fancy technology.

Now it's true that classical computers used to take up whole buildings. Living people remember this. And progress is supposed to be getting faster and faster. But given the particularly arcane constraints... how long if ever before this kind of technology can be a part of the daily lives of most Teran Citizens? Will it ever be possible for us to have it at home? Or will we always have to send out requests to more centralised machines that will then send us back answers?

[+] reikonomusha|8 years ago|reply
I don't know whether or not we will have the technology in the future to eliminate the need for such environments. Different kinds of qubits are an active research activity. Ions, dots, diamond vacancies, etc.

The bigger point to realize, I think, is that most people's computing doesn't even happen at their home anymore. Much of it happens on some blade in a server rack. I think, for the time being, quantum computing will be just like that.

It was pretty inconceivable, in my retrospective of computing, to think that vacuum tubes would be miniaturized to fit in little boxes in bedrooms. You really needed the discovery of a IC transistor to let that happen. That hasn't happened yet with qubits, and I don't think one can with any certainty predict it.

[+] jcccc|8 years ago|reply
How is Forest different from IBM's quantum experience?
[+] dangirsh|8 years ago|reply
Great question. Both the IBM Q experience and Rigetti Forest allow users to write quantum algorithms with Python that can execute on real quantum hardware. Forest is different in 3 main ways:

1. Forest was designed with near-term applications in mind. Specifically, it uses our quantum instruction set (Quil) [1], which was designed for implementing classical/quantum hybrid algorithms [2]. These algorithms can leverage near-term quantum devices significantly more than "textbook" quantum algorithms (like Shor's). IBM Q places much less emphasis on hybrid computation.

2. Forest provides raw access to the quantum hardware. There's an API [3] for users to run "analog" experiments to understand the performance and noise characteristics of our qubits. If you're developing near-term applications for quantum computers, having access to this physical layer of quantum devices is crucial. IBM Q doesn't provide a similar API to my knowledge.

3. Programs written with Forest can execute on up to 30 virtual qubits on the Rigetti QVM [4]. This allows users to develop quantum algorithms ahead of any physical device that can run them. Especially if you include noise modeling (we do), 30 qubits is well beyond what you could simulate with your laptop. IBM Q offers a 20 qubit simulator, which is roughly 1000 times less powerful than 30 qubits.

I must mention that IBM recently announced their experience will have up to 17 real qubits! This is larger than any physical device Forest is currently connected to, and represents exciting progress.

[1] https://medium.com/@rigetticomputing/introducing-quil-a-prac...

[2] https://arxiv.org/abs/1509.04279

[3] http://pyquil.readthedocs.io/en/latest/qpu.html

[4] http://pyquil.readthedocs.io/en/latest/qvm_overview.html

[+] pierre_d528|8 years ago|reply
I came across this video trying to understand what are quantum computers about... After all, Feynman himself said: "If you think you understand quantum mechanics then you don't understand quantum mechanics." and "If you cannot build it, you do not understand it."

I wonder if anyone could link to something that makes the stuff clear.

https://www.youtube.com/watch?v=dKAF9OCQtIo

"QBism is NOT NEW but at least people are reviving what Bohr thought. QM just involves expectations of observables and the Born rule is just "metaphysical fluff." The confusions are all about false counterfactuals."

[+] juliangoldsmith|8 years ago|reply
What is the state of languages for programming quantum computers?

I noticed you seem to be using assembly at the moment. Are there higher-level languages out there at the moment, or are those still a ways off?

[+] dangirsh|8 years ago|reply
We have a Python library called pyQuil [1] for writing high-level programs for quantum computers. The "assembly" you mentioned is Quil [2], which we don't expect most users to use directly.

Other high-level languages for quantum computing include LIQUi|> [3] and Quipper [4]. Each approach has it's strengths, but we believe Quil/pyQuil is the best choice for near-term applications. See the Quil paper [5] for more details.

[1]: https://pyquil.readthedocs.io/en/latest/

[2]: https://medium.com/@rigetticomputing/introducing-quil-a-prac...

[3]: https://www.microsoft.com/en-us/research/project/language-in...

[4]: http://www.mathstat.dal.ca/~selinger/quipper/

[5]: https://arxiv.org/pdf/1608.03355.pdf

[+] Karrot_Kream|8 years ago|reply
Do you guys provide access to actual quantum/hybrid computers now or is it all simulated?
[+] wzeng|8 years ago|reply
Signing up automatically gives you access to run on the simulator. For select users, we are providing some limited access to one of our prototype quantum processors. It's the one discussed in this paper [0]. This initial access doesn't allow a user to run full quantum programs like on the simulator, but but one can test out a few interesting experiments. You can read about what experiments are available here [1]. If you'd like to apply to run some experiments on our hardware then email us with some information about you and your interests at [email protected]

The access to quantum hardware is limited at this point, but we'll be adding new features over the coming months.

[0] http://www.rigetti.com/papers/Demonstration_of_Universal_Par... [1] http://pyquil.readthedocs.io/en/latest/qpu.html

[+] andreyf|8 years ago|reply
But does it run Linux?
[+] dangirsh|8 years ago|reply
We couldn't make the binaries small enough for our current device ;)

We use Linux heavily to develop our own quantum OS. Programs written with Forest targeting the QPU [1] pass through the quantum OS, which runs on the control systems at our facilities. Thanks to our cloud API, users don't need to know these details.

[1]: http://pyquil.readthedocs.io/en/latest/qpu.html

[+] negativ0|8 years ago|reply
too bad "rigetti" in Italian means literally "you puke"
[+] reikonomusha|8 years ago|reply
Unlike Italian, the company name is pronounced with a hard G. And as far as I know, "rigetti" in Italian is "you discard".

Take it as discarding the transistor era of computing for wonderful qubit era. :D

[+] spullara|8 years ago|reply
it is the founder's last name.
[+] ConAntonakos|8 years ago|reply
I read this as "Bighetti" from HBO's Silicon Valley.