Code Monkey home page Code Monkey logo

perceptron-dqa's Introduction

digitized Quantum Annealing via Tensor Network simulations

Project // Barone Francesco, Coppi Alberto, Zinesi Paolo

In this work, we explore the paradigmatic perceptron model for binary classification in a quantum computing context. The minimization of the cost function is performed using Quantum Annealing (QA), which is one of the most promising frameworks for quantum optimization.

Following the work of G. Lami et al (2022), we address the minimization of the complex classical cost function of a quantum perceptron model, i.e. we focus on the Hamiltonian $H = \sum_\mu \Theta(-\xi^\mu\cdot\sigma)\frac{-\xi^\mu\cdot\sigma}{\sqrt{N}}$, where $\lbrace \xi^\mu : \mu = 1,...,N_\xi \rbrace$ is a set of $N_\xi$ binary patterns $\xi^\mu \in \lbrace-1,+1\rbrace^N$.

As shown in G. Lami et al, the adiabatic time evolution of QA can be efficiently represented as Matrix Product Operators in a Tensor Network framework. Such representation allows for simple classical simulations, well-beyond small sizes amenable to exact diagonalization techniques. Indeed, discretizing the QA dynamics (dQA) into $P$ steps, we can evolve the initial state towards an optimized Matrix Product State (MPS).

We compute the energy density $\varepsilon(s)$ as a function of the interpolation parameter $s \in [0,1]$. The residual energy density at the end of the annealing schedule, $\varepsilon(1)$, can be regarded as a figure of merit of dQA effectiveness.

annealing_image

We validate the results as shown in the reference paper, for various dataset sizes $N$ in the range $8-21$.

Eventually, we propose a circuit to execute the discretized QA on a quantum computer. This circuit is probed using a quantum tensor-network emulator developed in Padua, Quantum Tea Leaves.


In this repo

├── data/            dataset and benchmarks
├── exact-diag/      QA with exact diagonalization
├── img/             plots
├── quimb-dqa/       first implementation of MPS dQA (with Quimb)
│
├─ dQA_mps.py        implementation of dQA with MPS (jax)
└─ dQA_circuit.py    implementation of dQA with Matcha/Qiskit

Setup

Python requirements are listed in requirements.txt.

Quantum Tea Leaves and Quantum Matcha Tea are required to run the dQA_circuit implementation. To setup a custom environment, we suggest to take a look at the script setup-env.sh, as it should work in most cases.

Our software has been tested with the following software version:

qiskit==0.38.0
qmatchatea==0.4.7
qtealeaves==0.4.15

Furthermore, in order to use the dQA circuit simulation via Matcha in step-by-step mode, it is necessary to hot-fix the Matcha library itself.

#   fix line 840 of file  qtealeaves.emulator.mps_simulator.py  as
obj = cls(len(tensor_list), 0, conv_params, local_dim)



Bibliography

  • G. Lami et al. "Quantum Annealing for Neural Network optimization problems: a new approach via Tensor Network simulations", in SciPost Physics, 2022 (arxiv:2208.14468)

Quantum Information and Computing
AY 2022/2023 - University of Padua

perceptron-dqa's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.