^{*}

Edited by: Ashild Fredriksen, UiT The Arctic University of Norway, Norway

Reviewed by: Jan Sladkowski, University of Silesia of Katowice, Poland; Bikas K. Chakrabarti, Saha Institute of Nuclear Physics, India

This article was submitted to Interdisciplinary Physics, a section of the journal Frontiers in Physics

This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.

In May 2016 IBM released access to its 5-qubit quantum computer to the scientific community, its “IBM Quantum Experience” since acquiring over 60,000 users from students, educators and researchers around the globe. In the time since the “IBM Quantum Experience” became available, a flurry of research results on 5-qubit systems has been published derived from the platform hardware.

Quantum computers can perform certain tasks more efficiently than classical computers [

Analyzing and simulating 5-qubit systems in detail can prepare students to exploit the capabilities of, and developing and debugging algorithms for deployment on experimental quantum computing infrastructure as this infrastructure scales to an increasing number of qubits in the coming decades.

Within the universal gate quantum computation paradigm, a variety of existing software toolkits are useful in quantum computation study and research, ranging from the general QuTIP [

This paper focuses on universal gate quantum computation, but it is useful to note the plethora of work in quantum computing focusing on quantum annealing [

In this paper, I describe

In section 2 a brief overview is given of the terminology and mathematics necessary to follow the operation of

Here I give a brief primer on quantum information and computation necessary to describe

A qubit is the quantum generalization of a classical bit. Unlike a classical bit, it can take any value corresponding to a linear superposition of its constituents: formally two orthonormal eigenstates. Our default choice of basis throughout this manuscript is

This multi-purpose notation (〈| or |〉), used throughout this manuscript to represent a quantum state, is called bra-ket or Dirac notation and is standard in quantum mechanics. Without getting into a detailed discussion of the mathematics, one can, simplistically, think of the symbol lying between the |〉 notation as being a label for the state. Whether the notation is |

Thus a generic one-qubit state |ψ〉 is

The coefficients ^{2} = ^{*} where ^{*} is the complex conjugate of ^{2} = ^{*}. These two probabilities normalize to one: |^{2} + |^{2} = 1. A single qubit state |ψ〉 can be physically realized by a variety of mechanisms which correspond to a quantum-mechanical two-state systems, for example a two spin system, or a two level system, among many others. The Bloch sphere is a useful way to visualize the state of a single qubit on a unit sphere. Formally, in the Bloch sphere representation the qubit state is written as

where θ and ϕ are the polar coordinates to describe a vector on the unit sphere.

To make use of the power of quantum computation we will in general want more than one qubit. In a classical

For an ^{n} possible values of which the ^{2} = 4 possible states, {|00〉, |01〉, |10〉, |11〉}. For a 3-qubit state we have 2^{3} = 4 possible states or

Numbering the states from 0 to 2^{n} − 1, the canonical ordering used throughout this manuscript is:

where the number of summations corresponds to the total number of qubits. Thus if we incorporate the amplitudes, the complex coefficients of these states, we can compute the probability of finding

in state |_{ij…m},

If we can represent an

the state is called separable. However, due to the nature of superposition, it may be that a multi-qubit state is non-separable and individual qubits states are not well defined independent of other qubits. This non-local correlation phenomenon known as entanglement is a necessary resource to achieve the exponential speed up of quantum compared to classical computation [

We have outlined the analogy to the classical n-bit register, the n-qubit quantum register for keeping track of quantum data. Here we will do the same with a classical gate and a quantum gate, which evolve classical and quantum states respectively. In classical computation, a classical gate operates on a classical register to evolve its state. In quantum computation, a quantum gate operates on a quantum register to evolve its state. Quantum states can be represented by matrices; the mathematics of the evolution of quantum states can unsurprisingly be represented by matrices as well. To represent quantum gates, these matrices must conform with the postulates of quantum mechanics as they multiply a state to produce an evolved state. Specifically, we know that the evolution of states must conserve probability (preserve norms); we cannot produce a state which is a superposition of states with probability greater than one.

Matrices which ensure the conservation of probability when they multiply states are called ^{†} is also its inverse, that is ^{†}^{†} =

Gates acting on a single qubit can be applied to a quantum register of an arbitrary qubit number. For example, for a gate X if the desired qubit to act on is the 3rd qubit in a 4-qubit quantum register. X is a gate which flips the qubit it acts on from |0〉 to |1〉 or from |1〉 to |0〉. The appropriate gate is formed via _{3of4} = _{mofn} to operate on the

Here,

Specific sets of classical gates, for example the the NOT and AND gates can be used to construct all other classical logic gates and thus forms a set of universal classical gates. Other such sets exist; in fact the NAND,

We'll need to understand how measurement functions in quantum mechanics to understand the constraints of extracting information from a quantum register. Measurement in quantum mechanics is something which engages a lot of discussion, but its properties are straightforward to state in mathematics if not in philosophy. It is possible to perform a measurement of a single qubit with respect to any basis {|

in state |_{ij…m},

Only those states and gates which are useful to interfacing with IBM's 5-qubit quantum computer are supported by

States are available as static member variables of the

Standard (z) basis (

Diagonal (x) basis (

Circular (y) basis (

The

or more concicely by

A variety of single qubit gates are supported, as is the 2-qubit gate CNOT. Later, the

^{†} gate (

^{†} gate (

It can easily be checked that these gates produce the desired behavior. All other combinations of target and control qubits are available within

Several convenience methods are provided to help compute probabilities and expectation values. For a qubit residing in a quantum register representing an arbitrary number of entangled qubits, the method

To represent a possibly non-separable group of distinguishable qubits, one can treat them together in terms of a single quantum register to keep track of their ordering and their entangled state.

The

The

The

The method

The

If one or both of the quantum registers given contain more than one qubit, then their states are likewise combined via a tensor product as necessary (if they don't already reside in the same quantum register). Then the appropriate CNOT matrix formulation for the combined state is applied to the combined state. The state of the relevant quantum register–the new register if one was created, otherwise the existing register which held both qubits–is set to the output of this calculation. Although

The

Internally,

The

Programs for execution on

Currently, the following syntax for use in

available qubit list | |

1-qubit gate list | h,t,tdg,s,sdg,x,y,z,id |

1-qubit gate action | “gate q[i];” |

2-qubit CNOT gate list | cnot |

2-qubit CNOT gate action | “cnot q[control], q[target];” |

measurement operation list | measure, bloch |

measurement operation action | “operation q[i];” |

Here {h,t,tdg,s,sdg,x,y,z,id} correspond to the Python

A program in this syntax it can be executed easily. Program code can be put in a Python string or equivalently read in from a file into a string. The code can be executed with the

In this section a variety of modes of usage of the _{1}〉 = |0〉, |_{2}〉 = |0〉. Then the code applies the _{2}〉 = |1〉. Thus at the initial stage |_{1}_{2}〉 = |01〉. The algorithm then applies a series of CNOT and H gates such that we end up with |_{1}_{2}〉 = |10〉, a swapping of the states of the qubits at the initial stage.

To prepare for execution, we set the

We can then execute and examine the results with:

which will print, as expected:

This same algorithm can be executed in pure python using the machinery of

Equivalently this algorithm can be run using the machinery of the

This manner of working with the module provides the most complete mathematical understanding of the operations that

Several extensions of

The author has successfully used

The author confirms being the sole contributor of this work and approved it for publication.

The author declares that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

This paper was written while on leave from NSF AAPF grant 1501208 to conduct observations in Antarctica with the South Pole Telescope. I would like to thank Dr. Casey Handmer and Dr. Jerry M. Chow respectively for helpful comments during the preparation of this manuscript. I acknowledge use of the IBM Quantum Experience for this work. The views expressed are those of the author and do not reflect the official policy or position of IBM or the IBM Quantum Experience team.

The Supplementary Material for this article can be found online at: