From e716ec0c9108ad0669141c170e60fd5a50311fe5 Mon Sep 17 00:00:00 2001 From: Jack Ceroni Date: Fri, 7 Aug 2020 13:18:02 -0400 Subject: [PATCH 1/6] changelog --- .github/CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index a7217f2b5b5..f2566b8e490 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -87,6 +87,22 @@ * Added an `ApproxTimeEvolution` template to the PennyLane templates module, which can be used to implement Trotterized time-evolution under a Hamiltonian. [(#710)](https://github.com/XanaduAI/pennylane/pull/710) + +* Added a `qml.repeat` template-constructing function, which takes a quantum circuit, and + repeatedly applies it on a set of wires to a given depth. + [(#723)](https://github.com/PennyLaneAI/pennylane/pull/723) + +* Added built-in QAOA functionality to PennyLane. This includes the following features: + * Added `qml.qaoa.x_mixer` and `qml.qaoa.xy_mixer` methods for defining Pauli-X and XY + mixer Hamiltonians. + [(#712)](https://github.com/PennyLaneAI/pennylane/pull/712) + * Added the `qml.qaoa.maxcut` method, which allows the user to get the cost Hamiltonian + and recommended mixer Hamiltonian for QAOA MaxCut, for a supplied graph. + [(#718)](https://github.com/PennyLaneAI/pennylane/pull/718) + [(#741)](https://github.com/PennyLaneAI/pennylane/pull/741) + * Added `qml.qaoa.cost_layer` and `qml.qaoa.mixer_layer`, which take cost and mixer Hamiltonians, + respectively, and apply the corresponding QAOA cost and mixer layers. + [(#720)](https://github.com/PennyLaneAI/pennylane/pull/720)

Improvements

From 9ffda64414838ec5bdd3a1b10ba2e8f36afc344d Mon Sep 17 00:00:00 2001 From: Jack Ceroni Date: Fri, 7 Aug 2020 15:41:34 -0400 Subject: [PATCH 2/6] docs --- doc/code/qml_qaoa.rst | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/doc/code/qml_qaoa.rst b/doc/code/qml_qaoa.rst index 3a0c7f8776e..258796130c0 100644 --- a/doc/code/qml_qaoa.rst +++ b/doc/code/qml_qaoa.rst @@ -3,7 +3,26 @@ qml.qaoa .. currentmodule:: pennylane.qaoa -.. automodapi:: pennylane.qaoa +Mixer Hamiltonians +------------------ + +.. automodapi:: pennylane.qaoa.mixers + :no-heading: + :no-inheritance-diagram: + :no-inherited-members: + +Cost Hamiltonians +----------------- + +.. automodapi:: pennylane.qaoa.cost + :no-heading: + :no-inheritance-diagram: + :no-inherited-members: + +QAOA Layers +----------- + +.. automodapi:: pennylane.qaoa.layers :no-heading: :no-inheritance-diagram: - :no-inherited-members: \ No newline at end of file + :no-inherited-members: From b21273edac437f0f91a8eeba36e6ff3567f72c6f Mon Sep 17 00:00:00 2001 From: Jack Ceroni Date: Wed, 12 Aug 2020 09:33:37 -0400 Subject: [PATCH 3/6] change --- .github/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index f2566b8e490..b377de5f151 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -88,7 +88,7 @@ can be used to implement Trotterized time-evolution under a Hamiltonian. [(#710)](https://github.com/XanaduAI/pennylane/pull/710) -* Added a `qml.repeat` template-constructing function, which takes a quantum circuit, and +* Added a `qml.layer` template-constructing function, which takes a unitary, and repeatedly applies it on a set of wires to a given depth. [(#723)](https://github.com/PennyLaneAI/pennylane/pull/723) From a1d2a7f1ab22db13c43140e29071866ebd0b14fe Mon Sep 17 00:00:00 2001 From: Jack Ceroni Date: Wed, 12 Aug 2020 09:42:27 -0400 Subject: [PATCH 4/6] changes --- pennylane/qaoa/cost.py | 2 +- pennylane/qaoa/mixers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pennylane/qaoa/cost.py b/pennylane/qaoa/cost.py index d5df367f559..343c4a168f8 100644 --- a/pennylane/qaoa/cost.py +++ b/pennylane/qaoa/cost.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. r""" -This file contains functions that generate QAOA cost Hamiltonians corresponding to +Methods for generating QAOA cost and mixer Hamiltonians corresponding to different optimization problems. """ diff --git a/pennylane/qaoa/mixers.py b/pennylane/qaoa/mixers.py index 49219ccaec2..e2f04245dde 100644 --- a/pennylane/qaoa/mixers.py +++ b/pennylane/qaoa/mixers.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. r""" -This file contains built-in functions for constructing QAOA mixer Hamiltonians. +Methods for constructing QAOA mixer Hamiltonians. """ import networkx as nx import pennylane as qml From 8758e554e4d8105b3e89ee669c68c99899272fa6 Mon Sep 17 00:00:00 2001 From: Jack Ceroni Date: Wed, 12 Aug 2020 09:49:54 -0400 Subject: [PATCH 5/6] changes --- pennylane/qaoa/cost.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pennylane/qaoa/cost.py b/pennylane/qaoa/cost.py index 343c4a168f8..ed4f91b9167 100644 --- a/pennylane/qaoa/cost.py +++ b/pennylane/qaoa/cost.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. r""" -Methods for generating QAOA cost and mixer Hamiltonians corresponding to +Methods for generating QAOA cost Hamiltonians corresponding to different optimization problems. """ From c09be9b762238fbe8123e9ac1869c7b4ea0c3dcb Mon Sep 17 00:00:00 2001 From: Jack Ceroni Date: Wed, 12 Aug 2020 12:31:37 -0400 Subject: [PATCH 6/6] re-run tests