Appendix A. Quantum Information and Computing Primer
Appendix A.1. Introduction
Classical computers are constructed using Boolean logic gates and bits controlled by electronic transistors inside integrated circuits or chips. Quantum computers use logic gates that operate on principles of quantum mechanics. Quantum computers provide new programming possibilities by using quantum gates to handle qubits, in contrast to conventional computers that use classical bits and gates. Quantum bits have the unique characteristic of seeming to exist in a state between the two binary states, unlike normal bits, which are always in one of the two states. While spinning in the air, the coin exhibits two separate states despite seeming to be both heads and tails simultaneously. Conventional programming statements are unable to represent the capability of qubits to exist in a superposition of states while carrying out computing operations.
Since Shannon and the beginning of information theory, the bit has been the basic term in classical information. The states of a bit are either 0 or 1. In accordance with the classical concept of quantum information exists the qubit (short for quantum bit). Like for the classical bit, two states are possible,
and
. This special notation `
’ is called the Dirac notation (or ket) and is the standard notation for states in quantum mechanics. The major difference to the classical bit, which accepts only 0 or 1, is that a qubit also allows states in between
and
, which are called superpositions. Let us denote this by
where
,
. Because these factors are complex numbers, the state of a qubit can be described as a vector in a two-dimensional complex vector space
, also called Hilbert space. The states
and
form the computational basis and are orthonormal to each other.
Since a qubit state is a unit vector, meaning the length is normalized to 1, the following equation must be fulfilled by the scalars
Using this fact, we can rewrite the state of a qubit
where
are real numbers and define a point on a sphere called the Bloch sphere.
Figure A1.
In quantum computing, the Bloch sphere is a possible graphical representation of the state of a quantum bit. Figure courtesy of the author.
Figure A1.
In quantum computing, the Bloch sphere is a possible graphical representation of the state of a quantum bit. Figure courtesy of the author.
Qubits are essential components in quantum programming. The particles are subject to quantum mechanical processes that provide the impression of oscillating between two binary states. Consequently, we may manipulate the qubits to interact with one other in ways that allow us to create decision-making logic circuits that enhance their runtime performance or encrypt data in very secure ways. To excel in designing quantum programs, it is essential to grasp the techniques for manipulating qubits. Classical bits are binary and exist in either the state of 1 or 0. Qubits have two distinct states that correspond to the conventional binary values 0 and 1. Qubits may exist in a superposition state, unlike standard binary bits, where they might be a mix of two states, similar to the analogy of a coin flip. This condition does not have an average value of 0.5. It is an idea of two states coexisting simultaneously.
Appendix A.2. Measuring Qubits
To check the status of a classical bit during program execution on a traditional computer, we display the variable containing the bit. Observing the bit does not alter its state. In quantum computing, it is impossible to examine the quantum state of a qubit directly. The state of a qubit cannot be visually inspected since it is not transparent. To analyze the quantum state, one must randomly extract a qubelet from the cauldron. At that moment, two events occur:
The remaining qubelets in the cauldron disappear because, according to the principles of quantum physics, you cannot choose another qubelet.
The chosen qubit, either a or a , is designated as the state of the qubit, resulting in the collapse of the qubit. The cauldron is adjusted only to contain the chosen qubelet.
Choosing a qubit causes the qubit to collapse to the quantum state , making all other and qubits disappear from the system. When a qubit is selected from the cauldron, the qubit collapses to the idealized quantum state , causing the and other qubits to vanish. Generally, we cannot definitively anticipate which of the two idealized states the quantum state will collapse to; it may collapse to or . Finding a qubit in a given state after collapsing does not provide information about the relative amount of and qubelets in the quantum state before the collapse. Starting over with a qubit in an identical quantum state and collapsing does not ensure that the qubit will collapse to the same classical state as before. In quantum computing, computational tasks are carried out on qubits with uncollapsed quantum states, as explained in the next chapters. We collapse the qubits only after ensuring that they all retain the optimum or desirable states required by your algorithm.
The measurement of qubits needs to be fixed. In the special case when or is 0, the mapping to the classical bit will result in 1 or 0, respectively, as expected. But what happens if the qubit is in another superposition, i.e., ? Depending on the scalars, the qubit will be measured as 1 with a certain probability or as 0 with the complementary probability since the scalars fulfil Eq. A.2, the probability for a qubit to be measured as 0 is , and as one, it is .
Furthermore, in quantum mechanics, the scalars and are also called the amplitudes of the states and , respectively. But there exists a second term describing a qubit, the phase. Consider the state , where is a state vector, and is a real number. We say that the state is equal to , up to the global phase factor .
Another kind of phase is the relative phase. Consider these two states
In the state , the amplitude of is . In state , the amplitude has the same magnitude but a different sign. We define that two amplitudes , for some states differ by a relative phase if there is a real such that . In contrast to the global phase, where both amplitudes of the state are different by the factor , the relative phase differs only in one amplitude by the factor .
Appendix A.3. Unitary Operations
The reason quantum information is fundamentally different from classical information is that the set of allowable operations that can be performed on a quantum state is different than it is for classical information. Similar to the probabilistic setting, operations on quantum states are linear mappings — but rather than being represented by stochastic matrices as in the classical case, operations on quantum state vectors are represented by unitary matrices.
A square matrix
U having complex number entries is unitary if it satisfies the equations
Here,
is the identity matrix, and
is the conjugate transpose of
U, meaning the matrix obtained by transposing
U and taking the complex conjugate of each entry.
If either of the two equalities is true, then the other must also be true. Both equalities are equivalent to
being the inverse of
U:
The condition that U is unitary is equivalent to the condition that multiplication by U does not change the Euclidean norm of any vector. That is, an matrix U is unitary if and only if for every n-dimensional column vector with complex number entries. Thus, because the set of all quantum state vectors is the same as the set of vectors having Euclidean norm equal to 1, multiplying a unitary matrix to a quantum state vector results in another quantum state vector.
Indeed, unitary matrices are exactly the set of linear mappings that transform quantum state vectors into other quantum state vectors. Notice here a resemblance to the classical probabilistic case, where operations are associated with stochastic matrices, which are the ones that always transform probability vectors into probability vectors.
The following list describes some important unitary operations on qubits.
Appendix A.4. Pauli Operations
The four Pauli matrices are as follows:
A common notation, which we will often use, is
,
, and
, but we need to keep in mind that the letters
X,
Y, and
Z are also commonly used for other purposes. The
X operation is also called a bit flip or a NOT operation because it induces this action on bits:
The
Z operation is also called a phase flip because it has this action:
Appendix A.5. Hadamard Operation
This matrix describes the Hadamard operation:
Appendix A.5.1. Phase Operations
A phase operation is one described by the matrix
for any choice of a real number
. The operations
are particularly important examples. Other examples include
and
.
All of the matrices just defined are unitary and, therefore, represent quantum operations on a single qubit.
For example, here is a calculation that verifies that
H is unitary:
Here’s the action of the Hadamard operation on a few commonly encountered qubit state vectors:
It’s well worth listing these four equations more succinctly:
Here’s one final example of a state vector that was mentioned previously:
It’s worth pausing to consider the fact that and . Consider a situation in which a qubit is prepared in one of the two quantum states and , but where it is not known to us which one it is. Measuring either state produces the same output distribution as the other: 0 and 1 both appear with equal probability . So, doing
this provides no information about which of the two states and was originally prepared. However, if we apply a Hadamard operation and then measure, we obtain the outcome 0 with certainty if the original state was and we obtain the outcome 1, again with certainty, if the original state was .
Thus, the quantum states and can be discriminated perfectly. This reveals that sign changes, or more generally changes to the phases (which are also traditionally called arguments) of the complex number entries of a quantum state vector, can significantly change that state.
Here’s another example, this time of the action of a
T operation on a plus state:
Notice here that we did not bother to convert to the equivalent matrix/vector forms and instead used the linearity of matrix multiplication together with the formulas
Along similar lines, we may compute the result of applying a Hadamard operation to the quantum state vector just obtained:
The two approaches — one where we explicitly convert to matrix representations and the other where we use linearity and plug in the actions of an operation on standard basis states — are equivalent. We can use whichever one is more convenient in the case at hand.
Appendix A.6. Entangled States
Not all quantum state vectors of multiple systems are product states. For example, the quantum state vector
of two qubits is not a product state. This is because if it were so, there would exist quantum state vectors
and
for which
But then it would necessarily be the case that.
implying that
or
(or both). That contradicts the fact that
and
are both nonzero.
Notice that the specific value
is not important to this argument — what is important is that this value is nonzero. Thus, for instance, the quantum state
is also not a product state, by the same argument.
In contrast, the quantum state vector
is an example of a product state:
Hence, this state is not entangled.
Appendix A.7. Bell States
Bell States are important examples of multiple-qubit quantum states. These are the following four two-qubit states:
Bell states is a product state, i.e., all four of the Bell states represent entanglement between two qubits.
The collection of all four Bell states
is known as the Bell basis; any quantum state vector of two qubits, or indeed any complex vector at all having entries corresponding to the four classical states of two bits, can be expressed as a linear combination of the four Bell states. For example,
Appendix A.7.1. GHZ and W States
These are important examples of states of three qubits.
The first state that represents a quantum of three qubits
is the GHZ state.
The second stage is the so-called W state:
Neither of these states is a product state, meaning that they cannot be written as a tensor product of three-qubit quantum state vectors.
Appendix A.8. Application of Entanglement
It is one of the four Bell states and is often viewed as the archetypal example of an entangled quantum state.
We also encountered this example of a probabilistic state of two bits:
It is, in some sense, analogous to the entangled quantum state . It represents a probabilistic state in which two bits are correlated but it is not entangled. Entanglement is a uniquely quantum phenomenon, essentially by definition: in simplified terms, entanglement refers to any non-classical quantum correlation.
Unfortunately, defining entanglement as non-classical quantum correlation is unsatisfying at an intuitive level because it’s a definition of entanglement in terms of what it is not. It’s actually rather challenging to explain precisely what entanglement is and what makes it special in intuitive terms.
Typical explanations of entanglement often need to distinguish the two states, A.51 and A.52, in a meaningful way. For example, it is sometimes said that if one of two entangled qubits is measured, then the state of the other qubit is somehow instantaneously affected, or that the state of the two qubits together cannot be described separately, or that the two qubits somehow maintain a memory of each other. The two bits represented by this state are intimately connected: each one has a perfect memory of the other in a literal sense. But it is nevertheless not entangled.
One way to explain what makes entanglement special and what makes the quantum state A.51 very different from the probabilistic state A.52 is to explain what can be done with entanglement or what we can see happening because of entanglement that goes beyond the decisions we make about how to represent our knowledge of states using vectors. All three of the examples to be discussed in this lesson have this nature in that they illustrate things that can be done with state A.51 that cannot be done with any classically correlated state, including state A.52.
Indeed, it is typical in the study of quantum information and computation that entanglement is viewed as a resource through which different tasks can be accomplished. When this is done, state A.51 is viewed as representing one unit of entanglement, which we refer to as an e-bit. (The "e" stands for "entangled" or "entanglement." While it is true that state A.51 is a state of two qubits, the quantity of entanglement that it represents is one e-bit.)
Incidentally, we can also view the probabilistic state A.52 as a resource, which is one bit of shared randomness. It can be very useful in cryptography, for instance, to share a random bit with somebody (presuming that nobody else knows what the bit is) so that it can be used as a private key (or part of a private key) for the sake of encryption. But in this lesson, the focus is on entanglement and a few things we can do with it.
As a point of clarification regarding terminology, when we say that Alice and Bob share an e-bit, what we mean is that Alice has a qubit named A, Bob has a qubit named B, and together, the pair is in the quantum state A.51. Different names could, of course, be chosen for the qubits. Still, throughout this lesson, we will stick with these names in the interest of clarity.
Appendix A.9. Teleportation
Quantum teleportation, or just teleportation for short, is a protocol where a sender (Alice) transmits a qubit to a receiver (Bob) by making use of a shared entangled quantum state (one e-bit, to be specific) along with two bits of classical communication. The name teleportation is meant to suggest the concept in science fiction, where matter is transported from one location to another by a futuristic process. Still, it must be understood that matter is not teleported in quantum teleportation — what is actually teleported is quantum information.
The setup for teleportation is as follows.
We assume that Alice and Bob share an e-bit: Alice holds a qubit A, Bob holds a qubit B, and together the pair is in the state . It could be, for instance, that Alice and Bob were in the same location in the past; they prepared the qubits A and B in the state , and then each went their way with their qubit in hand. It could also be that a different process, such as one involving a third party or a complex distributed process, was used to establish this shared e-bit. These details are not part of the teleportation protocol itself.
Alice then comes into possession of a third qubit Q that she wishes to transmit to Bob. The state of the qubit Q is considered to be unknown to Alice and Bob, and no assumptions are made about it. For example, the qubit Q might be entangled with one or more other systems that neither Alice nor Bob can access. To say that Alice wishes to transmit the qubit Q to Bob means that Alice would like Bob to be holding a qubit that is in the same state that Q was in at the start of the protocol, having whatever correlations that Q had with other systems as if Alice had physically handed Q to Bob.
We can, of course, imagine that Alice physically sends the qubit Q to Bob, and presuming that Q reaches Bob without being altered or disturbed in transit, Alice and Bob’s task will be accomplished. In the context of teleportation, however, we assume that Alice can’t physically send Q to Bob. She may, however, send classical information to Bob.
These are reasonable assumptions in a variety of settings. For example, if Alice does not know Bob’s exact location or the distance between them is large, physically sending a qubit using today’s or the foreseeable future’s technology would be challenging, to say the least. However, as we know from everyday experiences, classical information transmission under these circumstances is quite straightforward.
At this point, one might ask whether Alice and Bob can accomplish their task without even needing to make use of a shared e-bit. In other words, is there any way to transmit a qubit using classical communication alone? The answer is no, it is not possible to transmit quantum information using classical communication alone. This is not too difficult to prove using basic quantum information theory covered in the third unit of this series — but for now, an intuitive way to rule out the possibility of transmitting qubits using classical communication alone is to think about the no-cloning theorem.
Imagine that there was a way to send quantum information using classical communication alone. Classical information can easily be copied and broadcast, which means that any classical transmission from Alice to Bob could also be received by a second receiver (Charlie, let us say). But if Charlie receives the same classical communication that Bob received, then would he not also be able to obtain a copy of the qubit Q? This would suggest that Q was cloned, which we already know is impossible from the no-cloning theorem. So, we conclude that there is no way to send quantum information using classical communication alone.
However, when the assumption that Alice and Bob share an e-bit is in place, it is possible for Alice and Bob to accomplish their task. This is precisely what the quantum teleportation protocol does.
Appendix A.10. Conclusion
Quantum computing is a revolutionary field that leverages quantum-mechanical phenomena to perform calculations exponentially faster than classical computers. Quantum bits, or qubits, are the fundamental units of quantum information, allowing quantum computers to process vast amounts of data simultaneously. Quantum operations, such as superposition and entanglement, enable qubits to exist in multiple states simultaneously and to be correlated with each other instantaneously over long distances. Quantum algorithms, like Shor’s algorithm and Grover’s algorithm, demonstrate the potential of quantum computers to solve complex problems, such as integer factorization and database searching, significantly faster than classical computers. Despite facing challenges such as decoherence and error correction, the rapid progress in quantum computing research and development indicates a promising future for this transformative technology in revolutionizing computational capabilities across various industries.