All Projects → mstechly → vqf

mstechly / vqf

Licence: Apache-2.0 License
Implementation of Variational Quantum Factoring algorithm.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to vqf

launchpad
Resources to get started in Quantum Computing!
Stars: ✭ 21 (-34.37%)
Mutual labels:  quantum-computing
krotov
Python implementation of Krotov's method for quantum optimal control
Stars: ✭ 46 (+43.75%)
Mutual labels:  quantum-computing
GNFS
A complete, proof-of-concept, C# implementation of the General Number Field Sieve algorithm for factoring very large semi-prime numbers. The focus was on readability and understandability of the code, not performance.
Stars: ✭ 39 (+21.88%)
Mutual labels:  factoring-integers
a-tour-of-pytorch-optimizers
A tour of different optimization algorithms in PyTorch.
Stars: ✭ 46 (+43.75%)
Mutual labels:  optimization-algorithms
dwave-cloud-client
A minimal implementation of the REST interface used to communicate with D-Wave Solver API (SAPI) servers.
Stars: ✭ 51 (+59.38%)
Mutual labels:  quantum-computing
FrankWolfe.jl
Julia implementation for various Frank-Wolfe and Conditional Gradient variants
Stars: ✭ 47 (+46.88%)
Mutual labels:  optimization-algorithms
awesome-qsharp
A curated list of Q# code and resources.
Stars: ✭ 123 (+284.38%)
Mutual labels:  quantum-computing
RelevancyTuning
Dice.com tutorial on using black box optimization algorithms to do relevancy tuning on your Solr Search Engine Configuration from Simon Hughes Dice.com
Stars: ✭ 28 (-12.5%)
Mutual labels:  optimization-algorithms
procrustes
Python library for finding the optimal transformation(s) that makes two matrices as close as possible to each other.
Stars: ✭ 48 (+50%)
Mutual labels:  optimization-algorithms
qosf.org
Web portal of Quantum Open Source Foundation
Stars: ✭ 103 (+221.88%)
Mutual labels:  quantum-computing
Performance-Estimation-Toolbox
Code of the Performance Estimation Toolbox (PESTO) whose aim is to ease the access to the PEP methodology for performing worst-case analyses of first-order methods in convex and nonconvex optimization. The numerical worst-case analyses from PEP can be performed just by writting the algorithms just as you would implement them.
Stars: ✭ 38 (+18.75%)
Mutual labels:  optimization-algorithms
simobility
simobility - light-weight mobility simulation framework. Best for quick prototyping
Stars: ✭ 29 (-9.37%)
Mutual labels:  optimization-algorithms
Nonlinear-Optimization-Algorithms
MATLAB implementations of a variety of nonlinear programming algorithms.
Stars: ✭ 86 (+168.75%)
Mutual labels:  optimization-algorithms
FirstOrderSolvers.jl
Large scale convex optimization solvers in julia
Stars: ✭ 20 (-37.5%)
Mutual labels:  optimization-algorithms
qpmad
ROS-compatible Eigen-based Goldfarb-Idnani quadratic programming solver
Stars: ✭ 41 (+28.13%)
Mutual labels:  optimization-algorithms
dwave-system
An API for easily incorporating the D-Wave system as a sampler, either directly or through Leap's cloud-based hybrid samplers
Stars: ✭ 77 (+140.63%)
Mutual labels:  quantum-computing
ThrottleControlledAvionics
A mod for KerbalSaceProgram
Stars: ✭ 45 (+40.63%)
Mutual labels:  optimization-algorithms
OpenFermion-PySCF
OpenFermion plugin to interface with the electronic structure package PySCF.
Stars: ✭ 76 (+137.5%)
Mutual labels:  quantum-computing
rpcq
The RPC framework and message specification for @rigetti Quantum Cloud Services.
Stars: ✭ 67 (+109.38%)
Mutual labels:  quantum-computing
gibbous
Convex optimization for java and scala, built on Apache Commons Math
Stars: ✭ 17 (-46.87%)
Mutual labels:  optimization-algorithms

Variation Quantum Factoring

Introduction

This repository contains implementation of the algorithm presented in the article "Variational Quantum Factoring", by Eric R. Anschuetz, Jonathan P. Olson, Alán Aspuru-Guzik, Yudong Cao. It's available on arxiv.

The notation in the code refers directly to the notation in the paper.

I gave a talk about this project, which might be a good introduction to it. You can find it on YouTube and the slides are in this repository in the presentation.pdf file.

Since QAOA is an important part of the algorithm, if you're unfamiliar with it you might find my blogpost about QAOA helpful.

Requirements

This project relies heavily on pyquil and grove libraries. Unfortunately, at the time I was developing this project, released versions had bugs that were critical for this project. Therefore, I've installed them from source:

  • pyquil, commit-sha: f22a851d5803e0a6aa73b236c25d28a5fcdb0116
  • grove, commit-sha: dc6bf6ec63e8c435fe52b1e00f707d5ce4cdb9b3

All the packages that don't get installed automatically during instalation of pyquil and grove are listed in the requirements.txt file. List of all the installed packages that has been used for this project can be found in pip_freeze.txt.

Differences from the paper

Below you can find a list of points where I'm aware that my implementation differs from the one provided in the paper.

General

  • To perform simulations I decided to use pyQuil instead of QuTiP.

Preprocessing

  • Number of preprocessing rules is higher than what comes from the equations (5) in the paper, since some of them were not stated explicitly ("trivial relations").
  • The results suggest that this script does more preprocessing than what has been done in the paper.
  • Algorithm can be ran with (as in paper, see footnote 38) or without prior knowledge about the length of the numbers p and q.
  • In order to use custom preprocessing rules for numbers 56153 and 291311 (see footnote 40), specific functions must be called. Otherwise, the regular preprocessing scheme will be applied.

QAOA

  • The grid size used for the initialization of BFGS algorithm (Table I in the paper) has been chosen arbitrary. Therefore I have also used arbitrary grid size - it might be too low in some cases, depending on the number being factored. Make sure you choose the right parameter here.
  • Implementation of the BFGS algorithm is different from the one used in the original paper (see report in research/2019_05_08_performance_checks).

Research

Research performed using this implementation can be found in the research directory. I follow the convention presented here.

Tests

To run tests please run python -m pytest from the main directory.

Issues

Randomness in results

For some reason, the preprocessing is not deterministic. Running the same case sporadically leads to getting different results. It seems to come from the fact, that there is some randomness inside sympy when it comes to ordering operations. Hence, preprocessing sometimes assigns x=y and sometimes y=x, which leads to different expressions after substition. From the mathematical point of view it doesn't matter, but from the practical - it does. Since set of implemented rules is incomplete, different substitution may occasionally lead to form which this algorithm cannot simplify. This effect diminished over time of development - i.e. improving rules and fixing bugs.

Known issues

I do not claim that the preprocessing part is perfect, though from manual inspection it seems to be working in most cases. Below are some known bugs.

  • Current version of code doesn't produce correct results for number 1465 (factors: 293 and 5). This doesn't happen always (see note about randomness above).
  • There are still some additional rules to add / cases to fix (see TODO in preprocessing.py).
  • In cases exhibiting some form of symmetry (as described here), procedure of calculating squared overlap might give wrong results. The fix for numbers 56153 and 291311, has been hardcoded, but it's far from being elegant and general solution.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].