Patent Description:
Quantum computers are computing devices that exploit quantum superposition and entanglement to solve certain types of problem faster than a classical computer. The building blocks of a quantum computer are qubits. Qubits are effectively two level systems whose state can be in a superposition of its two states, rather than just in either of the two states as is the case for a classical bit.

Classical machine learning is the field of study where a classical computer or computers learn to perform classes of tasks using the feedback generated from the experiences or data gathered that the machine learning process acquires during computer performance of those tasks.

<CIT> discloses a hybrid computer that generates samples for machine learning. The hybrid computer includes a processor that implements a Boltzmann machine, e.g., a quantum Boltzmann machine, which returns equilibrium samples from eigenstates of a quantum Hamiltonian. Subsets of samples are provided to training and validations modules.

<CIT> discloses methods, systems, and apparatus for training quantum evolutions using sub-logical controls. In one aspect, a method includes the actions of accessing quantum hardware, wherein the quantum hardware includes a quantum system comprising one or more multi-level quantum subsystems; one or more control devices that operate on the one or more multi-level quantum subsystems according to one or more respective control parameters that relate to a parameter of a physical environment in which the multi-level quantum subsystems are located; initializing the quantum system in an initial quantum state, wherein an initial set of control parameters form a parameterization that defines the initial quantum state; obtaining one or more quantum system observables and one or more target quantum states; and iteratively training until an occurrence of a completion event.

"<NPL>) discloses a classifier based on quantum computation theory. Classification is considered as an evolutionary process of a physical system and built by using the basic quantum mechanics equation.

"<NPL>) discloses algorithms that use a sequence of parameterized unitaries that sit on the qubit layout to produce quantum states depending on those parameters. Measurements of the objective function (or Hamiltonian) guide the choice of new parameters with the goal of moving the objective function up (or lowering the energy).

"<NPL>)) discloses a quantum-inspired neuron based on controlled-rotation gates. In the proposed model, the discrete sequence input is represented by the qubits, which, as the control qubits of the controlled-rotation gate after being rotated by the quantum rotation gates, control the target qubit for rotation. The model output is described by the probability amplitude of state |<NUM>〉 in the target qubit. Then a quantum-inspired neural network with sequence input (QNNSI) is designed by employing the quantum-inspired neurons to the hidden layer and the classical neurons to the output layer.

"<NPL>) discloses a quantum circuit for binary classification, in particular for parity classification, and its implementation on a quantum device.

Various embodiments of the invention include methods and systems, which are characterized by what is stated in the independent claims. Various embodiments of the invention are disclosed in the dependent claims.

For a more complete understanding of the methods, apparatuses and systems described herein, reference is now made to the following drawings in which:.

<FIG> shows a schematic overview of the operation of a classification system implemented using a quantum computer.

The classification method is performed using a quantum computing system <NUM> comprising a plurality of qubits <NUM>. The qubits <NUM> can, for example, be (the following is a non-exhaustive list) superconducting qubits (for example, an "Xmon" or a "Gmon" qubit), quantum dots, ionised atoms in ion traps, or spin qubits. The qubits <NUM> can be kept at a sufficiently low temperature to maintain coherence between qubits throughout the execution of quantum algorithms. In embodiments where superconducting qubits are used, the temperature is kept below the superconducting critical temperature. The plurality of qubits <NUM> can, in some embodiments, comprise one or more ancilla qubits (not shown) for storing entangled quantum states.

The quantum computing system <NUM> further comprises one or more parameterised quantum gates <NUM> for implementing one or more parameterised unitary transformations Ul(θl) (herein also referred to as "unitaries") on the plurality of qubits <NUM>. A quantum gate <NUM> comprises a quantum circuit that operates on one or more of the qubits <NUM> to perform a logical operation. A non-exhaustive list of quantum gates <NUM> includes Hadamard gates, C-Not gates, phase shift gates, Toffoli gates and/or controlled-U gates. Each quantum gate <NUM> acts on either an input state <NUM> or the output of the previous quantum gate <NUM> in a sequence. The parameterised quantum gates <NUM> act on the plurality of qubits <NUM> to change the state of the plurality of qubits <NUM>. In the example shown, L quantum gates <NUM> are applied in sequence to an input state <NUM>, each one transforming the state of the plurality of qubits <NUM>.

The system is configured to learn parameters of the quantum gates <NUM> that, when applied to an input state |Ψ, m〉 <NUM> comprising a state to be classified |Ψ〉 <NUM> and readout qubit |m〉 <NUM>, produce an output state <NUM> from which a predicted classification l'(z) <NUM> (also referred to herein as a predicted label function or predictor) of the state to be classified |Ψ〉 <NUM> can be determined. Measurements are performed on the readout qubit <NUM> in the plurality of qubits <NUM> in order to determine the predicted classification <NUM> of the input state <NUM> from the output state <NUM>. In the embodiment shown in <FIG>, only one readout qubit <NUM> is used, resulting in a binary predicted classifier. However, in general embodiments not falling under the scope of the claims, any number of readout qubits <NUM> can be used to implement other types of classifier. The qubits representing the state to be classified <NUM> can be referred to as "data qubits".

The system <NUM> uses supervised learning to learn parameters of the quantum gates <NUM> that can obtain a predicted classification l'(z) <NUM> of an input state <NUM>. Sample states <NUM> with known classifications l(z) (also referred to herein as label functions) are selected from a sample data set S for use in the supervised learning and an input state <NUM> comprising the sample state <NUM> and the readout qubit <NUM> is prepared. Starting from an initial set of parameters for the quantum gates <NUM>, a first selected input state <NUM> has the one or more quantum gates <NUM> applied to it to generate an output state <NUM>. The states of the readout qubit <NUM> of the output state <NUM> is measured to determine a predicted classifier <NUM> for the sample state <NUM>. The predicted classifier <NUM> is compared with the known classification of the sample state <NUM>, for example using a sample loss function, and the comparison is used to update the parameters of the quantum gates <NUM>.

The process is iterated, each time with a further sample state <NUM> with a known classification selected from the training dataset S, until some predetermined threshold condition is met. The resulting parameters for quantum gates <NUM> can be used in quantum computers to implement a classification method on unclassified states. By analogy with classical artificial neural networks, the trained quantum classifier can be described as a "quantum neural network".

In contrast to previous proposals for machine learning on quantum computers, systems and methods described herein do not require the use of specialised quantum versions of classical artificial neural network "perceptrons". Furthermore, methods and systems described herein can be implemented using near-term available quantum computing systems. Systems and methods described herein can accept both classical quantum states as an input and classify them accordingly, in contrast with classical artificial neural networks, which can only take classical states as an input. The ability to classify input quantum states in this manner can be useful in quantum metrology, where entangled quantum states are used to make high resolution measurements.

In the near future gate model quantum computers with good enough fidelity to run circuits with enough depth to perform tasks that cannot be simulated on classical computers are expected to be available. One approach to designing quantum algorithms to run on such devices is to let the architecture of the hardware determine which gate sets to use. The methods described herein, in contrast to prior work, set up a general framework for supervised learning on quantum devices that is particularly suited for implementation on quantum processors available in the near term.

<FIG> shows a flow diagram of a method for training a classifier implemented on a quantum computer, according to embodiments not falling under the scope of the claims.

At operation <NUM>, an initial set of the quantum gate parameters, <MAT>, is provided for use with the quantum gates <NUM>. The initial set of parameters can, for example, be chosen at random or chosen based on some predefined conditions or best guesses.

In some embodiments, the sequence of quantum gates <NUM> comprises L unitary operators chosen from some set of experimentally available unitary operators. The sequence of quantum gates <NUM> implements a unitary operator U( θ ), given by: <MAT>.

Here, θ is a vector of the parameters (θL, θL-<NUM>,. θ<NUM>) and Ul(θl) is the unitary operator implemented by the lth quantum gate.

In general, each of the parameters θl may comprise a plurality of parameters, for example in the form of a vector. In some embodiments, each of the quantum gates is characterised by a single scalar valued parameter. In these embodiments, each quantum gate is parameterised by a single parameter.

In some embodiments, the quantum, gates <NUM> implement unitary operators of the form: <MAT> where Σ is a generalised Pauli operator acting on one or more qubits. In other words, Σ is tensor product of operators from the set {σx, σy, σz} that acts on one or more qubits in the plurality of qubits <NUM>. An operator of this form has a gradient with respect to the parameter θl whose norm is bounded by <NUM>. Thus the gradient of a sample loss function, as described below, with respect to <MAT>, will be bounded, avoiding problems associated with gradients blowing up during the training of classical artificial neural networks.

The quantum gates <NUM> can be implemented in a number of ways, depending on, for example, the type of qubits <NUM> being used by the system. For example, in a superconducting qubit based system, the quantum gates can be implemented using an intermediate electric coupling circuit or a microwave cavity. In trapped spin based quantum computers, examples methods of implementing quantum gates include applying radiofrequency pulses to the qubits and taking advantage of spin-spin interactions to implement multi-qubit gates.

At operation <NUM>, an n-qubit sample state |Ψ〉 <NUM> with a known classification is selected from a training dataset S. The training dataset S comprises a plurality of sample states <NUM> each with a known classification. The selected sample state |Ψ〉 <NUM> is then prepared in an input state <NUM> comprising the selected sample state <NUM> and the readout qubit <NUM> at operation <NUM>. The readout qubit <NUM> can be prepared in a known state. For example, the input state <NUM> can be prepared in the form: <MAT> where m represents the readout qubit <NUM> prepared in a known state.

At operation <NUM>, the sequence of parameterised quantum gates <NUM> is applied to the selected input state <NUM> using the current set of parameters. The sequence of quantum gates <NUM> transforms the plurality of qubits <NUM> from the input state <NUM> to an output state <NUM> by applying unitary transformations.

At operation <NUM>, a readout state of the readout qubit. <NUM> is measured. For example, one or more Pauli operators can be measured on the readout qubit <NUM>. In some embodiments, repeated measurements are taken of the readout qubit <NUM> to determine the readout state. To perform repeated measurements, operations <NUM> to <NUM> are repeated a predetermined number of times. In other words, the method comprises repeatedly preparing the plurality of qubits in the input state <NUM>, applying the parameterised quantum gates <NUM> to the input state <NUM> and measuring the readout state of the readout qubit.

At operation <NUM>, a predicted classifier l'(z) <NUM> is determined from the measurements on the readout qubit. In a binary classifier, the result of a measurement of a Pauli operator on a readout qubit <NUM> can provide the predicted classification <NUM> directly. In other embodiments, the predicted classifier <NUM> can be a function of the readout state of the readout qubit <NUM>.

At operation <NUM>, the predicted classifier <NUM> of the input state <NUM> is compared with the known classifier of the input state <NUM>.

The predicted classifier <NUM> can be compared to the known classifier using a metric. For example, a sample loss function (or loss function) can be used to compare the predicted classifier <NUM> to the known classifier. The sample loss function provides a "cost" for mismatching known and predicted classifications. The sample loss function, can, for example, be a function that has a minimum value when the predicted classifiers <NUM> match the known classifiers. In these examples, the aim of the training method can be to reduce the average sample loss over the training set to below a threshold value. There are many examples of sample loss functions that can be used to compare the known classification with the predicted classification <NUM>. As an example, for a binary classifier l(Ψ) that classifies an input state as either +<NUM> or -<NUM>, and with a single readout qubit initially set to <NUM> in the computational basis, an example sample loss that can be used is given by: <MAT> where Yn+<NUM> is the σy acting on the readout qubit. This sample loss has a minimum of zero, since the predicted label function (given by <MAT> in this example) is bounded to between -<NUM> and <NUM>.

At operation <NUM>, a threshold condition is checked. The threshold condition is a condition for determining when to halt the training process. The threshold condition may comprise one or more of: a limit to the number of iterations of operations <NUM> to <NUM>; a threshold error rate on a verification set of states; and/or one or more convergence criteria for the parameters <MAT>.

At operation <NUM>, if the threshold condition is not met, one or more of the parameters of the quantum gates <NUM> are updated in dependence on the comparison of the predicted classifier <NUM> of the input state <NUM> with the known classifier of the input state <NUM>.

In some embodiments not falling under the scope of the claims, a gradient descent method is used to compare the predicted classifier of the input state <NUM> with the known classifier of the sample state <NUM> and update the parameters. <FIG> shows a flowchart of an example not falling under the scope of the claims of a method for updating the parameters using gradient descent.

At operation <NUM>, a sample loss is estimated. To estimate the sample loss, repeated measurements of the readout qubit <NUM> in the output state <NUM> are made, and the sample loss is calculated from results of the measurements. Copies of the initial state <NUM> are repeatedly prepared and acted on by the quantum gates <NUM> to produce copies of the output state <NUM>, and the readout qubit <NUM> for each copy of the output state <NUM> is measured. To achieve an estimate of the sample loss to within δ of the true sample loss at <NUM>% probability, at least <NUM>/δ<NUM> measurements of the readout state are made.

At operation <NUM>, one of the unitary gate parameters is varied by a small value. The resulting set of parameters <MAT> differs from the original set of parameters <MAT> a small amount in one component. The small amount can, for example, be a predetermined small amount. Alternatively, the small amount can, for example, be selected at random from a range of values.

At operation <NUM>, a new sample loss with the varied parameter is determined. To this end, repeated measurements of the readout qubit <NUM> are made on copies of the output state <MAT>. Copies of the initial state <NUM> are prepared and acted on by the quantum gates <NUM> to generate the copies of the output state <NUM>, as directly copying the output state is forbidden by the "no-cloning theorem", and the readout qubit <NUM> for each copy is measured.

The gradient of the sample loss with respect to the varied component can then be calculated at operation <NUM>. For example, a finite difference method can be used to determine the gradient.

At operation <NUM>, if the gradient of the sample loss has not been calculated with respect to at least one of the parameters, the method returns to operation <NUM> and repeats operations <NUM> to <NUM> varying a different parameter each time. In total, for L parameters, the steps are repeated L times to obtain an estimate of the full gradient, <MAT>, with respect to <MAT>.

At operation <NUM>, the parameters are updated in dependence on the estimated gradient. Given the estimated gradient, <MAT>, the parameters are updated by changing them in the direction of <MAT>. For example, the parameters can be updated using: <MAT> where r < <NUM> is a "learning rate". The learning rate may be a fixed number. In some embodiments, the learning rate varies as the learning progresses.

With reference again to <FIG>, if the threshold condition is not met, once one or more parameters have been updated the method returns to operation <NUM> and selects another training example (i.e. another sample state <NUM> with a known classification) and performs operations <NUM> to <NUM> with the updated quantum gate <NUM> parameters. In embodiments not falling under the scope of the claims where a limit to the number of iterations is used as the threshold condition, an iteration count is increased by one.

If the threshold condition is met, the updated parameters are stored and/or output at operation <NUM>. These "trained" parameters can be used to implement a classification method on a quantum computer, as described in relation to <FIG>.

<FIG> shows a flow diagram of a classification method implemented on a quantum computer. The method can use a classifier trained using the methods described in relation to <FIG>. The classification method can be used as a standalone method to classify an input state. Alternatively, the classification method can be used a subroutine in an algorithm that is at least in part implemented on a quantum computer. The classification method can, in some embodiments, be thought of a single pass through the training method, but without any comparison with a known classification or any updating of the weights of the parameterised quantum gates <NUM>. The method can be implemented on a quantum computing system, such as the quantum computing system <NUM> described in relation to <FIG>.

At operation <NUM> an unclassified input state is received. The unclassified input state comprises a plurality of qubits <NUM>. The plurality of qubits <NUM> comprises n qubits representing a quantum state to be classified <NUM>, and a readout qubit <NUM> in a known state. The quantum state is, in some embodiments not falling under the scope of the claims, received from a routine running on a quantum or classical computer, and/or experimental equipment. Many other examples are possible. The method encompasses preparing the input state <NUM> from a received quantum state to be classified <NUM>.

At operation <NUM>, a plurality of parameterised quantum gates <NUM> is applied to the input state <NUM> to transform the input state <NUM> to an output state <NUM>. In embodiments not falling under the scope of the claims, the parameters of the parameterised quantum gates <NUM> have been trained using any of the methods described in relation to <FIG>.

The quantum gates <NUM> can be implemented in a number of ways, depending on, for example, the type of qubits <NUM> being used by the system. For example, in a superconducting qubit based system, the quantum gates can be implemented using an intermediate electric coupling circuit or a microwave cavity. In trapped spin based quantum computers, known methods of implementing quantum gates include applying radiofrequency pulses to the qubits and taking advantage of spin-spin interactions to implement multi-qubit gates.

In some embodiments not falling under the scope of the claims, the quantum gates <NUM> used during the classification method are of the same type and implement the same unitary operations as the quantum gates <NUM> used in the training method. In other embodiments not falling under the scope of the claims, the quantum gates <NUM> used during the classification method are of a different type, though still implement the same unitary operations as the quantum gates <NUM> used in the training method using the same parameters.

At operation <NUM>, a readout state of the readout qubit <NUM> is measured. For example, one or more Pauli operators can be measured on the readout qubit <NUM>. In some embodiments, the readout state is measured repeatedly to increase the accuracy of the readout state. Repeated measurement of the readout state comprises, for example applying the parameterised quantum gates <NUM> to copies of the input state <NUM> to generate an output state <NUM>; and measuring the readout state of the readout qubit <NUM> in the output state <NUM>.

At operation <NUM>, the quantum state to be classified is classified in dependence on the measured readout state. In some embodiments, the classification is provided directly by the measurements in the readout state. In a binary classifier according to the invention, a readout state of <NUM> or -<NUM> may correspond to the classification. In other embodiments, the classification is provided by a function of the measured readout state.

By way of illustration, several example embodiments and applications will now be described in relation to a binary classification and a single readout qubit.

In some embodiments, the system is configured to learn to classify classical binary states. The input states are taken from a set of binary strings z = z<NUM>z<NUM>. zn, where each zi is a binary bit. The binary bits can, for example, each take one of the values ±<NUM>. Alternatively, the binary bits can each take one of the values <NUM> or <NUM>. For a binary string of length n there are <NUM>n of such strings. The training dataset comprises a sub-set of the possible binary strings, each with a known classification l(z), which in this example is taken to be a binary label. The classification represents a subset majority.

During training, a string z<NUM> is selected from the training dataset. A plurality of qubits <NUM> are prepared in an input state <NUM> to represent the selected string. For example, the input state <NUM> representing the string can be the n+<NUM> qubit state prepared in a computational basis state: <MAT> where m is the readout qubit <NUM> prepared in a known state. For example, the readout qubit <NUM> can be prepared in one of the binary states ±<NUM>.

The aim of the training is to make measurements of a property of the readout qubit in the output state correspond to the binary classifier l(z). For example, the quantum gates can be trained such that a measurement of a Pauli operator on the readout qubit <NUM>, which has possible values ±<NUM>, predicts a classification of the input string z. In the following, σy is used as an example of the Pauli operator, though σx or σz could alternatively be used.

A sequence of parameterised quantum gates <NUM> is then applied to input state <NUM> to generate an output state <NUM> given by <MAT> as described above in relation to <FIG>. In embodiments where σy is used as the measurement operator on the readout qubit of the output state, a sample loss function of the form <MAT> can be used to train the parameters <MAT>.

Before discussing specific examples of applying the method to binary strings, it will be established that the quantum neural network is capable of expressing any two valued label function, although possibly at a high cost in circuit depth. There are <NUM>n, n-bit strings and accordingly there are <NUM>(<NUM>n) possible binary label functions l(z). Given a label function consider the operator whose action is defined on computational basis states as: <MAT> where Xn+<NUM> is a σx operator acting on the readout qubit. Ul acts by rotating the readout qubit by <MAT> times the label of the string z. Correspondingly: <MAT> where here l(z) is interpreted as being an operator diagonal in the computational basis. As l(z) is +<NUM> or -<NUM> for a binary classifier, it can be seen that: <MAT>.

This demonstrates that at least at some abstract level there is a way of representing any label function with a quantum circuit.

Ul can be written as a product of two qubit unitaries (i.e. implemented by a sequence of two qubit quantum gates). For this discussion it is convenient to switch to Boolean variables <MAT> and think of the label function l(z) as (<NUM> - <NUM>B) where B has the values <NUM> or <NUM>. The Reed-Muller representation of a general B function in terms of the bits b<NUM> through bn can then be written as: <MAT>.

The addition is mod2 and the coefficients a are all <NUM> or <NUM>. Note that there are <NUM>n coefficients and since each can have the value ±<NUM>, <NUM>(<NUM>n) Boolean functions are represented. The formula can be exponentially long.

The label dependent unitary Ul can then be written as <MAT>.

Viewed as an operator, diagonal in the computational z basis, we see that each term in the Reed-Muller representation of B commutes with each of the others. Each term in B in Ul is multiplied by Xn+<NUM> and so each term commutes with the others. Each non-vanishing term in the Reed-Muller representation gives rise in Ul to a controlled bit flip on the readout qubit <NUM>. To illustrate this using an example, consider a three bit term involving bits <NUM>, <NUM> and <NUM>. This corresponds to the operator: <MAT> which is the identity unless b<NUM> = b<NUM> = b<NUM> = <NUM>, in which case it is -iXn+<NUM>. Any controlled one qubit unitary acting on qubit n+<NUM> where the control is on the first n bits can be written as a product of n<NUM> two qubit unitaries. Therefore label function expressed in terms of the Reed-Muller formula with RM terms can be written as a product of RM commuting n + <NUM> qubit operators and each of these can be written as n<NUM> two qubit unitaries. This quantum representation result is analogous to the classical representation theorem, which states that any Boolean label function can be represented on a depth three neural network with the inner layer having size <NUM>n. Of course such gigantic matrices cannot be represented on a conventional computer. In this case the method is naturally performed in a Hilbert space of exponential dimension, but an exponential circuit depth may be needed to express certain functions.

Now that a representation of a binary function has been demonstrated, several example embodiments will now be described.

In some embodiments not falling under the scope of the claims, the label function l(z) is a binary label indicating a parity of a subset, <IMG>, of bits in an input binary string of length n. The Reed-Muller formula for a subset parity label is:
<MAT>
where aj= <NUM> if the bj is in the subset and aj = <NUM> if the best bit bj is not in the subset. The addition is mod2. An example unitary that implements the subset parity is then given by:<MAT> where Xn+<NUM> is the Pauli operator σx acting on the readout qubit <NUM>. Here, the addition in the second exponent is automatically mod2 because of the factor of <MAT> and the properties of Xn+<NUM>. The circuit consists of a sequence of (at most) n commuting two qubit gates <NUM>, with the readout qubit being one of the two qubits acted on by each quantum gate <NUM>.

This unitary can be learned using the training method described herein. Starting from the n-parameter unitary: <MAT> with random initial <MAT>, the optimal parameters <MAT> if the bit bj is in the subset and θj = <NUM> if the bit bj is not in the subset can be learned using the methods described in relation to <FIG>. As an example, working from <NUM> to <NUM> bits and starting with a random θj, with stochastic gradient descent the subset parity label function can be learned with far fewer than <NUM>n samples and therefore could successfully predict the label of unseen examples. Introducing a low level of label noise, for example up to <NUM>% label noise, does not impede the learning.

In some embodiments, the label function l(z) is a binary label indicating a subset majority, <IMG>(z), of a subset, <IMG>, of bits in an input binary string of length n. In the z = ±<NUM> representation of the input string, the subset majority is +<NUM> if the majority of bits in the subset are +<NUM>, and -<NUM> otherwise. The subset majority can be written as:
<MAT>
where aj = <NUM> if the bit bj is in the subset and aj = <NUM> if the bit bj is not in the subset. Consider the unitary:
<MAT>
where Xn+<NUM> is the Pauli operator σx acting on the readout qubit <NUM>, Zj is the Pauli operator σz acting on the jth qubit, and β is defined below. Conjugating Yn+<NUM> gives: <MAT> so that
<MAT>.

The maximum magnitude of the term <MAT> is n, so if β is chosen to lie within the range <NUM> < β < π/n, for example <NUM>. <NUM>π/n then, the subset majority will be:
<MAT>.

This means that taking repeated measurements of Yn+<NUM> and rounding the expected value up or down to ±<NUM> can result in a perfect categorical error, even though the individual sample losses are not <NUM> or -<NUM>.

This unitary can be learned using the training method described herein. Starting from the n-parameter unitary <MAT> with random initial <MAT>, the optimal parameters, θj = β if the bit bj is in the subset and θj = <NUM> if the bit bj is not in the subset, can be learned using the methods described in relation to <FIG>.

The embodiments described above provide examples of training and using a binary classifier. In general, binary classifiers can be trained to represent any binary function. The quantum gates <NUM> used can be restricted to one and two-qubit unitary operators.

In some embodiments not falling under the scope of the claims, the method and system can be used to train an image classifier. The training sets S in these embodiments comprise a plurality of images labelled with a known classification. For example, in the embodiments learning how to classify handwritten digits, the training set comprises a plurality of examples of handwritten digits, each with a label corresponding to the digit that the handwritten digit is meant to represent. An example of such a dataset is the MNIST dataset, which comprises <NUM>,<NUM> training samples of <NUM> by <NUM> pixel images representing digits between zero and nine that have been labelled by hand.

The input state for image classification comprises pixel data for the image being classified. For example, in a black and white image, each qubit in the input state can represent whether a pixel in the input image is black or white. In these examples, the input state can comprise n-qubits representing the n pixels of the image, and one or more readout qubits prepared in a known state. In some embodiments, the images being classified comprise one or more components/channels, for example representing colour data, brightness, and/or hue of the image. In these embodiments, each pixel in each channel may be represented by a qubit in the plurality of qubits <NUM>.

For the image classification, single qubit quantum gates <NUM> are taken to be unitatries with Σ being an X, Y, and/or Z operator acting on any one of qubits in the plurality of qubits <NUM>. Two qubit gates are, in general, taken to be XY, YZ, ZX, XX,YY and/or ZZ operators acting between any pair of different qubits in the plurality of qubits <NUM>.

In some embodiments not falling under the scope of the claims, a predefined number of parameterised gates <NUM> are selected at random from this set of possible quantum gates <NUM>. For example, between <NUM> and <NUM> quantum gates can be selected for a binary image classifier. The initial parameters of these quantum gates <NUM> can, in some embodiments, be selected at random.

In some embodiments, the two-qubit quantum gates <NUM> used in the image classification are restricted to be of the ZX or XX types. At least one of the two qubits operated on by the two-qubit quantum gate is a readout qubit <NUM>. Layers of quantum gates <NUM> of the same type may be alternated in the quantum computer. For example, the sequence of quantum gates may comprise alternating three layers ZX quantum gates with three layers of XX quantum gates. Each layer may comprise a plurality of quantum gates. Each layer may comprise two-qubit quantum gates operating between one or more of the readout qubits <NUM> and each of the other qubits in the plurality of qubits <NUM>. In the binary classifier according to the invention, each layer comprises n two-qubit quantum gates, each of which acts between the readout qubit <NUM> and a different one of the n qubits representing the state to be classified.

While embodiments described above have been described in relation to image classification, it should be understood that they can be equally applied to other classification types that receive strings as an input.

In contrast to classical artificial neural networks, the system described herein can accept quantum states (by which it is meant n-qubit states in an arbitrary superposition) as an input. In embodiments not falling under the scope of the claims, the system can be used to train a classifier for quantum states to classify the quantum states according to a label that relates to a property of the quantum states.

Some further embodiments not falling under the scope of the claims will now be described.

The input state <NUM> comprises n qubits representing the state |Ψ〉 to be classified, and a readout qubit <NUM>. In the embodiments described below, the readout qubit is set to a known initial state of |<NUM>〉 in the computational basis, though other initial readout states can be used.

The binary classifier described below corresponds to whether an expected value of a Hamiltonian Ĥ with a state is positive or negative. Such a classifier can be useful when finding minimum energy states of system governed by a particular Hamiltonian. The classifier l(|Ψ〉) can be given, for example, by <MAT>.

Consider the operator <MAT> where β is taken to be a small positive number.

For sufficiently small β, this is approximately <MAT> so the sign of the expected of our predicted label agreeing with the true label. In this sense the label function has been expressed with a quantum circuit with small categorical error. The error arises due to the approximation taken by expanding 〈Ψ| sin(<NUM>βH) |Ψ〉 for small β. However if we take β to be much less than the inverse of the norm of H, the error can be made small.

For example, consider a graph where on each edge we have a ZZ coupling with a coefficient of +<NUM> or -<NUM> randomly chosen <MAT> where the sum is restricted to edges in the graph and Jij is +<NUM> or -<NUM>. Suppose there are M terms in H. We can first pick M angles ij and consider circuits that implement unitaries of the form: <MAT>.

When θij = βJij, this unitary will provide the label function. These weights can be learned using the methods described above in relation to <FIG>.

The quantum states |Ψ〉 live in a <NUM>n dimensional Hilbert space, so in some embodiments the quantum states are restricted to quantum states that can be built by applying few qubit unitaries to some simple product state. In some embodiments not falling under the scope of the claims, the training states are restricted to be of this form.

By way of example, eight data qubits and one readout qubit can be trained to classify three regular graphs, which accordingly have <NUM> edges. In this example, there are twelve parameters θij used to form the sequence of quantum gates <NUM> <MAT>. The training states can be product states that depend on eight random angles. The state can be formed by rotating each of the eight qubits, which each start as an eigenstate of the associated X operator, about the y axis by the associated random angle. Test states are formed in the same manner. Since the states are chosen randomly from a continuum there is a high probability that the training set and test set are distinct. After presenting roughly <NUM> test states the quantum network correctly labels <NUM>% of the test states.

In some embodiments, the class of unitaries can include more parameters. For example, two layers of unitaries where Σ is an XX and ZX, where the first operator acts on one of the eight data qubits and the second operator acts on the readout qubit <NUM>. In the example using three regular graphs as the inputs, the learning procedure can achieve a categorical error of less than <NUM>% after seeing roughly <NUM> training examples. In some embodiments, training a classifier for classical input states can be enhanced using the ability of the quantum system to accept quantum states as an input. For example, with a quantum neural network, input states may comprise classical data in a superposition. A single quantum state that is a superposition of computational basis states, each of which represents a single sample from a batch of samples, can be viewed as quantum encoding of the batch. Here different phases on the components give rise to different quantum states.

For example, consider a binary classification. The sample space can be divided into samples labeled as +<NUM> and those labeled as -<NUM>. Consider the states <MAT> and <MAT> where N+ and N- are normalization factors and ϕz is a phase. In some examples, all the phases are set to zero. Each of these states can be viewed as a batch containing all of the samples with the same label. Return to the equation which gives the unitary associated with any label function. Note that the expected value of this operator of the state |+<NUM>〉 is +<NUM> whereas the expected value of the state |-<NUM>〉 is -<NUM>. This is because the unitary is diagonal in the computational basis of the data qubits so the cross terms vanish and the phases are irrelevant. Now consider a parameter dependent unitary <MAT> which is diagonal in the computational basis of the data qubits. The expected value of Yn+<NUM> of the state obtained by having this operator in the act on |+<NUM>〉 is the average over all samples with the label +<NUM> of the quantum neural network's predicted label values. For the state |-<NUM>〉, the expected value of Yn+<NUM> of the state obtained by having this operator in the act on |-<NUM>〉 is the average over all samples with the label -<NUM> of the quantum neural network's predicted label values. In other words if <MAT> is diagonal in the computational basis of the data qubits then <MAT> is the empirical risk of the whole sample space. If parameters <MAT> can be found that make this <NUM>, then the quantum neural network will correctly predict the label of any input from the training set.

In some embodiments, a gate set that is diagonal in the computational basis of the data qubits is used. An example of such a set is the generalised Pauli operators ZX and ZZX with the Z operators acting on data qubits and the X operator acting on the readout. Using these gates, the empirical risk formula is the empirical risk of the full data set for the quantum neural network. The empirical risk can be used as a sample loss function to train the parameters of the quantum neural network. Starting from a random choice of parameters, a minimisation algorithm, such as gradient descent, can be used to decrease the empirical risk.

In some embodiments not falling under the scope of the claims, the gate set can be beyond those that are diagonal in the data qubit computational basis. In these embodiments, <MAT> can no longer be directly read as the empirical risk of the quantum neural network acting on the whole sample space. However, driving it to a low value at least means that the states |+<NUM>〉 and |-<NUM>〉 are correctly labelled.

<FIG> show examples of the quantum neural network classifier being used in conjunction with a classical artificial neural network. In general, the classification method implemented on a quantum computing system <NUM> as described herein can be combined with one or more classical artificial neural networks <NUM>. This can improve the accuracy of the classification method.

The classical artificial neural networks <NUM> comprise a plurality of layers of "neurons", each of which has connections to one or more neurons in each neighbouring layer. In the example shown, the classical artificial neural networks <NUM> have three layers, though fewer or greater numbers of layers are possible. The examples also show fully connected layers, where each neuron is connected to every neuron in neighbouring layers, though partially connected networks are also possible.

Each neuron accepts one or more inputs, and outputs a function of the inputs that is characterised by one or more weights associated with each input. These weights can be trained using standard machine learning techniques to produce a desired output from the neural network <NUM>.

In some embodiments, a state to be classified <NUM> is input into a classical artificial neural network <NUM>. The output of the classical artificial neural network <NUM> can be used as input to the quantum computing system <NUM> in order to generate the input state <NUM> to be classified according the methods described above. An example of such an embodiment is shown in <FIG>.

In some embodiments, the readout state from the readout qubit <NUM> in the quantum computing system <NUM> is input into a classical artificial neural network <NUM>. The classical artificial neural network can be trained to determine, using the readout state of the output state of the readout qubit in the plurality of qubits, a predicted classification of the input state. An example of such an embodiment is shown in <FIG>.

Implementations of the quantum subject matter and quantum operations described in this specification may be implemented in suitable quantum circuitry or, more generally, quantum computational systems. The term "quantum computational systems" may include, but is not limited to, quantum computers, quantum information processing systems, quantum cryptography systems, or quantum simulators.

The terms quantum information and quantum data refer to information or data that is carried by, held or stored in quantum systems, where the smallest non-trivial system is a qubit, e.g., a system that defines the unit of quantum information. It is understood that quantum memories are devices that can store quantum data for a long time with high fidelity and efficiency, e.g., light-matter interfaces where light is used for transmission and matter for storing and preserving the quantum features of quantum data such as superposition or quantum coherence.

Quantum circuit elements may be used to perform quantum processing operations. That is, the quantum circuit elements may be configured to make use of quantum-mechanical phenomena, such as superposition and entanglement, to perform operations on data in a non-deterministic manner. Certain quantum circuit elements, such as qubits, may be configured to represent and operate on information in more than one state simultaneously. Examples of superconducting quantum circuit elements that may be formed with the processes disclosed herein include circuit elements such as co-planar waveguides, quantum LC oscillators, qubits (e.g., flux qubits or charge qubits), superconducting quantum interference devices (SQUIDs) (e.g., RF-SQUID or DCSQUID), inductors, capacitors, transmission lines, ground planes, among others.

In contrast, classical circuit elements generally process data in a deterministic manner. Classical circuit elements may be configured to collectively carry out instructions of a computer program by performing basic arithmetical, logical, and/or input/output operations on data, in which the data is represented in analogue or digital form. In some implementations, classical circuit elements may be used to transmit data to and/or receive data from the quantum circuit elements through electrical or electromagnetic connections. Examples of classical circuit elements that may be formed with the processes disclosed herein include rapid single flux quantum (RSFQ) devices, reciprocal quantum logic (RQL) devices and ERSFQ devices, which are an energy-efficient version of RSFQ that does not use bias resistors. Other classical circuit elements may be formed with the processes disclosed herein as well.

During operation of a quantum computational system that uses superconducting quantum circuit elements and/or superconducting classical circuit elements, such as the circuit elements described herein, the superconducting circuit elements are cooled down within a cryostat to temperatures that allow a superconductor material to exhibit superconducting properties.

While operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. For example, the actions recited in the claims can be performed in a different order and still achieve desirable results.

Claim 1:
A method for performing binary classification of a quantum state on a quantum computer, the method comprising:
preparing (<NUM>), by a quantum computer, a plurality of qubits of the quantum computer in an input state, said plurality of qubits comprising a plurality of data qubits representing a state to be classified and a readout qubit;
applying (<NUM>), by the quantum computer, a sequence of layers of parameterised quantum gates to the plurality of qubits of the quantum computer to transform the input state to an output state, wherein each layer of parameterised quantum gates comprises a plurality of two-qubit quantum gates, each of the two-qubit quantum gates acting between the readout qubit and a different one of the plurality of data qubits;
measuring (<NUM>), by the quantum computer, a readout state of the readout qubits of the quantum computer to determine a binary classification of the input state, wherein a readout state of <NUM> or -<NUM> of the readout qubit corresponds to a subset majority classification,
wherein the plurality of two-qubit quantum gates implement a unitary transformation of the form: <MAT>
where θj are learned parameters parameterising the quantum gate, Zj is a Pauli Z operator acting on the j-th data qubit and Xn+<NUM> is a Pauli X operator acting on the readout qubit.