# Google's Quantum Online Sandbox

*(perhaps you already saw this picture, although it is strange that there are so few materials on quantum computer science on the hub)*

Thanks to the ingenious Google engineers, now we can all turn our desktop PCs into quantum computers. Well, well, not quite like that: it only means simulating the work of a quantum computer on its younger brother by launching a web application for Chrome. Quantum Computing Playground allows you to run well-known quantum algorithms (such as Grover, Shore) and write your own quantum programs.

With the exception of the direct acquisition of a quantum computer — which, despite D-Wave’s announcement, is unlikely to ever succeed — Google’s decision is the most successful step toward popularizing the quantum beast. If you want to personally get on the first step of calculating 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 intricacies of quantum computing.

**Quantum Computing Playground**

Playground is a Chrome web application (Chrome Experiment)using WebGL to simulate up to 22 qubits per GPU. There is a small development environment to write, compile and execute code. There are also ready-made examples of algorithms (Grover, Shor), a convenient debugger and a tool for 3D visualization of quantum states, so you can see for yourself what is happening inside your small quantum computer. Programs are written in a language called QScript, which is very similar to any other scripting language.

**QScript**

Unfortunately, if the user does not have any programming experience, it will probably be quite difficult for him to take full advantage of the sandbox - there is no tutorial here, and the comments in the examples are actually not very detailed. On the help page, there are several tips about the internal workings of the simulator and hints on what QScript is, but it still requires a pretty solid foundation in quantum theory to understand everything thoroughly.

**D wave**

Curious for Google, the Marketplace uses the Quantum Gates model, not the adiabatic quantum computing used in D-Wave, in which Google ordered a quantum computer last year. There has always been plenty of debate about D-Wave. Do their machines really perform real quantum computing, especially when they are 6,000 times more expensive than a classic PC? If the site uses ordinary quantum gates, does this 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 an ordinary apparatus of linear algebra, pulling linear spaces and linear operators (they are also "gates"), so there is nothing to worry about implementing this device programmatically.*

*Having read up to this point, you have read a full humor and color article from extremetech.com .*

So, QScript and its compiler / VM. Google provides the following features:

- compilation into internal code directly from the browser

- the ability to step-by-step execution of compiled commands

- built-in procedures

- local variables (within procedures)

- expression syntax compatible with JavaScript

- access to mathematical functions of JavaScript

- “for-endfor” loop, “If-else-endif” construction (amazingly)

- full debugging support with call stack and variable tracking

In order not to clutter up the article, the following are the main quantum gates implemented in this sandbox:

**The**Hadamart Gate**operator**creates a superposition of states 0 and 1 for a given qubit. In terms of meaning, it is the opposite of itself: applying it two times restores the initial state of the qubit.**Sigma X**(Sigma X, also known as Pauli X rotation) is the quantum equivalent of bit negation. Since qubits are complex numbers, it is quite difficult to come up with the concept of ordinary negation for them. Sigma Y and Sigma Z also “invert” qubits, but in a slightly alternative way.**QFT**applies the Quantum Fourier Transform to the quantum register part. The first argument defines the first qubit for the transformation, while the second determines the width of the transformation (the number of qubits to which the transformation will be applied).**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 a value of 1. The states where the control qubit has a value of 0 remain unchanged.**The Toffoli**Gate works in the same way as the CNOT, taking control qubits as two arguments and one target qubit. Negation is carried out only on those states where both control qubits have a value of 1.**Phase rotation**(Phase Gate) rotates the amplitude states (state - a complex number), where the target qubit has a value of 1. The angle of rotation is specified by the second argument.**Measurement**- does not accept any arguments, but only uses a random number generator (thanks to JavaScript), selects a state from a quantum vector, which is a random value of a physical measurement of a quantum register. The operation does not destroy the quantum vector, and therefore, measurements can be performed again and again without having to repeat all previous quantum calculations again.

**Conceptually**

Generally speaking, it is not clear for what purpose they did this. On the one hand, the environment is clearly aimed at beginners who are finally trying to “see” and “touch” the quantum mechanics that they have encountered for one reason or another. But then the question arises: where does the gigantic reluctance to write manuals come from? It is also incomprehensible why to model the Shore algorithm without explaining to people how it differs from tossing a two-sided coin.

On the other hand, it is obvious that working in such a system is rather inconvenient, it is unlikely that someone will implement at least some application programs in the sandbox. There is a graphical interface, yes. But it ends with a banal display of points in space {state, time, amplitude} - no more.

There is a fairly wide range of tools to simulate the work of a quantum-mechanical system, but I would like to know if this is a hubre?