Repository: PennyLaneAI/pennylane

Issue:
Change order of technical description and list of functions in documentation
Three modules, [`kernels`](https://pennylane.readthedocs.io/en/latest/code/qml_kernels.html), [`grouping`](https://pennylane.readthedocs.io/en/latest/code/qml_grouping.html), and [`qaoa`](https://pennylane.readthedocs.io/en/latest/code/qml_qaoa.html) have their module documentation ordered such that there is first a lengthy description of the theory, and the actual list of functions comes after. We should update the docs of these modules so that the functions appear *first*, and the technical details come afterwards (as was recently discussed in #1160). This will improve readability of the documentation and make it easier to find the details of a desired function.


Discussion:
Can i help on this ?
@n45800 absolutely! Please go right ahead, and feel free to let us know if you have any questions :grin:
Hi! Can I still work on this issue? 
@AkashNarayanan for sure, but perhaps we should check in first with @n45800 to see whether there is a PR in the works that will be posted soon.
Hi , Akash yes you can work, unfortunately i am too busy these days to do
the update

On Mon, Aug 16, 2021 at 11:48 PM Olivia Di Matteo ***@***.***>
wrote:

> @AkashNarayanan <https://github.com/AkashNarayanan> for sure, but perhaps
> we should check in first with @n45800 <https://github.com/n45800> to make
> sure there is not a PR in the works that will be posted soon.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/PennyLaneAI/pennylane/issues/1365#issuecomment-899840285>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AB7QE427RU7J2EVP4HFLUWDT5GBUFANCNFSM45UGX26Q>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
> .
>

Sorry for the late response! I will start working on this issue now.

Resolving patch:
diff --git a/pennylane/kernels/__init__.py b/pennylane/kernels/__init__.py
--- a/pennylane/kernels/__init__.py
+++ b/pennylane/kernels/__init__.py
@@ -13,58 +13,8 @@
 # limitations under the License.
 r"""
 This subpackage defines functions that relate to quantum kernel methods.
-On one hand this includes functions to call a quantum kernel systematically
-on training and test datasets to obtain the *kernel matrix*.
-On the other hand it provides postprocessing methods for those kernel
-matrices which can be used to mitigate device noise and sampling errors.
-
-Given a kernel
-
-.. math ::
-
-    k: \mathbb{R}^d \times \mathbb{R}^d \to \mathbb{R}, \quad
-    (x_1, x_2)\mapsto k(x_1, x_2)
-
-the kernel matrix of :math:`k` on a training dataset
-:math:`\{(x_1, y_1),\cdots (x_n, y_n)\}` with :math:`x_i\in\mathbb{R}^d`
-and :math:`y_i\in\{-1, 1\}` is defined as
-
-.. math ::
-
-    K_{ij} = k(x_i, x_j).
-
-For valid kernels, this is a real symmetric positive semi-definite matrix.
-We also define the *ideal kernel matrix* for the training dataset which
-perfectly predicts whether two points have identical labels or not:
-
-.. math ::
-
-    K^\ast_{ij} = y_i y_j
-
-We can measure the similarity between :math:`K` and :math:`K^\ast`,
-through the *kernel polarity* which can be expressed as the Frobenius inner
-product between the two matrices:
-
-.. math ::
-
-    \operatorname{P}(k) = \langle K^\ast, K \rangle_F = \sum_{i,j=1}^n y_i y_j k(x_i, x_j)
-
-Additionally, there is the *kernel-target alignment*, which is the normalized
-counterpart to the kernel polarity:
-
-.. math ::
-
-    \operatorname{TA}(k) &= \frac{P(k)}{\lVert K^\ast \rVert_F\;\lVert K \rVert_F}\\
-        \lVert K\rVert_F &= \sqrt{\sum_{i,j=1}^n k(x_i, x_j)^2}\\
-   \lVert K^\ast\rVert_F &= \sqrt{\sum_{i,j=1}^n (y_iy_j)^2}
-
-For datasets with different numbers of training points per class the labels are rescaled
-by the number of datapoints in the respective class to avoid that kernel polarity and
-kernel-target alignment are dominated by the properties of the kernel for just a single class.
-
-Given a callable kernel function, all these quantities can readily be computed
-using the methods in this module.
 """
+
 from .cost_functions import (
     polarity,
     target_alignment,
diff --git a/pennylane/qaoa/__init__.py b/pennylane/qaoa/__init__.py
--- a/pennylane/qaoa/__init__.py
+++ b/pennylane/qaoa/__init__.py
@@ -12,10 +12,11 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 r"""
-This module contains functionality to construct QAOA workflows in PennyLane.
+This module provides a collection of methods that help in the construction of
+QAOA workflows.
 """
 
+import pennylane.qaoa.cycle
 from .mixers import *
 from .cost import *
 from .layers import *
-import pennylane.qaoa.cycle


Test patch: