And here we can just scroll down. You can see there's a whole lot more information here, descriptions of why qubits are named certain things, in-depth descriptions of why some are on and some are considered off, ket notation, all sorts of things that I'm just glossing over here. But you can really spend your own time with and get to know.
And this is my favorite right here, is the block-sphere representation of a qubit. So we can see this horizontal qubit, which is considered 0 or off, and the vertical qubit, which is its inverse. So this is considered on. And we also have all these other states. We can just rock around the clock here and see different qubit states. And qubits are really just matrices and vectors. And this will make a lot more sense in context when you look at gates and circuits.
One thing I just wanted to mention really quickly before we jump out of this is superposition. So you've probably heard some things like superposition means something, two things happen at the exact same time or maybe neither happen or something like that. Superposition just means a state where the probability of outcomes are not 100% yes or no, it's some mixture, that's it. I really like to demystify superposition because there's a lot of kind of pop science nonsense around it that just really doesn't translate once you learn the math.
One more thing that I want to touch on here is there are some purposeful quirks to this library. For example, when using the verbose syntax to do things with qubits, you'll notice that some commands have a dollar sign, for instance, at the end. This is a warning sign from the API. If you use the dollar sign, you are mutating your state, you are overwriting the value of that variable. You can see an example here where you add cat and dog and it's destructive, right? Notice that dollar sign suffix as opposed to the non-destructive version which will not change the value of cat. So that's just one example of some of the fun things you might encounter as you explore.
And, oh, right. I said I'd touch on quantum hardware again and here it is. I happen to work at Amazon for a little while in their web services division and Amazon just so happened to be working on a quantum service called Amazon bracket. You can access bracket through a prepared Jupyter notebook. Perhaps some of you might be familiar with Jupyter from doing machine learning. Anyway, here's a little demo video I made a few months before bracket launched using the QGIS interface to drive it. So here I have a Jupyter notebook with Amazon bracket loaded which means that I can use Python code, bracket is Python library, and I can use that to build quantum circuits that I can then run on a simulator in the cloud, or I can run on quantum hardware because Amazon has partnered with different quantum hardware vendors. And so we can do that, we can offer that to our customers and that's pretty exciting. But what's also exciting is this, with just a few lines of HTML, really two lines of HTML, I can inject QJS into this Jupyter notebook, it's now injected, and now I can inject my quantum circuit composer. And this composer, which should look awfully familiar, is writing bracket code.
Comments