October 18, 2024
Search
Search
Close this search box.

Quantum – Circuits – Introduction

This post describes is an introduction to quantum circuits in Wave Numbers. It describes the representation of multipart qubits as tensor products. It also shows how multipart qubits are used in multipart addition and Haadamard gates.

Definition

According to Qiskit, ‘A quantum circuit is a computational routine consisting of coherent quantum operations on quantum data, such as qubits. It is an ordered sequence of quantum gates, measurements and resets, which may be conditioned on real-time classical computation. A set of quantum gates is said to be universal if any unitary transformation of the quantum data can be efficiently approximated arbitrarily well as as sequence of gates in the set. Any quantum program can be represented by a sequence of quantum circuits and classical near-time computation.’

The gates discussed in these posts can run on quantum computers. Some other gates are more difficult to run due to error rates.

Multipart Qubit Representation

A circuit can have many qubits. The number of states of a circuit possible is 2n where n = number of qubits. This is because each qubit can be either 0 or 1. Multipart qubits represent qubits in a circuit. It is both possible to describe the multipart qubit in a Dirac state format and in a matrix format. For example: |j^j^> represents a multipart qubit in state format made up of two |j^> qubits. So, using Tensor products, the same multipart qubit can be described using  a matrix. For example:

|j^j^> = |j^> \otimes |j^> = \begin {bmatrix} 1^h \\ 0 \end{bmatrix}\otimes \begin {bmatrix} 1^h \\ 0 \end{bmatrix} = \begin {bmatrix} 1^h \\ 0 \\ 0 \\ 0 \end{bmatrix}   

The multipart qubit only represents the product of the qubits. The tensor product represents the relationship between the individual qubits, especially important when entangled. To get the tensor product of a one column matrix with another, multiply the first element of the first column with each of the elements of the second. Each result is stacked in the resulting column. Next, repeat this process for each element of the first column. There are 2 elements in the first column and 4 in the second of the following example. As a result there are 8 elements in the result column.

\begin {bmatrix} 1^h \\ 0 \end{bmatrix}\otimes \begin {bmatrix} 1^h \\ 0 \\0 \\ 1^h \end{bmatrix} = \begin {bmatrix} 1^h \\ 0 \\ 0 \\ 1^h \\ 0 \\ 0 \\ 0 \\ 0 \end{bmatrix}

Two Qubit Multipart Examples

  • |j^j^> = |j^> \otimes |j^> = \begin {bmatrix} 1^h \\ 0 \end{bmatrix}\otimes \begin {bmatrix} 1^h \\ 0 \end{bmatrix} = \begin {bmatrix} 1^h \\ 0 \\ 0 \\ 0 \end{bmatrix}   

  • |j^-j^> = |j^> \otimes |j^> = |j^j^> = \begin {bmatrix} 1^h \\ 0 \end{bmatrix}\otimes \begin {bmatrix} 1^v \\ 0 \end{bmatrix} = \begin {bmatrix} 1^v\\ 0 \\ 0 \\ 0 \end{bmatrix} = -\begin {bmatrix} 1^h\\ 0 \\ 0 \\ 0 \end{bmatrix} 

  • |j^jv> = |j^> \otimes |jv> = \begin {bmatrix} 1^h \\ 0 \end{bmatrix}\otimes \begin {bmatrix} 0 \\ 1^h \end{bmatrix} = \begin {bmatrix} 0\\ 1^h  \\ 0 \\ 0 \end{bmatrix} 

  •  |j^jv> = |j^> \otimes |jv> = \begin {bmatrix} 1^v \\ 0 \end{bmatrix}\otimes \begin {bmatrix} 0 \\ 1^h \end{bmatrix} = \begin {bmatrix} 0\\ 1^v \\ 0 \\ 0 \end{bmatrix}

  • |j^-jv> = |j^> \otimes |jv> = \begin {bmatrix} 1^v \\ 0 \end{bmatrix}\otimes \begin {bmatrix} 0 \\ 1^v \end{bmatrix} = \begin {bmatrix} 0\\ 1^h \\ 0 \\ 0 \end{bmatrix}

  • |jvj^> = |jv> \otimes |j^> =\begin {bmatrix} 0 \\ 1^h \end{bmatrix}\otimes \begin {bmatrix} 1^h \\ 0\end{bmatrix} = \begin {bmatrix} 0\\ 0 \\ 1^h \\ 0 \end{bmatrix}

  • |jv-j^> = |jv> \otimes |j^> = \begin {bmatrix} 0 \\ 1^v \end{bmatrix}\otimes \begin {bmatrix} 1^v \\ 0\end{bmatrix} = \begin {bmatrix} 0\\ 0 \\ 1^h \\ 0 \end{bmatrix}

  •  |jvjv> = |jv> \otimes |jv> = \begin {bmatrix} 0 \\ 1^h \end{bmatrix}\otimes \begin {bmatrix} 0  \\ 1^h\end{bmatrix} = \begin {bmatrix} 0\\ 0  \\ 0\\ 1^h  \end{bmatrix}

  • |jv-jv>= |jv> \otimes |jv> = \begin {bmatrix} 0 \\ 1^v \end{bmatrix}\otimes \begin {bmatrix} 0 \\ 1^v\end{bmatrix} = \begin {bmatrix} 0\\ 0 \\ 0\\ 1^h \end{bmatrix}

Three Qubit Multipart Examples

  • |j^j^j^> = |j^> \otimes |j^j^> = \begin {bmatrix} 1^h \\ 0 \end{bmatrix}\otimes \begin {bmatrix} 1^h \\ 0 \\ 0 \\ 0 \end{bmatrix} = \begin {bmatrix} 1^h \\ 0 \\ 0 \\ 0  \\0 \\ 0 \\ 0 \\0 \end{bmatrix} 

  • |j^jvj^> = |j^> \otimes |jvj^> = \begin {bmatrix} 1^h \\ 0 \end{bmatrix}\otimes \begin {bmatrix} 0\\ 0 \\ 1^h \\ 0 \end{bmatrix} = \begin {bmatrix} 0\\ 0 \\ 1^h \\ 0 \\0 \\ 0 \\ 0 \\0 \end{bmatrix} 

Multipart Addition

Addition is the only mathematical operation available for multipart qubits in a Dirac state format. Should two parts of the multipart qubit have the exact same qubits, they will cancel each other out if one multipart qubit has a flip sign and the other does not. For example: |j^jv> + |j^jv> = 0.

Even number of flips inside multipart state cancel out. For example: |j^jv-jv> = |j^jvjv>.  Move an odd number of flips outside bracket. For example: |j^jv-jv-j^> = |j^jvjvj^>. Note that you cannot flip |j^> to |jv>. This is because these are states that have the matrix representation of  \begin {bmatrix} 1^h \\ 0 \end{bmatrix} and \begin {bmatrix} 0 \\ 1^h \end{bmatrix}.

Two Qubit Multipart Examples

  • |j^j^> + |j^j^>= |j^j^> = \begin {bmatrix} 1^h \\ 0 \\ 0 \\ 0 \end{bmatrix} +  \begin {bmatrix} 1^h \\ 0 \\ 0 \\ 0\end{bmatrix} =   \begin {bmatrix} 2^h \\ 0 \\ 0 \\ 0 \end{bmatrix}  = \begin {bmatrix} 1^h\\ 0  \\ 0\\ 0  \end{bmatrix} after normalisaiton = |j^j^>

  • |j^j^> + |j^j^>= |j^j^> + |j^j^> = 0 = \begin {bmatrix} 1^h \\ 0 \\ 0 \\ 0 \end{bmatrix} +  \begin {bmatrix} 1^v \\ 0 \\ 0 \\ 0\end{bmatrix} =   \begin {bmatrix} 0\\ 0  \\ 0\\ 0  \end{bmatrix} = 0

  • |jvj^> +|j^jv>= \begin {bmatrix} 0 \\ 0 \\ 1^h \\ 0 \end{bmatrix} +  \begin {bmatrix} 0 \\ 1^h \\ 0 \\ 0\end{bmatrix} =   \begin {bmatrix} 0\\ 1^h \\ 1^h \\ 0 \end{bmatrix} = |jvj^> +|j^jv>

  • |j^j^> + |j^j^>= 0 = \begin {bmatrix} 1^h \\ 0 \\ 0 \\ 0 \end{bmatrix} + ^- \begin {bmatrix} 1^h \\ 0 \\ 0 \\ 0\end{bmatrix} =   \begin {bmatrix} 1^h \\ 0 \\ 0 \\ 0 \end{bmatrix} +  \begin {bmatrix} 1^v \\ 0 \\ 0 \\ 0\end{bmatrix} = \begin {bmatrix} 0\\ 0  \\ 0\\ 0  \end{bmatrix} =  0

Three Qubit Multipart Examples

  • |j^j^j^> + |j^j^j^>= |j^j^j^> = \begin {bmatrix} 1^h \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{bmatrix} +  \begin {bmatrix} 1^h \\ 0 \\ 0 \\ 0 \\0 \\ 0 \\ 0 \\ 0 \end{bmatrix} =   \begin {bmatrix} 2^h \\ 0 \\ 0 \\ 0 \\0 \\ 0 \\ 0 \\ 0  \end{bmatrix}  = \begin {bmatrix} 1^h\\ 0  \\ 0\\ 0 \\0 \\0 \\0 \\0   \end{bmatrix} after normalisaiton = |j^j^j^>

  • |j^j^j^> + |j^jvj^> = \begin {bmatrix} 1^h \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{bmatrix} + \begin {bmatrix} 0 \\ 0 \\ 1^h \\ 0 \\0 \\ 0 \\ 0 \\ 0 \end{bmatrix} = \begin {bmatrix} 1^h \\ 0 \\ 1^h \\ 0 \\0 \\ 0 \\ 0 \\ 0 \end{bmatrix} = |j^j^j^> + |j^jvj^>   

Multipart Haadamard

The multipart Haadamard gate can split a multipart qubit into two. For example:

  • AH2|j^j^> => 1/√2 (|j^j^> + |jvj^>)
  • AH2|jvj^> => 1/√2 (|j^j^> + |jvj^>)

See post on AH2 for details and examples of the multipart Haadamard.

Next: CNOT

Previous: Haadamard Gate

Share to:

Leave a Reply

Your email address will not be published. Required fields are marked *