From 78871c3a4f6c4ac8af9d7f044e0e90530820be8c Mon Sep 17 00:00:00 2001 From: Matthew Harrigan Date: Tue, 1 Nov 2022 10:56:21 -0700 Subject: [PATCH 1/6] Improve generic select documentation --- cirq_qubitization/generic_select.ipynb | 35 ++++++++++--------- cirq_qubitization/generic_select.py | 31 ++++++++-------- .../jupyter_autogen_factories.py | 18 +++------- 3 files changed, 39 insertions(+), 45 deletions(-) diff --git a/cirq_qubitization/generic_select.ipynb b/cirq_qubitization/generic_select.ipynb index 9a93d9aba..2e14a34af 100644 --- a/cirq_qubitization/generic_select.ipynb +++ b/cirq_qubitization/generic_select.ipynb @@ -35,12 +35,21 @@ }, "source": [ "## `GenericSelect`\n", - "Gate that implements SELECT for a Hamiltonian expressed as an LCU.\n", + "A generic controlled SELECT operation for applying Pauli strings.\n", "\n", - "Recall: SELECT = \\sum_{l}|l> Date: Thu, 3 Nov 2022 14:15:49 -0700 Subject: [PATCH 2/6] try new docstring --- cirq_qubitization/generic_select.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cirq_qubitization/generic_select.py b/cirq_qubitization/generic_select.py index dde88bfd7..b01dc82b8 100644 --- a/cirq_qubitization/generic_select.py +++ b/cirq_qubitization/generic_select.py @@ -7,7 +7,8 @@ class GenericSelect(unary_iteration.UnaryIterationGate): - r"""A generic controlled SELECT operation for applying Pauli strings. + r"""A generic controlled SELECT gate for selecting and applying operators from an + array of `PauliString`s. $$ \mathrm{SELECT} = \sum_{l}|l \rangle \langle l| \otimes U_l From 5cf063fcbfc37a8c85a7ab4508aed958d0444b63 Mon Sep 17 00:00:00 2001 From: Matthew Harrigan Date: Thu, 3 Nov 2022 14:16:09 -0700 Subject: [PATCH 3/6] re-render --- cirq_qubitization/generic_select.ipynb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cirq_qubitization/generic_select.ipynb b/cirq_qubitization/generic_select.ipynb index 2e14a34af..621b81ead 100644 --- a/cirq_qubitization/generic_select.ipynb +++ b/cirq_qubitization/generic_select.ipynb @@ -35,7 +35,8 @@ }, "source": [ "## `GenericSelect`\n", - "A generic controlled SELECT operation for applying Pauli strings.\n", + "A generic controlled SELECT gate for selecting and applying operators from an\n", + "array of `PauliString`s.\n", "\n", "$$\n", "\\mathrm{SELECT} = \\sum_{l}|l \\rangle \\langle l| \\otimes U_l\n", From 4b4d2308e1f96b48e3e91a982d1dd166da802139 Mon Sep 17 00:00:00 2001 From: Matthew Harrigan Date: Thu, 3 Nov 2022 14:17:31 -0700 Subject: [PATCH 4/6] re-render after merging main --- cirq_qubitization/generic_select.ipynb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cirq_qubitization/generic_select.ipynb b/cirq_qubitization/generic_select.ipynb index 621b81ead..e91b9cc79 100644 --- a/cirq_qubitization/generic_select.ipynb +++ b/cirq_qubitization/generic_select.ipynb @@ -7,7 +7,9 @@ "cq.autogen": "title_cell" }, "source": [ - "# Generic Select" + "# Generic Select\n", + "\n", + "Gates for applying generic selected unitaries." ] }, { From 41eb5b04e3678d8abd1601e5bdfd955ab70dbb49 Mon Sep 17 00:00:00 2001 From: Matthew Harrigan Date: Mon, 7 Nov 2022 14:37:49 -0800 Subject: [PATCH 5/6] one line --- cirq_qubitization/generic_select.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cirq_qubitization/generic_select.py b/cirq_qubitization/generic_select.py index b01dc82b8..5fa55d96e 100644 --- a/cirq_qubitization/generic_select.py +++ b/cirq_qubitization/generic_select.py @@ -7,8 +7,7 @@ class GenericSelect(unary_iteration.UnaryIterationGate): - r"""A generic controlled SELECT gate for selecting and applying operators from an - array of `PauliString`s. + r"""A SELECT gate for selecting and applying operators from an array of `PauliString`s. $$ \mathrm{SELECT} = \sum_{l}|l \rangle \langle l| \otimes U_l From dd0928174407e72e984ea23a764d59ef2cd3d452 Mon Sep 17 00:00:00 2001 From: Matthew Harrigan Date: Mon, 7 Nov 2022 14:39:53 -0800 Subject: [PATCH 6/6] Re-render --- cirq_qubitization/generic_select.ipynb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cirq_qubitization/generic_select.ipynb b/cirq_qubitization/generic_select.ipynb index e91b9cc79..917db3b13 100644 --- a/cirq_qubitization/generic_select.ipynb +++ b/cirq_qubitization/generic_select.ipynb @@ -37,8 +37,7 @@ }, "source": [ "## `GenericSelect`\n", - "A generic controlled SELECT gate for selecting and applying operators from an\n", - "array of `PauliString`s.\n", + "A SELECT gate for selecting and applying operators from an array of `PauliString`s.\n", "\n", "$$\n", "\\mathrm{SELECT} = \\sum_{l}|l \\rangle \\langle l| \\otimes U_l\n",