Giter Club home page Giter Club logo

qnn's Introduction

QNN

Implementation of a quantum neural network using Strawberry Fields and TensorFlow.

Aimed to be a proof-of-concept for a realistic QNN, based on the model proposed in the paper arXiv:1806.06971.

Project Structure

The curve_fit folder contains an implemetation of a QNN to perform curve fitting to noisy data. The way this is performed is also described in the paper mentioned above.

There are two different implementations of the QNN. One is exactly as described in the paper. The other has an ancilla mode, which is entangled with the main mode using a beam splitter, then a post-selection measurement is performed. This overall results in a non-Gaussian operation on the main mode, which is used to replace the Kerr gate.

  • curve_fit/run_curve_fit_x.py implements the QNN described in the paper (with a Kerr gate)
  • curve_fit/run_curve_fit.py uses an ancilla mode with a Fock state

The curve_fit_cats folder is the same as above, but using a cat state instead of a Fock state for the ancilla.

The state_classifier is a (failed) attempt at using a QNN to classify whether or not the input state is Gaussian.

Within each folder:

  • training/*.npz - Training data in numpy format
  • params/ - Values of Tensorflow parameters that are loaded prior to training the QNN
  • results/ - Results after training the QNN. Subdirectory names are formatted as {training set}-{n_in}-{n_post}/ for the Fock state ancilla, and {training set}-{n_post}/ for the cat state ancilla. Within these directories:
    • The checkpoint and model.* files are the final parameter values, stored in Tensorflow format
    • output.npz contains a set of values that have been input to the QNN, and their corresponding outputs, as well as an array containing the value of the loss function at each training epoch
    • hyperparams.txt lists the hyperparameters the QNN was trained with

qnn's People

Contributors

lewis-od avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

qnn's Issues

No noisy input inside sinc.npz

Dear @lewis-od

I would like to mention that in the run_curve_fit_x.py file:

actual_input = f['noisy']

However, there is no 'noisy' file given in the f variable.

The following are the inside in the f variable:

  • x
  • y
  • x_true
  • y_true

Could there be a mistake in the code?

Thanks
Regards

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.