https://github.com/amacaluso/quantum-splines-for-non-linear-approximations

This repository contains the code to reproduce the results in the paper Quantum Splines for Non-Linear Approximation, under publication for the ACM International Conference on Computing Frontiers 2020.

https://github.com/amacaluso/quantum-splines-for-non-linear-approximations

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: acm.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.2%) to scientific vocabulary

Keywords

hhl-algorithm non-linear-model quantum-computing quantum-spline
Last synced: 9 months ago · JSON representation

Repository

This repository contains the code to reproduce the results in the paper Quantum Splines for Non-Linear Approximation, under publication for the ACM International Conference on Computing Frontiers 2020.

Basic Info
  • Host: GitHub
  • Owner: amacaluso
  • License: apache-2.0
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 8.3 MB
Statistics
  • Stars: 6
  • Watchers: 1
  • Forks: 2
  • Open Issues: 0
  • Releases: 0
Topics
hhl-algorithm non-linear-model quantum-computing quantum-spline
Created almost 7 years ago · Last pushed almost 4 years ago

https://github.com/amacaluso/Quantum-Splines-for-Non-Linear-Approximations/blob/master/

# Quantum Spline

This repository contains the code to reproduce the results presented in the paper 
[Quantum Splines for Non-Linear Approximations](https://dl.acm.org/doi/pdf/10.1145/3387902.3394032),
published in the *Proceedings* of the 
[17th ACM International Conference on Computing Frontiers (CF'20)](http://www.computingfrontiers.org/2020/) 
and freely available on the [ACM Digital Library](https://dl.acm.org/doi/abs/10.1145/3387902.3394032).

# Description

The idea underpinning the work is to leverage *spline* functions to overcome the constraint to unitary transformations
and being able to approximate non-linear functions on a quantum device. To demonstrate this, we formulated the problem
according to a B-Spline parametrisation and we investigated 4 popular non-linear activation functions commonly used for Neural Networks, 
namely *sigmoid*, *hyperbolic tangent (tanh)*, *rectified linear unit (relu)* and *exponential linear unit (elu)*.

# Usage

The code is organised in four different scripts, one per activation function. 
Specifically, *Sigmoid.py, Tanh.py, Relu.py, Elu.py* compute a B-spline approximation of the corrispondent function using three approaches: 
- *Full quantum*: uses the HHL quantum algorithm to estimate B-spline coeffients and a second quantum circuit for function evaluation
- *Quantum Hybrid*: uses the HHL algorithm to estimates B-Spline coefficients and classical approach for function evaluation
- *Classical*: coefficient estimates and function evaluation are performed under the classical computing paradigm

The script *Utils.py* is used to import the needed packages and all of the custom routines for function evaluation.

The script *Utils_Spline.py* contains the custom routines for B-Spline coefficients estimation.

The script *Viz_complexity.py* plots the comparison between quantum HHL and classical algorithms for matrix inversion in terms of computational complexity.

The script *All_viz.py* plots in one plot all the activation functions.

# Installation

In order to run the code and reproduce the results of the paper, it is recommended to re-create the same testing environment following the procedure below.

*Note: tested on linux OS only; it assumes Anaconda is installed*

 - First, clone the repository:
 
 `git clone https://github.com/amacaluso/Quantum_Spline.git`
 
  - Second, create a conda environment from scratch using the *environment.yml* specs:
  
  ```
# enter the repository
cd Quantum_Spline

# create an environment named QSplines with desired dependencies
conda env create -f environment.yml 
```
 - Third, install *qiskit* package:
 
 ```angular2
# activate the environmet
conda activate QSplines

# install qiskit 0.13
pip install qiskit==0.13
```

## Issues

For any issues or questions related to the code, open a new git issue or send a mail to antonio.macaluso@dfki.de

Owner

  • Name: Antonio Macaluso
  • Login: amacaluso
  • Kind: user
  • Location: Saarbrücken, Germany
  • Company: German Research Center for Artificial Intelligence

Senior Researcher in Quantum Artificial Intelligence | PhD in Computer Science and Engineering

GitHub Events

Total
  • Watch event: 2
Last Year
  • Watch event: 2

Dependencies

environment.yml pypi