Maths for Quantum Computing- A brief Introduction of Quantum Computing (Part 2)

Kaushal Gagan
9 min readJan 2, 2022

--

In the first part, we discussed the Quantum realm’s basic gates and its magical properties.
This article will discuss Part 2(i.e., Mathematical framework for Quantum Computing).

Part - 1
0. A brief Introduction to the Postulates of Quantum Mechanics(QM)
1. Bits and Qubits
2. Properties of Qubit
a. Quantum Superposition
b. Quantum Entanglement
3. Operations on bits
4. Operations on Qubits
a. Single Qubit Gates
b. Multiple Qubit Gates
5. Bloch Sphere and Oracle
Part - 2 (this article)
6. Maths for QC people
a. Tensors
b. Operations on Matrix(norms to tensor product)
c. Matrix as Operators
d. Hilbert space
Part - 3(Releasing on 25 Jan 2022)
7. Algorithms
a. Groover's Search
b. Deutsch-Jozsa Algorithm
c. Shor's Algorithm
d. The Bernstein-Vazirani Algorithm
Part - 4(Releasing on 5 Feb 2022)
8. Feel good topics
a. Superdense Coding
b. Quantum Cryptography
c. many more

6. Maths for QC people

Tensors:

A tensor is a Mathematical object that obeys specific transformation rules.
We often think a scalar, vectors, and Matrix are different, but all three are the child’s same parents(i.e., Tensor). They look different because they have different genetic traits(i.e., Rank of a Tensor).

Rank of Tensor:

The rank (or order) of a tensor is defined as the number of indices required to represent a component of Tensor.

Scalars :

Here we do not need any indices to represent the component(i.e., 7) of a Tensor A. it means that the rank of this Tensor is 0.

Rank-0 Tensors are known as scalars.

Vectors:

Here we do need a single index to represent the component of a Tensor A. it means that the rank of this Tensor is 1.
Rank-1 Tensor is known as Vectors.
We use vectors to represent the state of the qubit in Hilbert space. State 0 and state 1 are represented as shown below.

A general qubit state ψ represented as,

or

Where α and β are directly associated with the probability of getting 0 and 1 respectively after observation. if you have never seen Dirac’s <Bra|Ket> notation used above, then please visit this site

Matrix:

Here we need two indices to represent the component of a Tensor A. it means that the rank of this tensor is 2.

Rank-2 Tensors are known as Matrix.

When the rank of the tensor is greater than or equals 3, then when call them by their general name, i.e., tensor.

To get a more detailed picture, please visit this link.

Operations on Tensors

Operations on Scalars:

  1. Addition: 2+3 =5
  2. Multiplication: 2*3 = 6

Operations on Vectors:

Let’s assume we have two vectors, v1(Green) and v2(Blue), in 2D space.

1. Addition:

2. Multiplication with scalar:

3. Tensor product:

The tensor product is a method of putting vector spaces together to form a large vector space.
We have seen postulate 4 in the previous part of this series which states,

Postulate 4: The state-space of a composite physical system is the tensor product of the state space of the component physical system.

use case of tensor product:

Let’s take a CNOT gate that takes two qubits as input and returns two-qubit output. composite state of input can have 4 values |00>, |01>,|10> ,and |11>.

What I mean by the composite state is that we can use a single column vector to represent two input qubits, for example, suppose control qubit(which passes through the wire with dark spot, i.e., wire 1 of CNOT) is in state |1>. Target qubit(which passes through the wire with this ⊕ symbol i.e.}) is in state |0> then we represent the combined input as |10>.

The symbol ⊗ represents tensor product.

Operations on Matrix:

  1. Addition:

2. Matrix Multiplication:

Matrix multiplication is defined only between mxn and nxp size matrices and the resultant matrix size will be mxp.

Let’s take 3x2 and 2x3 size two matrices A and B,

For multiplication, we follow the method shown in the diagram below.

Note: A matrix does not merely transforms a vector or set of vectors. it transform an entire vector space.  
3Blue1Brown

3. Trace:

Performing Trace operation on a matrix gives summation value of entries of the main diagonal. Denoted by tr(Matrix Name).

Note: The trace remains invariant among matrices that are similar.

4. Determinant:

5. Inverse:

The inverse of a matrix A is a matrix that follows the rule mentioned below,

To better understand this concept, check the video from Grant Sanderson(3Blue1Brown).

6. Transpose of a Matrix:

Transforming rows into columns and vice- versa.

7. Conjugate of a Matrix:

From the last article of this series, we have learned about complex numbers. Conjugate of a complex number is nothing but a change of sign of imaginary part or, in other words, it is a reflection about the real axis.

Similarly, we will take conjugate of all the elements present for a matrix.

Note: Bra represents Conjugate transpose of Ket object.

In <Bra|Ket> Notation,

We will see later that the idea of the conjugate transpose(performing both operations 4 and 5) is essential for defining a class of operators called unitary operators.

Note: Matrix A is Hermitian if conjugate transpose of a matrix A is A itself. 
A measurable quantity, or observable, is a Hermitian operator; thus the measurement in a quantum computer outputs real values from the system.
We use the terms operators and gates interchangeably.

A unitary operator is an operator whose inverse is its conjugate transpose.

This is important because quantum states are represented as vectors, with norm/length 1 living in a Hilbert space.

It turns out that unitary operators have the special property to preserve the norm of the vector. So, the application of a unitary operator to a vector whose norm is 1 remains 1.

Let’s observe the figure given above. We have a vector V with length 1 unit after applying a unitary matrix U on V. Now, the new vector becomes UV with length 1 unit(same), so the unitary matrix rotates the unit sphere only.

Matrix as Operators

In Part 1, we have seen all four postulates of Quantum mechanics. In this section we will focus more on postulate 2.

Postulate-2: 
A unitary transformation(U) describes the evolution of a closed system.
Let at time t1 state of the closed quantum system is represented by ψ1 later system becomes ψ2 at time t2 then ψ1 and ψ2 are related by a Unitary operator U given by the expression below,

In classical computing, we use some gates/operators to perform computation similarly; We use quantum gates to perform some special computation. The operators we use to evolve the state of the qubits are unitary and therefore reversible. Mathematically we represent these gates as unitary matrices as we have seen matrix representation of quantum gates in part 1.

Identity matrices are unitary. Hence the set of unitary matrices form a group, called the unitary group. All the Quantum gates that we have learned in part 1 of this series are the element of the unitary group.

Hilbert space:

Quantum theory is cast in the language of complex vector spaces. A Hilbert space is a complex vector space that is complete and equipped with an inner product.

Note: Every inner product on a finite-dimensional complex vector space is automatically complete; hence, every finite-dimensional complex vector space with an inner product is automatically a Hilbert space.

One of the central concepts of quantum computing is that a qubit can be represented as a two-dimensional complex Hilbert space.

A qubit is represented by a 2D vector space — more specifically, a Hilbert space known as the state space of the qubit.

We refer to a collection of n qubits as a quantum register and often notate it as,

It turns out that the tensor product of Hilbert spaces is another Hilbert space, although it will have a greater dimension in general.

We know for a single qubit, we have 2 orthonormal basis {|0>,|1>}. Above, we have seen the example for 2 qubits composite space H⊗H has 4 orthonormal basis {|00>, |01>,|10> ,|11>} where we discussed the use case of the tensor product. So for n qubits, we will have Hilbert space with 2^n orthonormal basis.

Inner product:

To understand this concept, let’s take two vectors |v1> and |v2>,

Inner product will be represented as,

as we have discussed that <v1| is the conjugate transpose of |v1>. So the value of the inner product for given two vectors will be,

The inner product is also known as the dot product or scalar product.

Outer product:

Outer product for |v1> and |v2> will be represented as,

or,

Outer product is a special case of tensor product it takes two vectors to form a matrix,

Here X is Pauli x gate.

References:

  1. Quantum Computing: An Applied Approach — Jack D. Hidary
  2. Quantum Computing for Computer Scientists — Mannucci and Yanofsky
  3. https://www.mathsisfun.com/physics/bra-ket-notation.html
  4. Complex Numbers and Phasors in Polar or Rectangular Form (electronics-tutorials.ws)

If you are reading this line, I wanted to say you are fantastic! Thanks for your time. stay curious and stay tuned for part-3(Releasing on 15/1/2022).

--

--

Kaushal Gagan

Qiskit Advocate | IIT Goa | Writes about Quantum * , Computer Science, Philosophy, Cryptography ,and More.