# Square Root of NOT

Since I retired, I’ve been learning and exploring the mathematics and details of quantum mechanics. There is a point with quantum theory where language and intuition fail, and only the math expresses our understanding. The irony of quantum theory is that no one understands what the math means (but it works really well).

Recently I’ve felt comfortable enough with the math to start exploring a more challenging aspect of the mechanics: quantum computing. As with quantum anything, part of the challenge involves “impossible” ideas.

Like the square root of NOT.

To be clear, that’s not some poetic phrasing, the NOT in question is the logical gate that turns its single input into what it is NOT. (Concretely, it turns a 0 to a 1 and vice versa.) And we do mean the square root (√) math operation, too.

So how does one take the square root of a logical operation?

Part of the intuition involves the same line of thought as taking the square root of minus one. Whatever weird magic the square root of minus one might be or involve, we can count on multiplying it by itself (squaring it) to give us good old -1. No weirdness there.

Therefore, whatever weird magic the square root of NOT is, we do know that:

√NOT × √NOT = NOT

So two √NOT operations in a row give us a normal NOT we can deal with.

In a quantum computer, a single √NOT operation (or gate) results in a superposition of the qubit.

§

Another quantum gate we can take the square root of is SWAP, which has two inputs and two outputs. Obviously the SWAP operation does what its name implies. As with the NOT, we have:

√SWAP × √SWAP = SWAP

So two in succession result in a concrete swap of inputs. A single gate results in an entanglement of the two inputs.

Thus, in quantum computing, superposition and entanglement come, at least in part, from these gate operations.

§ §

All of which is to introduce this 2018 presentation from The Royal Institute (which does some outstanding lectures; I highly recommend the channel to all science geeks):

There was some synchronicity for me here in that the two speakers are chaired by Philip Ball, whose book, Beyond Weird: Why Everything You Thought You Knew About Quantum Physics Is Different, I bought and have started reading.

I didn’t know Ball was in this video! It begins with a speech from the Netherlands Ambassador, which I skipped through and, thus, missed the introduction of the male speaker who came next.

The video’s description first has a long paragraph about Artur Ekert, who “works on information processing in quantum-mechanical systems.” He was the first actual lecturer. The two paragraphs after Ekert’s name Harry Buhrman, the second speaker, a C.S. PhD and executive director or QuSoft, the Dutch research center for quantum software.

I was paying attention to the video so didn’t read all the way down to the last paragraph. I just assumed the guy I was watching must be Ekert.

The the more he talked, the more I thought, “Gee, he sure looks like Philip Ball.” (I’d seen him in an RI video not that long ago.) The speaker seemed to be more framing the lecture than giving the lecture, so I went back to the video description and read more carefully.

The last paragraph, just one sentence, starts off, “The event is chaired by award-winning science writer Philip Ball, whose latest book…”

Ah, no wonder that guy looks like him.

§

If you want to skip the introductory stuff, Ball starts speaking at 4:54, which is brief and I’d say worth watching. Ekert starts at 11:45, and Buhrman starts at 59:50. The whole thing is about 90 minutes. There doesn’t appear to be a Q&A.

I recommend this to anyone with a interest in quantum computing. It’s a pretty good introduction and was exactly the sort of thing I was looking for.

Plus, it introduced me to √NOT. I love learning a new concept!

§ §

Quantum computing involves the double-whammy of the math and understanding of quantum theory plus that of computer science.

I’ve dabbled in the latter since I was in college, and I’ve always been interested in basic physics. However both domains are the kind of thing where people can dedicate entire careers to studying in deep detail just one aspect. No one can learn it all nor even most of it, not in deep detail; to get to those depths one must specialize.

Me, I’m just getting to the point where I can take off the water-wings, strap on a snorkel, and do some free diving in the more accessible shallows. I think I’m still a ways away from anything that doesn’t involve holding my breath (so to speak).

I will say that I’m really enjoying Ball’s book, Beyond Weird. I’ll talk more about it when I’m done.

In the meantime, here’s the lecture Ball gave at the RI about the book.

It really is a great YouTube channel; lots of good science!

Stay superposed, my friends! Go forth and spread beauty and light.

The canonical fool on the hill watching the sunset and the rotation of the planet and thinking what he imagines are large thoughts. View all posts by Wyrd Smythe

#### 20 responses to “Square Root of NOT”

• Wyrd Smythe

(Fans of the MWI may be disappointed; it’s not mentioned at all. Ekert does mention that his “supervisor” (I thought he said; his Wiki page says “Doctorial advisor”) is David Deutsch.)

• SelfAwarePatterns

I have to admit I was somewhat skeptical of quantum computing for a long time, but the recent successes are starting to change my mind. I’m still not sure how much of a revolution it might provide, but I’m much more open to the possibility. It’s also what increased my interest in quantum mechanics a couple of years ago.

I saw that Ball talk a while back. It probably won’t surprise you I’m not wild about his take, or any other that says, “We just have to get over this idea of not being able to understand what actually is.” No! 🙂

• Wyrd Smythe

The real trick with QC is the software — finding applications that can leverage the effects in a useful way. QC isn’t particularly useful for normal computing. Probably it’s biggest application will be simulating quantum systems. It’s perfect for that.

I think your biases are showing wrt to Ball. That’s not what he’s saying.

• SelfAwarePatterns

It seems like for “regular” developers, QC will be a menu selection of algorithms they can invoke, at least for awhile. Eventually there might be higher level languages for it. But it will probably take a lot of ingenuity to rethink existing algorithms to take advantage of quantum processing.

On my biases, maybe so, but that is what I see him saying in the last few minutes with the isness vs ifness thing. I suppose it depends on how much that vision resonates with you.

• Wyrd Smythe

It’s not clear how much “regular” development will occur in QC — it’s not a better kind of computing, just a different kind. It will only have value in situations that can be posed in quantum terms and that can leverage interference to promote the desired answer.

Ball’s point is that we have to go beyond weird to understand what nature is telling us. Simply saying “it’s weird and we’ll never understand it” is, in fact, inexcusable.

• SelfAwarePatterns

It seems like QC specialists could develop APIs that everyone else could use. Until someone figures out how to do it at room temperature and miniaturize it, that might be web service APIs. So if you want to run Shor’s algorithm, you might make a call and pass parameters, and hopefully get back results.

The trick will be in understanding what quantum algorithms can help with what type of otherwise classical tasks. That will take a lot of imagination and innovation.

• Wyrd Smythe

Apparently QC is already available on the web. One of the speakers mentioned IBM has a five-qubit system online. (I think I heard something about Google doing it, too.) From the slide he showed, it’s a visual interface where you place sequential gate operations between the five qubits and that’s converted to a program that gets scheduled and run.

• Wyrd Smythe

Check it out: The IBM Quantum Experience

It’s kind of awesome. It looks like anyone can sign up… If so I just might!

• SelfAwarePatterns

Thanks! I think I pulled this up a while back, looked at it, and thought, “Yep, I have no idea what to do with this.”

• Wyrd Smythe

This morning I created an account, created my first quantum “circuit” — creating and measuring a Bell state — and ran the job (took only a minute or so to queue, schedule, and run). Basically I did a simplified simulation of the Alex and Blair experiment; a Bell state is two entangled qubits.

Here’s what it looks like:

The circuit designer also gives you the matching OpenQASM code:

```include "qelib1.inc";

qreg q[2];
creg c[2];

reset q[0];
h q[0];
reset q[1];
cx q[0],q[1];
measure q[0] -> c[0];
measure q[1] -> c[1];```

So there is the option to design more complex experiments using code. There is also a Qiskit package for Python. Pretty cool!

As you know, the expectation is that, if Alex measures |0⟩ then Blair should also measure a |0⟩. If Alex measures |1⟩ then Blair should, too. This being quantum, the results are never fully determined. I ran the job with 1024 “shots” and got the following result:

• |00⟩ — 44.531%
• |01⟩ — 2.539%
• |10⟩ — 5.859%
• |11⟩ — 47.07%

Generally speaking, as expected, Alex and Blair get the same result. Of the two possible results, they get them roughly half the time.

The system provides an output that (in part) looks like this:

So it’s pretty cool, a lot of fun, and very educational, but I can’t see that I’d ever do anything serious with it. (I think I could replicate that QC experiment Wallace described, though.)

The Scott Aaronson text mentions an interesting (if not super useful) application. Imagine we have a classical “flip a coin” system we want to test for fairness. The classical approach is to make many flips, record the results, and see if the two counts are close to equal. This requires enough bits to count as many flips as are made. It can be done with a single qubit.

We design a circuit that rotates the phase of a state just a little bit. Each time we “flip” our “coin” (we might even be flipping an actual coin), if it’s heads we apply the rotation clockwise, if it’s tails we apply the rotation counter-clockwise. If the coin is fair, the sum of rotations will tend to cancel out and the qubit will keep its original state.

But if the coin is biased, the bias will rotate the qubit away from the original state. A measurement on the qubit either returns the original state (coin is fair) or a new state (coin is biased).

Not super useful, but an interesting demonstration of a quantum advantage, at least in terms of bits.

I thought the Chinese used quantum computers and a satellite to make a totally secure connection? Not that I know what that’s about. I just saw something on Nova, and Nova more than kind of sucks. Anyway, security would seem to be a big deal.

On the Nova show, they showed two laser beams connecting with the satellite and made it seem like intercepting one beam would make it clear that someone was messing with the connection.

• Wyrd Smythe

I’m not very well-read about the Chinese system, but AIUI, they are using quantum communication or quantum encryption. In both cases, the message cannot be intercepted or copied (usually by “Eve”) without “Alice” and “Bob” (I prefer the gender-neutral “Alex” and “Blair”) detecting it. The latter step also takes steps to insure the data is masked in some way.

I have heard it said the Chinese have developed a land-based system for secure government communication. The satellite, I think, was a demonstration of technological superiority, but I haven’t read much about it since the announcement they were planning it. (Hard to see what practical value a secure satellite link has. The land-based link, though, would be useful.)

Quantum communication isn’t really what’s meant by quantum computing, although they’re definitely related. Both involve quantum properties we don’t observe in classical objects.

Ah, see, I thought the stuff about quantum communication was supposed to be for the sake of computing. Anyway, I definitely don’t understand quantum anything or computing, so never mind me!

• Wyrd Smythe

Well, you’re certainly not alone in that. One thing Ball talks about in Beyond Weird is that language just doesn’t have the ability to address quantum reality because language is based on our classical experience. We simply have no way to talk about these things clearly. (Other than with math, but we want to know what the math means, and so far no one does.)

(I think it all revolves around three quantum things: superposition, entanglement, and interference. I think those are the keys that eventually will unlock the door.)

• Wyrd Smythe

Just a convenient place for some notes for a future post (about Bell’s Inequality):

Imagine Alex and Blair each receive a magical gift box. If they open it from the top, they get a glove. If they open it from the end, they get a shoe. If they open it from the side, they get a mitten. They only get one of the items (after which the box is empty).

Note that gloves, shoes, and mittens come in left (L) and right (R). It is entirely random whether Alex and Blair get a left or right item, but if both open the box the same way, they get matching paired items. For example, if both open their boxes from the top, both get gloves, and one gets the left glove while the other always gets the right glove. But it’s random which gets which.

However, if one opens the top (glove) and the other opens the end (shoe), then the results are entirely random. For instance, it’s possible Alex gets a L-glove while Blair gets a L-shoe.

Put another way, when both open their boxes the same way, the results are correlated. When they open their boxes a different way, there is no correlation.

Between gloves and shoes. Mittens are a slightly different story.

If the box is opened from the side, the item is a mitten, and mittens are correlated with gloves by 90%. They are likewise correlated with shoes by 10%.

If both Alex and Blair open the side, both get a mitten, one will get a left, the other a right, and who gets which is random, but will always be a L-R pair.

If Alex opens the side (mitten), and Blair opens the top (glove), the 90% correlation means there is a 90% chance the mitten and glove will be a L-R pair (again, who gets which is random).

Conversely, if Alex opens the side (mitten), and Blair opens the end (show), it is only 10% likely that there will be a L-R pair.

Classically, if someone buys a pair of gloves and sends one to Alex and one to Blair, the moment either opens their box they know immediately what glove has to be in the other box. But classically, there’s no way to do the glove-shoe-mitten trick. There’s no way to send a single item that depends on how the person opens the box.

The quantum world does allow this because the box contents can be in superposition — some combined state that could be “observed” as either a glove, or a shoe, or a mitten, depending on how you look at it. And, once having looked, that choice is fixed.

There are “hidden variable” theories that provide a way to do the glove-shoe-mitten trick classically (and some interpretations of QM seek to do something similar), but observationally the quantum result has proved itself each time. What we see depends on how we look.

• Wyrd Smythe

Another note: I like the notion that QM is an unsolved mystery. “Unsolved” implies it can be solved. (That’s pretty much Ball’s premise. Assuming realism, something is happening, so let’s figure out what.)

Another notion I like is that QC is a return to analog computing. Qubits can have myriad values — they only become classical bits when measured. A quantum computer is a physical system, which is why their biggest use is likely to be solving physical problems such as simulations and optimization. (For instance, the idea mentioned above of using a single qubit to sum a bunch of small angles can be done classically with a physical pointer.)

• Wyrd Smythe

This post has been getting views lately. Under 40 in its first two years, but almost 60 so far this year. Funny how one never knows what posts will catch interest. Many I really cared about writing are ignored, but some I’ve kinda dashed off turn out to be popular.

Ironic.