QNN
Implementation of a quantum neural network using Strawberry Fields and TensorFlow
Install / Use
/learn @lewis-od/QNNREADME
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.pyimplements the QNN described in the paper (with a Kerr gate)curve_fit/run_curve_fit.pyuses 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 formatparams/- Values of Tensorflow parameters that are loaded prior to training the QNNresults/- 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
checkpointandmodel.*files are the final parameter values, stored in Tensorflow format output.npzcontains 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 epochhyperparams.txtlists the hyperparameters the QNN was trained with
- The
Related Skills
YC-Killer
2.7kA library of enterprise-grade AI agents designed to democratize artificial intelligence and provide free, open-source alternatives to overvalued Y Combinator startups. If you are excited about democratizing AI access & AI agents, please star ⭐️ this repository and use the link in the readme to join our open source AI research team.
groundhog
398Groundhog's primary purpose is to teach people how Cursor and all these other coding agents work under the hood. If you understand how these coding assistants work from first principles, then you can drive these tools harder (or perhaps make your own!).
last30days-skill
18.3kAI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary
sec-edgar-agentkit
10AI agent toolkit for accessing and analyzing SEC EDGAR filing data. Build intelligent agents with LangChain, MCP-use, Gradio, Dify, and smolagents to analyze financial statements, insider trading, and company filings.
