Workshop 08 - Introduction to Quantum Artificial Neural Networks

  Home 

Hybrid quantum-classical neural networks

Hybrid quantum-classical neural networks => implementing hidden layers with parameterized quantum circuits (circuits which rotation angles, for each gate, are specified by the components of a classical input vector).

One could calculate the gradient as the difference between the circuit evaluated at θ + s and θ - s, where θ represents the circuit parameters, and s is a macroscopic shift. Thus, the circuit could be trained using gradient descent methods, such as backpropagation.


Artificial Neural Networks - Short Review

Artificial Neural Networks - Workshop

Quantum Computing - Short Review

Quantum Computing - Workshop

IBM Quantum Platform
Quantum Gates exercises with emphasis on Bloch Sphere and the parametrized rotation gates: Rx, Ry, and Rz.
Considering one qubit:

Ψ = α|0> + eβ|1>, |α|2 + |β|2 = 1

One could obtain any value for α, respectively β, by employing the Ry gate.

For controling the relative phase angle φ, use the Rz gate.

Single qubit neural quantum circuit for solving Exclusive Or (XOR)

A particular parametrized quantum circuit with two rotation gates was considered.

RZ(θ1 * x1 + α), and RX(θ2 * x2 + α), where (x1, x2) is the input vector, (θ1, θ2) are the "dendrites" trainable weights, and α is also a trainable parameter.

IBM Quantum Platform

For XOR, one solution could be immediately observed on the Bloch Sphere: θ1 = θ2 = π, for α = -π/2


x1 x2 π * x1 - π/2 π * x2 - π/2 Quantum Simulator 5q ibmqx2 Quantum Computer
0 0 -π/2 -π/2 0.0000 0.0585
0 1 -π/2 π/2 1.0000 0.8805
1 0 π/2 -π/2 1.0000 0.8875
1 1 π/2 π/2 0.0000 0.0585

It is interesting to notice that, within a reasonable error, the circuit could also classify noisy data:

References:

Learn quantum computation using Qiskit
IBM - Learn quantum computing
IBM Quantum Platform
Single qubit neural quantum circuit for solving Exclusive-OR
Introduction to Quantum Computing

  Home