{"id":13689454,"url":"https://github.com/XanaduAI/quantum-neural-networks","last_synced_at":"2025-05-01T23:34:37.330Z","repository":{"id":38290976,"uuid":"150580624","full_name":"XanaduAI/quantum-neural-networks","owner":"XanaduAI","description":" This repository contains the source code used to produce the results presented in the paper \"Continuous-variable quantum neural networks\". Due to subsequent interface upgrades, these scripts will work only with Strawberry Fields version \u003c= 0.10.0.","archived":false,"fork":false,"pushed_at":"2023-03-24T23:52:23.000Z","size":1057,"stargazers_count":299,"open_issues_count":3,"forks_count":86,"subscribers_count":25,"default_branch":"master","last_synced_at":"2024-11-06T17:47:50.433Z","etag":null,"topics":["deep-learning","machine-learning","optimization","photonics","quantum","quantum-computing","quantum-machine-learning","tensorflow"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/1806.06871","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XanaduAI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-09-27T12:07:18.000Z","updated_at":"2024-10-09T18:37:24.000Z","dependencies_parsed_at":"2023-01-22T02:52:09.418Z","dependency_job_id":null,"html_url":"https://github.com/XanaduAI/quantum-neural-networks","commit_stats":{"total_commits":50,"total_committers":6,"mean_commits":8.333333333333334,"dds":0.64,"last_synced_commit":"d28e68b2faa8578362117a160a224a24cd97128e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XanaduAI%2Fquantum-neural-networks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XanaduAI%2Fquantum-neural-networks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XanaduAI%2Fquantum-neural-networks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XanaduAI%2Fquantum-neural-networks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XanaduAI","download_url":"https://codeload.github.com/XanaduAI/quantum-neural-networks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224282280,"owners_count":17285798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","machine-learning","optimization","photonics","quantum","quantum-computing","quantum-machine-learning","tensorflow"],"created_at":"2024-08-02T15:01:48.629Z","updated_at":"2024-11-12T13:31:46.802Z","avatar_url":"https://github.com/XanaduAI.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003cimg align=\"left\" src=\"https://github.com/XanaduAI/quantum-neural-networks/blob/master/static/tetronimo.png\" width=300px\u003e\n\n# Continuous-variable quantum neural networks\n\nThis repository contains the source code used to produce the results presented in [*\"Continuous-variable quantum neural networks\"*](https://doi.org/10.1103/PhysRevResearch.1.033063).\n\n\u003cbr/\u003e\n\n## Requirements\n\nTo construct and optimize the variational quantum circuits, these scripts and notebooks use the TensorFlow backend of [Strawberry Fields](https://github.com/XanaduAI/strawberryfields). In addition, matplotlib is required for generating output plots.\n\n**Due to subsequent interface upgrades, these scripts will work only with the following\nconfiguration**\n \n- Strawberry Fields version 0.10.0\n- TensorFlow version 1.3\n- Python version 3.5 or 3.6\n\nYour version of Python can be checked by running `python --version`. The correct versions of\nStrawberryFields and TensorFlow can be installed by running `pip install -r requirements.txt`\nfrom the main directory of this repository. \n\n## Contents\n\n\u003c!-- \u003cp align=\"center\"\u003e\n\t\u003cimg src=\"https://github.com/XanaduAI/quantum-neural-networks/blob/master/static/function_fitting.png\"\u003e\n\u003c/p\u003e --\u003e\n\n* **Function fitting**: The folder `function_fitting` contains the Python script `function_fitting.py`, which automates the process of fitting classical functions using continuous-variable (CV) variational quantum circuits. Simply specify the function you would like to fit, along with other hyperparameters, and this script automatically constructs and optimizes the CV quantum neural network. In addition, training data is also provided.\n\n* **Quantum autoencoder**: coming soon.\n\n* **Quantum fraud detection**: The folder `fraud_detection` contains the Python script `fraud_detection.py`, which builds and trains a hybrid classical/quantum model for fraud detection. Additional scripts are provided for visualizing the results.\n\n* **Tetrominos learning**: The folder `tetrominos_learning` contains the Python script `tetrominos_learning.py`, which trains a continuous-variable (CV) quantum neural network. The task of the network is to encode 7 different 4X4 images, representing the (L,O,T,I,S,J,Z) [tetrominos](https://en.wikipedia.org/wiki/Tetromino), in the photon number distribution of two light modes. Once the training phase is completed, the script `plot_images.py` can be executed in order to generate a `.png` figure representing the final results.\n\n\u003cimg align='right' src=\"https://github.com/XanaduAI/quantum-neural-networks/blob/master/static/tetronimo_gif.gif\"\u003e\n\n## Using the scripts\n\nTo use the scripts, simply set the input data, output data, and hyperparametersby modifying the scripts directly - and then enter the subdirectory and run the script using Python 3:\n\n```bash\npython3 script_name.py\n```\n\nThe outputs of the simulations will be saved in the subdirectory.\n\nTo access any saved data, the file can be loaded using NumPy:\n\n```python\nresults = np.load('simulation_results.npz')\n```\n\n## Authors\n\nNathan Killoran, Thomas R. Bromley, Juan Miguel Arrazola, Maria Schuld, Nicolás Quesada, and Seth Lloyd.\n\nIf you are doing any research using this source code and Strawberry Fields, please cite the following two papers:\n\n\u003e Nathan Killoran, Thomas R. Bromley, Juan Miguel Arrazola, Maria Schuld, Nicolás Quesada, and Seth Lloyd. Continuous-variable quantum neural networks. [Physical Review Research, 1(3), 033063](https://doi.org/10.1103/PhysRevResearch.1.033063) (2019).\n\n\u003e Nathan Killoran, Josh Izaac, Nicolás Quesada, Ville Bergholm, Matthew Amy, and Christian Weedbrook. Strawberry Fields: A Software Platform for Photonic Quantum Computing. arXiv, 2018. [Quantum, 3, 129](https://quantum-journal.org/papers/q-2019-03-11-129/) (2019).\n\n## License\n\nThis source code is free and open source, released under the Apache License, Version 2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FXanaduAI%2Fquantum-neural-networks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FXanaduAI%2Fquantum-neural-networks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FXanaduAI%2Fquantum-neural-networks/lists"}