Skip to content

Commit

Permalink
Merge pull request #101 from raulconchello/dev_PennyLane_optimization…
Browse files Browse the repository at this point in the history
…_methods

Implementation of pennylane optimizers
  • Loading branch information
vishal-ph authored Nov 18, 2022
2 parents 346c5de + 9b76633 commit 12b0e68
Show file tree
Hide file tree
Showing 35 changed files with 7,318 additions and 70 deletions.
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ sphinx-rtd-theme==1.0.0
ipython==8.2.0
pandas>=1.3.5
amazon-braket-sdk==1.23.0
autograd>=1.4
semantic_version>=2.10
autoray>=0.3.1
12 changes: 12 additions & 0 deletions docs/source/optimizers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ SciPy Optimizers
:show-inheritance:
:inherited-members:

.. autoclass:: openqaoa.optimizers.training_vqa.PennyLaneOptimizer
:members:
:undoc-members:
:show-inheritance:
:inherited-members:

Optimization Methods
--------------------
.. automodule:: openqaoa.optimizers.optimization_methods
Expand All @@ -29,6 +35,12 @@ Optimization Methods
:show-inheritance:
:inherited-members:

.. automodule:: openqaoa.optimizers.pennylane.optimization_methods_pennylane
:members:
:undoc-members:
:show-inheritance:
:inherited-members:

Derivate functions
------------------

Expand Down
1 change: 1 addition & 0 deletions openqaoa/optimizers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
Currently supports:
ScipyOptimizers (both gradient-free and gradient-based)
PennylaneOptimizers (adagrad, adam, gradient descent, nestrov momentum, rms prop, rotosolve, spsa)
"""

from .training_vqa import *
Expand Down
13 changes: 13 additions & 0 deletions openqaoa/optimizers/pennylane/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
PennyLane
Copyright 2018-2021 Xanadu Quantum Technologies Inc.

This folder contains code developed in Xanadu Quantum Technologies Inc.
The code in folders
openqaoa.optimizers.pennylane.fourier
openqaoa.optimizers.pennylane.math
openqaoa.optimizers.pennylane.numpy
openqaoa.optimizers.pennylane.pennylane_optimizers
has been taken from the PennyLane library, https://github.com/PennyLaneAI/pennylane,
developed by Xanadu Quantum Technologies Inc.
PennyLane is free and open source, released under the Apache License, Version 2.0.
Some lines of code have been modified, which has been indicated in the modified files.
34 changes: 34 additions & 0 deletions openqaoa/optimizers/pennylane/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2022 Entropica Labs
#
# 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.

"""
PennyLane optimizers directory for the classical optimization loop for QAOA
"""

from .pennylane_optimizers.adagrad import *
from .pennylane_optimizers.adam import *
from .pennylane_optimizers.gradient_descent import *
from .pennylane_optimizers.momentum import *
from .pennylane_optimizers.nesterov_momentum import *
from .pennylane_optimizers.rms_prop import *
from .pennylane_optimizers.rotosolve import *
from .pennylane_optimizers.spsa import *
from . import numpy
from . import math
from . import fourier

#empty class to be used as a placeholder for the QNode class from PennyLane
class QNode:
def __init__(self):
pass
17 changes: 17 additions & 0 deletions openqaoa/optimizers/pennylane/fourier/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2018-2021 Xanadu Quantum Technologies Inc.

# 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.
"""This module contains functions to analyze the Fourier representation
of quantum circuits."""
import warnings
from .reconstruct import reconstruct
Loading

0 comments on commit 12b0e68

Please sign in to comment.