© Bhagvan Kommadi 2020
B. KommadiQuantum Computing Solutionshttps://doi.org/10.1007/978-1-4842-6516-1_3

3. Quantum Subsystems and Properties

Bhagvan Kommadi1  
(1)
Hyderabad, India
 

Introduction

The mathematics of quantum mechanics very accurately describes how our universe works.

—Antony Garrett Lisi

This chapter covers quantum subsystems and their properties. Single and multiple quantum bit systems are discussed in detail. Quantum states, protocols, operations, and transformations are also presented in this chapter.

A quantum computer processes information related to real-life problems and solves them using quantum mechanics. A classical computer uses bits that are either 0 or 1. We have to pick one of those options since it is based on the electric current in a classical computer wire. Quantum units are based on the quantum superposition principle in which 0 and 1 are superposed. This opens up possible states that are infinite and based on the 0 and 1 with weights in a continuous range. In classical computers, decimal system–based values are converted to binary numbers. Similarly, quantum units are defined using the two-dimensional Hilbert space. See Figure 3-1.
../images/490826_1_En_3_Chapter/490826_1_En_3_Fig1_HTML.jpg
Figure 3-1

Classic versus quantum bits

Initial Setup

You need to set up Python 3.5 to run the code samples in this chapter. You can download it from https://www.python.org/downloads/release/python-350/.

Single Qubit System

The quantum bit is the foundation for a quantum computation framework. By using quantum bits (qubits), the quantum computer performs better than a classical computer. A quantum computer stores the information in quantum bits. A quantum bit represents a quantum particle like an electron having a charge as 0 or 1 and as 0 and 1 simultaneously. A Bloch sphere is used to show the position of the quantum bit’s state. The sphere has a radius of one unit. A Hilbert space is used to model the surface of the sphere. A Hilbert space is related to an inner product of vectors in vector space. Length and angle measurements are shown in the inner product. See Figure 3-2.
../images/490826_1_En_3_Chapter/490826_1_En_3_Fig2_HTML.jpg
Figure 3-2

Bloch sphere

Now let’s look at a code sample in Python that demonstrates a single qubit system.

Code Sample

single_qubit_system.py
import numpy as nump
import scipy as scip
import scipy.linalg
Zero_state = nump.array([[1.0], [0.0]])
One_state = nump.array([[0.0], [1.0]])
NormalizeQuantumState = lambda quantum_state: quantum_state / scip.linalg.norm(quantum_state)
Plus_State = NormalizeQuantumState(Zero_state + One_state)
print("normalized quantum state of",Zero_state, "+", One_state,"is", Plus_State)

Command for Execution

pip3 install numpy
pip3 install scipy
python3 single_qubit_system.py

Output

normalized quantum state of [[1.][0.]] + [[0.][1.]] is
[[0.70710678][0.70710678]]

Multiple Qubit System

A multiqubit system can be shown using the Kronecker product. Let’s look at two quantum particles, c and d. Their state can be modeled as shown here:
|ψc>= α0 |0> + βc |1> (Particle C)
|ψdi>= αd|0> + βd |1> (Particle D)
A multiple quantum bit register has the quantum system in which the quantum bits are in superposition states. A classical register with s quantum bits has 2s unique states. The quantum system will consist of 2p states in superposition. The system can be in one, two, three, … all of the 2s states. Let’s look at a quantum system with 2 qubits and their possible states (see Figure 3-3).
../images/490826_1_En_3_Chapter/490826_1_En_3_Fig3_HTML.jpg
Figure 3-3

Two qubit system

Now, let’s look at a 3 qubit system and the possible states (see Figure 3-4).
../images/490826_1_En_3_Chapter/490826_1_En_3_Fig4_HTML.jpg
Figure 3-4

Three qubit system

The quantum states of the quantum bits in a multiple-qubit system will be a vector with complex coefficients. The real logical state is referred to as observable. The state is measured, and the result is observed. A quantum system will have filters, which are used to identify the quantum state. Different functions are modeled based on the different sets of observables.

A 2 qubit system is specified using the following equation:

q(0) + q(1) = 1

Single quantum bit measurements are used to model 2 qubit measurement operations. A quantum register can be measured partially. The unmeasured leftover is transformed using the identity quantum operation.

Quantum States

A quantum bit exists in 0, 1, or a state between 0 and 1 quantum states. This helps a quantum computer to model a huge set of possibilities through the quantum state. S bits are equivalent to 2S multiple states. The state between 0 and 1 is referred to as quantum superposition. Superposition is modeled as a wave function. A wave function can have infinite states mathematically.

A quantum state is the state of the isolated quantum system. It defines the probability distribution of the measured observable quantum bit. Quantum states are classified as follows:
  • Pure

  • Mixed

Two quantum states can be mixed with one another to create another quantum state. This is similar to the mixing of matter waves in physics.

A Bloch sphere is used to present the quantum states (see Figure 3-5). A quantum bit can be in a superposition state, as shown here:
amp1|0> + amp2|1> = |amp>  where |0> and |1> are column vectors
../images/490826_1_En_3_Chapter/490826_1_En_3_Fig5_HTML.jpg
Figure 3-5

Bloch sphere

amp1 and amp2 are called probability amplitudes , which are complex numbers.

The norm squares and probabilities are calculated as a result of the measurement of a quantum bit.
|amp1^2| + |amp2^2| = 1
A superposition state can also be represented as shown here (see Figure 3-6):
|ψ⟩  =   1/√2 * (|0> + |1>)
../images/490826_1_En_3_Chapter/490826_1_En_3_Fig6_HTML.jpg
Figure 3-6

Superposition

Figure 3-6 shows the quantum bits in superposition compared to the classical bits’ 0 and 1 states.

A quantum particle’s state is modeled as a quantum bit. Figure 3-7 shows the superposition state of the quantum particle.
../images/490826_1_En_3_Chapter/490826_1_En_3_Fig7_HTML.jpg
Figure 3-7

Superposition state of quantum particle

Now let’s look at a code sample in Python to demonstrate the superposition of the quantum bits and states.

Code Sample

superposition.py
import numpy as nump
zero_quantum_state = nump.array([[1.0], [0.0]])
one_quantum_state = nump.array([[0.0], [1.0]])
quantum_amp1 = 1.0 / 2**0.5
quantum_amp2 = 1.0 / 2**0.5
superposition_quantum_state = quantum_amp1 * zero_quantum_state + quantum_amp2 * one_quantum_state
print("superposition of", zero_quantum_state, " and ", one_quantum_state," is ",superposition_quantum_state)

Command for Execution

pip3 install numpy
python3 superposition.py

Output

superposition of [[1.][0.]]  and  [[0.][1.]]  is  [[0.70710678][0.70710678]]

Quantum Protocols

In this section, we look at entanglement and teleportation, which are based on quantum protocols.

Quantum Entanglement

Quantum entanglement is the interaction of multiple quantum particles with each other. The interaction leads to entanglement, and the quantum particles might separate eventually in the space.

This quantum protocol–based phenomenon was observed in 1935 by Albert Einstein, Boris Podolsky, and Nathen Rosen during a quantum mechanical experiment. They wanted to show the logical impossibility of quantum mechanics.

A change in the quantum state of the entangled system–based particle impacts the other and is detectable. The particles in an entangled system are aware of each other. See Figure 3-8.
../images/490826_1_En_3_Chapter/490826_1_En_3_Fig8_HTML.jpg
Figure 3-8

Entanglement

Quantum Teleportation

Quantum teleportation is the transfer of information from a source to a destination. Classical communication networks and channels are used to transfer information. The teleportation based on quantum protocols happens when there is an entanglement of quantum particles at the source and the destination. The current record is a distance of 1,400 kilometers (about 870 miles). Quantum channels can be created between the source and the destination. The quantum state of the quantum particles is teleported from the source to the destination. See Figure 3-9.
../images/490826_1_En_3_Chapter/490826_1_En_3_Fig9_HTML.jpg
Figure 3-9

Teleportation

Quantum Operations

Quantum operations can be visualized using the Bloch sphere (see Figure 3-10). The quantum state of a quantum bit can be shown using a point on the surface of the sphere. The two dials of the sphere indicate the angular and azimuthal coordinates of the sphere. The sphere’s surface can be modeled using a Hilbert space. As mentioned, a Hilbert space is based on a vector space of an inner product of two vectors. The inner product helps in the measurement of the length and angle.
../images/490826_1_En_3_Chapter/490826_1_En_3_Fig10_HTML.jpg
Figure 3-10

Quantum operations: Bloch sphere

Note

A Bloch sphere is used to represent the quantum operation. The rotation happens around the x-, y-, and z-axes of a unit radius three-dimensional sphere.

Quantum gates are quantum operations using quantum bits. Quantum operations are the building blocks of the quantum circuits. Quantum circuits are the fundamental blocks on which a quantum computer is built.

Let’s start looking at the Hadamard gate first. Hadamard gate is the gate that operates on the base state from |0> to (|0>+|1>)* 1/√2 and |1> to (|0> - |1>)* 1/√2. This gate transformation results in a superposition.

A Hadamard gate is expressed as a matrix, as shown here:
H = 1/√2 (|0> + |1>) <0| + 1/√2 (|0> - |1>) <1|

Now, we look at Swap gates. A Swap gate swaps the quantum state of the gate.

It can be represented as follows in matrix form:
SWAP = |01>
Note

Dirac notation is used for writing equations. Paul Dirac was the first person to come up with a unique notation for representing vectors and tensors. This notation is efficient compared to matrices.

An X gate is a quantum equivalent of a NOT gate. A CNOT gate is a controlled-NOT gate. A CNOT gate negates a bit; the control bit is equal to only 1. A Toffoli gate is a controlled-NOT gate, which is a quantum equivalent of an AND gate. Toffoli negates a bit if both control bits are equal to only 1. A Pauli X gate is a quantum operation that rotates a quantum bit over the x-axis with an angle of 180 degrees. A Pauli Z gate is a quantum operation that rotates a quantum bit over the z-axis with an angle of 180 degrees.

Now let’s look at some CNOT, X, Z, and Measure gate implementations to demonstrate the quantum gates. The implementations of a CNOT gate, X gate, Z gate, normalize operation, and Measure gates in Python are shown next.

Code Sample

Multi_Qubit_System.py
import math
import random
def ApplyCNOTQuantumGate(zerozero,zeroone,onezero,oneone):
    onezero, oneone = oneone, onezero
    return GetQuantumbits(zerozero,zeroone,onezero,oneone)
def ApplyHQuantumGate(zerozero,zeroone,onezero,oneone):
    a = zerozero
    b = zeroone
    c = onezero
    d = oneone
    zerozero = a + c
    zeroone  = b + d
    onezero  = a - c
    oneone   = b - d
    normalize()
    return GetQuantumbits(zerozero,zeroone,onezero,oneone)
def ApplyXQuantumGate(zerozero,zeroone,onezero,oneone):
    a = zerozero
    b = zeroone
    c = onezero
    d = oneone
    zerozero = c
    zeroone  = d
    onezero  = a
    oneone   = b
    return GetQuantumbits(zerozero,zeroone,onezero,oneone)
def ApplyZQuantumGate(zerozero,zeroone,onezero,oneone):
    onezero *= -1
    oneone  *= -1
    return GetQuantumbits(zerozero,zeroone,onezero,oneone)
def ApplyNormalization(zerozero,zeroone,onezero,oneone):
    norm = (abs(zerozero) ** 2 + abs(zeroone) ** 2 +
            abs(onezero) ** 2 + abs(oneone) ** 2) ** 0.5
    zerozero /= norm
    zeroone  /= norm
    onezero  /= norm
    oneone   /= norm
    return GetQuantumbits(zerozero,zeroone,onezero,oneone)
def MeasureQuantumbit(zerozero,zeroone,onezero,oneone):
    zerozeroprob = abs(zerozero) ** 2
    zerooneprob  = abs(zeroone)  ** 2
    onezeroprob  = abs(onezero)  ** 2
    randomchoice = random.random()
    if randomchoice < zerozeroprob:
        zerozero = complex(1)
        zeroone  = complex(0)
        onezero  = complex(0)
        oneone   = complex(0)
        return (0, 0)
    elif randomchoice < zerooneprob:
        zerozero = complex(0)
        zeroone  = complex(1)
        onezero  = complex(0)
        oneone   = complex(0)
        return (0, 1)
    elif randomchoice < onezeroprob:
        zerozero = complex(0)
        zeroone  = complex(0)
        onezero  = complex(1)
        oneone   = complex(0)
        return (1, 0)
    else:
        zerozero = complex(0)
        zeroone  = complex(0)
        onezero  = complex(0)
        oneone   = complex(1)
        return (1, 1)
def GetQuantumbits(zerozero,zeroone,onezero,oneone):
    comp = [zerozero, zeroone, onezero, oneone]
    comp = [i.real if i.real == i else i for i in comp]
    comp = [str(i) for i in comp]
    comp = ["" if i == "1.0" else i for i in comp]
    ls = []
    if abs(zerozero) > 0:
        ls += [comp[0] + " |00>"]
    if abs(zeroone)  > 0:
        ls += [comp[1] + " |01>"]
    if abs(onezero)  > 0:
        ls += [comp[2]  + " |10>"]
    if abs(oneone)   > 0:
        ls += [comp[3]   + " |11>"]
    comp = " + ".join(ls)
    return comp
a_quantum_state = 1
b_quantum_state = 0
c_quantum_state = 0
d_quantum_state = 0
zerozero_quantum_state = complex(a_quantum_state)
zeroone_quantum_state  = complex(b_quantum_state)
onezero_quantum_state  = complex(c_quantum_state)
oneone_quantum_state   = complex(d_quantum_state)
result1 = ApplyCNOTQuantumGate(zerozero_quantum_state,zeroone_quantum_state,onezero_quantum_state,oneone_quantum_state)
print("cnot gate operation - result",result1)
result2 = ApplyXQuantumGate(zerozero_quantum_state,zeroone_quantum_state,onezero_quantum_state,oneone_quantum_state)
print("xgate operation - result",result2)
result3 = ApplyZQuantumGate(zerozero_quantum_state,zeroone_quantum_state,onezero_quantum_state,oneone_quantum_state)
print("zgate operation - result",result3)
result4 = ApplyNormalization(zerozero_quantum_state,zeroone_quantum_state,onezero_quantum_state,oneone_quantum_state)
print("normalize operation - result",result4)
result5 = MeasureQuantumbit(zerozero_quantum_state,zeroone_quantum_state,onezero_quantum_state,oneone_quantum_state)
print("measure gate operation - result",result5)

Command for Execution

python3 Multi_Qubit_System.py

Output

cnot gate operation - result  |00>
xgate operation - result  |10>
zgate operation - result  |00>
normalize operation - result  |00>
measure gate operation - result (0, 0)

Quantum Transformations

Quantum transformations are related to the quantum state transformations using quantum bits. We look at the Kronecker transformation and measure gates in this section.

Kronecker Transformation

A tensor product is used to model a multiquantum bit system. A Kronecker product is a tensor product of vectors and matrices.

A multiquantum state is represented using multiple quantum bits and vectors. The dimensionality of the quantum state increases exponentially with the number of quantum bits in the system.

Note

The tensor product between two quantum states is represented using the symbol ⊗. The multiquantum bit state is shown using Dirac notation as |100>, which is the same as |1> ⊗ |0> ⊗ |0>.

Measure Gate Transformation

Now we look at the Measure gate. A Measure gate transforms the information using quantum operations. Measurement transformation can be represented using the following equation:
amp1|0> + amp2|1> = |amp>

where amp1 and amp2 are amplitudes of the quantum bits.

You need to define the projectors to simulate measurement transformation.
Proj0 = |0> <0|
Proj1 = |1> <1|
The state defined here shows the measure gate transformation:
|ψ> = (1/4) (|00> + |01> + |10> +|11>)

Now let’s look at a code sample in Python to demonstrate a Kronecker transformation in Python.

Code Sample

multi_kronecker.py
import numpy as nump
def multi_quantum_state(*args):
    ret = nump.array([[1.0]])
    for q in args:
        ret = nump.kron(ret, q)
    return ret
zero_quantum_state = nump.array([[1.0], [0.0]])
one_quantum_state = nump.array([[0.0], [1.0]])
three_quantum_states = nump.kron(nump.kron(zero_quantum_state, one_quantum_state), one_quantum_state)
print("three  quantum states -kronecker",three_quantum_states)

Command for Execution

pip3 install numpy
python3 multi_kron.py

Output

three  quantum states -kronecker product
[[0.][0.]
 [0.][1.]
 [0.][0.]
 [0.][0.]]

Summary

In this chapter, we looked at single and multiple quantum bit systems. Quantum bits system phenomena such as entanglement, superposition, and teleportation were discussed in detail. Finally, the quantum states, gates, and transformations were presented.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.121.214