GithubHelp home page GithubHelp logo

kaustuvi / bohr_cirq_qaoa Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 5.0 108 KB

Implementation of Quantum Approximate Optimization Algorithm (QAOA) to solve the MAXCUT problem in Google Cirq framework.

Python 100.00%

bohr_cirq_qaoa's Introduction

Cirq QAOA

Introduction

The goal of this project was to implement the Quantum Approximate Optimization Algorithm (QAOA) by Edward Farhi, Jeffrey Goldstone and Sam Gutmann in the Cirq framework from Google. As an application, this implmentation was used to solve the Maximum Cut problem.

References

Modules

  • cirq_qaoa :
    Contains classes and routines to implement QAOA and solve the Max-Cut problem using Variational Quantum Eigensolver (VQE)
    • cirq_maxcut_solver.py : contains class CirqMaxCutSolver. CirqMaxCutSolver creates the cost operators and the mixing operators for the input graph and returns a QAOA object that solves the Maxcut problem for the input graph
    • qaoa.py : contains class QAOA. QAOA constains all information for running the QAOA algorthm to find the ground state of the list of cost clauses.
    • vqe.py : contains class VQE. VQE is an object that encapsulates the VQE algorithm (functional minimization). The main components of the VQE algorithm are a minimizer function for performing the functional minimization, a function that takes a vector of parameters and returns a Cirq circuit, and a Hamiltonian for which the expectation value is to be calculated.
    • pauli_operations.py : contains class CirqPauliSum. CirqPauliSum is a utitlity class that adds PauliStrings according to Pauli algebra rules. This file also contains the function exponentiate_pauli_string() for constructing a circuit corresponding to equation for the cost or mixing clause term and a parameter equation
  • main.py : runs an implementation of QAOA to solve the Max-Cut problem on an input graph

Commit Hash and Disclaimer

The implementation of QAOA in this project is based on Rigetti's implementation of QAOA in Rigetti's Grove project with the commit hash dc6bf6ec63e8c435fe52b1e00f707d5ce4cdb9b3.
The function get_parameterized_circuit() in qaoa.py and the code for the class VQE in vqe.py are copied from Grove with the original copyright disclaimer:

Copyright 2016-2017 Rigetti Computing
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Work in Progress

QAOA has been implemented successfully in the Cirq framework and has also been used to solve the Max-Cut problem for unweighted input graphs.

Possible Further Steps

The next step of this project is to compare the results of the QAOA implementation from Grove with the current implementation in terms of the possible following paramters:

  • Runtimes
  • Number of steps in optimization
  • Circuit depth (after compilation)
  • Possibly introduce noise

bohr_cirq_qaoa's People

Contributors

kaustuvi avatar mstechly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.