(you may have already seen this picture, although it is strange that there are so few materials on quantum computer science in Habré)
Thanks to the ingenious engineers of Google, now we can all together turn our desktop PCs into quantum computers. Well, well, not quite so: it implies only modeling the work of a quantum computer on his younger brother by running a web application for Chrome.
Quantum Computing Playground allows you to run known quantum algorithms (such as the Grover, Shor algorithm) and write your own quantum programs.
With the exception of the direct acquisition of a quantum computer - which, despite the statements of D-Wave, is unlikely to ever succeed - the decision from Google is the most successful step towards popularizing the quantum beast. If you want to personally stand on the first step of computing the future, this is the very chance. Do you have children? You must put them in this sandbox for at least six hours so that they learn all the subtleties of quantum computing.
Quantum Computing PlaygroundThe site is
a Chrome web app (Chrome Experiment) that uses WebGL to simulate up to 22 qubits on a GPU. There is a small development environment to write, compile and execute code. There are also ready-made examples of algorithms (Grover, Shore), a handy debugger and a tool for 3D visualization of quantum states, so you can see for yourself what's going on inside your little quantum computer. Programs are written in a language called QScript, which is very similar to any other scripting language.
')
QScriptUnfortunately, if the user has no programming experience, it will probably be quite difficult for him to take full advantage of the sandbox — there is no tutorial here, and the examples in the examples are not very detailed. On the help page there are a few tips about the internal workings of the simulator and hints about what QScript is, but you still need a fairly solid foundation in quantum theory to understand everything thoroughly.
D-waveCurious to Google, the site uses a quantum gate model (Quantum Gates), rather than adiabatic quantum computing used in D-Wave, in which Google ordered a quantum computer last year. There has always been plenty of controversy about D-Wave. Do their machines really do real quantum computing, especially when they cost 6,000 times the price of a classic PC? If the site uses ordinary quantum gates, does that mean that Google knows that D-Wave really has nothing to do with quantum mechanics?
It is worth noting that the so-called "model of quantum gates" is a common apparatus of linear algebra, which draws linear spaces and linear operators (they are also "gates"), so there is no problem in implementing this device programmatically.Having read to this point, you have read the article full of humor and colors with extremetech.com .So, QScript and its compiler / VM. Google provides the following features:
- compile to internal code directly from the browser
- ability to step through compiled commands
- built-in procedures
- local variables (within procedures)
- syntax of expressions compatible with javascript
- access to javascript math functions
- “for-endfor” loop, “if-else-endif” constructs (amazingly)
- full debugging support with call stack and variable tracking
In order not to clutter the article, below are just the basic quantum gates implemented in this sandbox:
- The Hadamard operator (Hadamart Gate) creates a superposition of states 0 and 1 for a given qubit. In its meaning, it is inverse to itself: by applying it twice, it restores the original state of the qubit.
- Sigma X (Sigma X, also known as the Pauli X turn) is the quantum equivalent of bit negation. Since qubits are complex numbers, it is rather difficult to come up with the concept of ordinary negation for them. Sigma Y and Sigma Z - also "inverted" qubits, but in a slightly alternative way.
- QFT applies Quantum Fourier Transform to a portion of a quantum register. The first argument specifies the first qubit for the transform, while the second one defines the width of the transform (the number of qubits to which the transform will apply).
- CNOT implements the same transformation as Sigma X, but its execution is determined by the value of the first argument, the control qubit. Quantum negation is performed only for those states where the control qubit has the value 1. States, where the control qubit has the value 0, remain unchanged.
- The Toffoli Gate works in the same way as CNOT, taking control quits as two arguments and one target qubit. Denial is carried out only on those states where both control qubits have the value 1.
- The phase rotation (Phase Gate) rotates the amplitude of those states (the state is a complex number!) Where the target qubit has the value 1. The rotation angle is specified by the second argument.
- Measurement - takes no arguments, but only uses a random number generator (thanks to JavaScript), selects a state from a quantum vector, which is a random value of the physical measurement of a quantum register. The operation does not destroy the quantum vector, and therefore measurements can be performed over and over again without having to repeat all previous quantum calculations anew.
ConceptuallyGenerally speaking, it is not clear why they did it. On the one hand, the environment is clearly focused on newcomers, who are finally trying to “see” and “touch” the quantum mechanics with which they, for one reason or another, have encountered. But then the question arises: where does the gigantic unwillingness to write manuals come from? It is also not clear why Shore’s algorithm should be modeled without explaining to people what is different.

from tossing a dihedral coin.
On the other hand, it is obvious that it is rather inconvenient to work in such a system, it is unlikely that anyone in the sandbox will implement at least some application programs. There is a graphical interface, yes. But it ends on the banal mapping of points in space {state, time, amplitude} - no more.
There is a fairly wide range of tools that allow you to simulate the operation of a quantum mechanical system, but I would like to know if this is interesting for Habr?