Reader small image

You're reading from  Dancing with Qubits - Second Edition

Product typeBook
Published inMar 2024
PublisherPackt
ISBN-139781837636754
Edition2nd Edition
Right arrow
Author (1)
Robert S. Sutor
Robert S. Sutor
author image
Robert S. Sutor

Robert S. Sutor has been a technical leader and executive in the IT industry for over 40 years. More than two decades of that were spent in IBM Research in Yorktown Heights, New York USA. During his time there, he worked on and led efforts in symbolic mathematical computation, mathematical programming languages, optimization, AI, blockchain, and quantum computing. He is the author of Dancing with Qubits: How quantum computing works and how it can change the world and Dancing with Python: Learn Python software development from scratch and get started with quantum computing, also with Packt. He is the published co-author of several research papers and the book Axiom: The Scientific Computation System with the late Richard D. Jenks. Sutor was an IBM executive on the software side of the business in areas including Java web application servers, emerging industry standards, software on Linux, mobile, and open source. He was the Vice President of Corporate Development and, later, Chief Quantum Advocate, at Infleqtion, a quantum computing and quantum sensing company based in Boulder, Colorado USA. He is currently an Adjunct Professor in the Department of Computer Science and Engineering at the University at Buffalo, New York, USA. He is a theoretical mathematician by training, has a Ph.D. from Princeton University, and an undergraduate degree from Harvard College. He started coding when he was 15 and has used most of the programming languages that have come along.
Read more about Robert S. Sutor

Right arrow

Two Qubits, Three

Not only is the Universe stranger than we think, it is stranger than we can think.

Werner Heisenberg
107

In the previous chapter, we defined qubits and saw what we could do with just one of them. Things now start to get exponential with every additional qubit added because entanglement allows the size of the working state space to double.

This chapter is about how multiple qubits can behave together and then building a collection of tools to manipulate those qubits. These include the concept of entanglement, a requirement for quantum computing. We also examine important 2-qubit gates such as CNOT and SWAP. This will lead us into Chapter 9, “Wiring Up the Circuits,” and Chapter 10, “From Circuits to Algorithms,” where we look at algorithms and build circuits that use this machinery.

I explain the uncertain fate of Schrödinger’s cat before we conclude this chapter. Schrödinger’s$cat

...

Topics covered in this chapter

  1. 8.1. Tensor products
  2. 8.2. Entanglement
    1. 8.2.1. Moving from one to two qubits
    2. 8.2.2. The general case
    3. 8.2.3. The density matrix again
  3. 8.3. Multi-qubit gates
    1. 8.3.1. The quantum H⊗n gate
    2. 8.3.2. The quantum SWAP gate
    3. 8.3.3. The quantum CNOT / CX gate
    4. 8.3.4. Controlling other 1-qubit gates
    5. 8.3.5. The quantum ZZ and Rφzz gates
    6. 8.3.6. The quantum Toffoli CCNOT gate
    7. 8.3.7. The quantum Fredkin CSWAP gate
  4. 8.4. The cat
  5. 8.5. Summary

8.1 Tensor products

In this section, I introduce the linear algebra construction of a tensor product. If the direct sum seems to concatenate two vector spaces, then the tensor product interleaves them. In the first case, if we start with dimensions n and m, we end up with a new vector space of n + m dimensions. For the tensor product, we get nm dimensions. linear$algebra product$tensor product$Kronecker Kronecker$product tensor product vector space$tensor product vector space$Kronecker product

We can quickly get vector spaces with high dimensions through this multiplicative effect. We must use our algebraic intuition and tools more than our geometric ones.

The initial construction is straight linear algebra, but we specialize it later to quantum computing and working with multiple qubits.

Vector spaces

Let V and W be two finite-dimensional vector spaces over F. We define a new vector space VW, pronounced “V tensor W...

8.2 Entanglement

We’ve now seen many gate operations we can apply to a single qubit to change its state. In section 2.5, we worked through how to use classical logic gates to build a circuit for addition. qubit$entanglement

While we can apply not to a single bit, all the other operations require at least two bits for input. In the same way, we need to work with multiple qubits to produce interesting and useful results.

8.2.1 Moving from one to two qubits

We represent the states of a single qubit by vectors of length 1 in C2. We consider any two states equivalent if they differ only by multiplication by a complex unit. This is what we mean when we say that the states are “equal up to a global phase.” phase$global global phase

Each qubit starts by having its own associated copy of C2. When we have a quantum system with two qubits, we do not consider their collective states in a single C2 instance. Instead, we use...

8.3 Multi-qubit gates

A quantum gate operation on one qubit has a 2-by-2 unitary square matrix relative to some basis, as we saw in section 5.9. For two qubits, the matrix is 4-by-4. For ten, it is 210-by-210, which is 1,024-by-1,024. We now look at how to work with common lower-dimensional gates, allowing you to extrapolate to larger ones.

We can tensor any two 1-qubit gates to create a 2-qubit gate. For example,

Displayed math

Let’s examine what we get when we tensor together multiple 1-qubit Hadamard H gates.

8.3.1 The quantum H⊗n gate

We start by looking at what applying a Hadamard H to each qubit in a 2-qubit system means. The H gate has the matrix gate$H`gate-style gate$H⊗n`gate-style gate$Hadamard H`gate-style gate$H⊗1`gate-style

Displayed math

operating on C2. Starting with the two qubit states

Displayed math

applying H to each qubit means to compute

Displayed math

which is the same as...

8.4 The cat

In 1935, physicist Erwin Schrödinger (Figure 8.2) proposed a thought experiment that would spawn close to a century of profound scientific and philosophical thought and many bad jokes. Our explanation of the fate of Schrödinger’s cat uses several qubits and CNOT gates. Schrödinger, Erwin Schrödinger’s$cat

 Figure 8.2: Erwin Schrödinger in 1933

Thought experiments are common among mathematicians and scientists. The basic premise is that the idea is not something you would really do but something you want to think through to understand the implications and consequences.

Schrödinger’s experiment was his attempt to show how the Copenhagen interpretation promoted by Niels Bohr (Figure 8.3) and Werner Heisenberg in the late 1920s could lead to a ridiculous conclusion for large objects. 80 This interpretation is one of the popular ideas for how and why quantum mechanics...

8.5 Summary

This chapter introduced the standard 2-qubit and 3-qubit gate operations to complement the classical forms from section 2.4. The CNOT / X and CZ gates allow us to entangle qubits. Entanglement, along with superposition and interference, is essential in quantum computing.

Our cat-in-the-box was translated into quantum terms and got its own circuit.

Now that we have a collection of gates, it’s time to put them into circuits and implement algorithms. We begin doing that in the next chapter. In section 9.3, we will see how we can create any quantum gate by combining others, at least to a very close approximation. This extends our discussion of logic gate universality in section 2.4.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Dancing with Qubits - Second Edition
Published in: Mar 2024Publisher: PacktISBN-13: 9781837636754
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Robert S. Sutor

Robert S. Sutor has been a technical leader and executive in the IT industry for over 40 years. More than two decades of that were spent in IBM Research in Yorktown Heights, New York USA. During his time there, he worked on and led efforts in symbolic mathematical computation, mathematical programming languages, optimization, AI, blockchain, and quantum computing. He is the author of Dancing with Qubits: How quantum computing works and how it can change the world and Dancing with Python: Learn Python software development from scratch and get started with quantum computing, also with Packt. He is the published co-author of several research papers and the book Axiom: The Scientific Computation System with the late Richard D. Jenks. Sutor was an IBM executive on the software side of the business in areas including Java web application servers, emerging industry standards, software on Linux, mobile, and open source. He was the Vice President of Corporate Development and, later, Chief Quantum Advocate, at Infleqtion, a quantum computing and quantum sensing company based in Boulder, Colorado USA. He is currently an Adjunct Professor in the Department of Computer Science and Engineering at the University at Buffalo, New York, USA. He is a theoretical mathematician by training, has a Ph.D. from Princeton University, and an undergraduate degree from Harvard College. He started coding when he was 15 and has used most of the programming languages that have come along.
Read more about Robert S. Sutor