Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace macros in demo "Here comes the SU(N)" #745

Merged
merged 109 commits into from
Apr 19, 2023
Merged
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
5743fa5
Development branch
josh146 Nov 15, 2022
39ca8c1
Merge branch 'master' into dev
actions-user Nov 18, 2022
17fdcb4
Merge branch 'master' into dev
actions-user Nov 21, 2022
47e83e1
Merge branch 'master' into dev
actions-user Nov 21, 2022
12ef0b8
Merge branch 'master' into dev
actions-user Nov 22, 2022
ecad024
Merge branch 'master' into dev
actions-user Nov 23, 2022
b0fb42b
Merge branch 'master' into dev
actions-user Nov 25, 2022
f39ee3f
Merge branch 'master' into dev
actions-user Nov 28, 2022
00becee
Merge branch 'master' into dev
actions-user Nov 28, 2022
3685225
Merge branch 'master' into dev
actions-user Nov 29, 2022
ce0d527
Merge branch 'master' into dev
actions-user Dec 1, 2022
8a86295
Merge branch 'master' into dev
actions-user Dec 2, 2022
7a323e1
Merge branch 'master' into dev
actions-user Dec 5, 2022
289baab
Merge branch 'master' into dev
actions-user Dec 7, 2022
b91874b
Merge branch 'master' into dev
actions-user Dec 9, 2022
9c92f0e
Merge branch 'master' into dev
actions-user Dec 10, 2022
1d32d2b
Merge branch 'master' into dev
actions-user Dec 12, 2022
8c25d7d
Merge branch 'master' into dev
actions-user Dec 12, 2022
222e6a6
Merge branch 'master' into dev
actions-user Dec 16, 2022
a8284e3
Bumped requirement package versions (#667)
rashidnhm Dec 19, 2022
ccfcf45
Merge dev in master following v0.28.0 release of PennyLane (#671) (#672)
rashidnhm Dec 21, 2022
808b1d8
Merge branch 'master' into dev
rashidnhm Dec 21, 2022
00a7c8c
Merge branch 'master' into dev
actions-user Jan 3, 2023
bf00d71
Merge branch 'master' into dev
actions-user Jan 4, 2023
cc47e89
Merge branch 'master' into dev
actions-user Jan 5, 2023
b3f7f3e
Merge branch 'master' into dev
actions-user Jan 5, 2023
9316a8f
Merge branch 'master' into dev
actions-user Jan 18, 2023
eb7a990
Merge branch 'master' into dev
actions-user Jan 20, 2023
595b898
Merge branch 'master' into dev
actions-user Jan 23, 2023
03ee056
Merge branch 'master' into dev
actions-user Jan 23, 2023
13fce68
add demo, v0.1
dwierichs Jan 26, 2023
6cfaa34
update demo with shots optimization
dwierichs Jan 27, 2023
76d7343
Merge branch 'master' into dev
actions-user Jan 30, 2023
ea82b2f
improvements to text, remove notes, draw circuit.
dwierichs Jan 31, 2023
303ea0b
black
dwierichs Jan 31, 2023
254788c
remove qml.optimize dependency
dwierichs Feb 2, 2023
f5572bc
Merge branch 'dev' into specialunitary
dwierichs Feb 2, 2023
8bf87ae
Merge branch 'specialunitary' of github.com:PennyLaneAI/qml into spec…
dwierichs Feb 2, 2023
5281bd8
Merge branch 'master' into dev
actions-user Feb 3, 2023
dadd39c
Merge branch 'master' into dev
actions-user Feb 3, 2023
a8ab874
Merge branch 'master' into dev
actions-user Feb 6, 2023
b39a0e7
Merge branch 'master' into dev
actions-user Feb 6, 2023
4f65f43
Merge branch 'master' into dev
actions-user Feb 10, 2023
3e79212
Merge branch 'dev' into specialunitary
dwierichs Feb 14, 2023
673e059
Merge branch 'master' into dev
actions-user Feb 14, 2023
bb9f4ac
update, improve code
dwierichs Feb 17, 2023
34b6c43
Merge branch 'master' into dev
actions-user Feb 21, 2023
3b40e58
Merge branch 'master' into dev
actions-user Feb 21, 2023
8356cca
Update chemical reactions demo to use pyscf for openshell H3 (#704)
soranjh Feb 21, 2023
10d6d86
Change ibm device in Quantum volume (#703)
rmoyard Feb 22, 2023
ab34e2a
Update demos to remove warnings (#705)
mudit2812 Feb 22, 2023
382178e
tmp
dwierichs Feb 22, 2023
e8811cd
Update classical shadows (#708)
rmoyard Feb 23, 2023
942cbb5
Update SPSA demo to count circuit executions manually. (#706)
dwierichs Feb 24, 2023
c2bcccb
Merge branch 'master' into dev
actions-user Feb 24, 2023
871ebdf
Merge branch 'master' into specialunitary
dwierichs Feb 28, 2023
6d02ffc
large update, include gradient evaluation discussion
dwierichs Feb 28, 2023
7503880
some jax
dwierichs Feb 28, 2023
a03ad6a
add paper plot
dwierichs Feb 28, 2023
0de243d
images
dwierichs Feb 28, 2023
6ba1e3c
black
dwierichs Feb 28, 2023
52b3c2c
tmp
dwierichs Feb 28, 2023
0143e1c
Merge branch 'master' into specialunitary
dwierichs Feb 28, 2023
62295af
Merge branch 'master' into dev
actions-user Feb 28, 2023
0ce4eb7
add thumbnail
dwierichs Feb 28, 2023
17acc47
change to png
dwierichs Feb 28, 2023
0343d5c
black
dwierichs Feb 28, 2023
f216273
uncomment. improve line breaks/naming
dwierichs Feb 28, 2023
05f6b34
hist colors
dwierichs Feb 28, 2023
05fa39a
Merge branch 'dev' into specialunitary
dwierichs Feb 28, 2023
28f1485
update figure and size
dwierichs Feb 28, 2023
9ab2e40
Merge branch 'specialunitary' of github.com:PennyLaneAI/qml into spec…
dwierichs Feb 28, 2023
6575070
colors, text
dwierichs Mar 1, 2023
4c4f716
formulation around sampled_grad plot
dwierichs Mar 1, 2023
ec6a663
new image
dwierichs Mar 1, 2023
7813ca0
png
dwierichs Mar 1, 2023
b45a4d8
Merge branch 'master' into specialunitary
dwierichs Mar 1, 2023
e4e4778
links
dwierichs Mar 2, 2023
45ec77e
Merge branch 'specialunitary' of github.com:PennyLaneAI/qml into spec…
dwierichs Mar 7, 2023
e0c7c57
cosmetics
dwierichs Mar 7, 2023
4b26543
cosmetics
dwierichs Mar 7, 2023
9d92588
Merge branch 'master' into specialunitary
dwierichs Mar 7, 2023
ef02bb6
Merge branch 'master' into specialunitary
dwierichs Mar 9, 2023
5c4950c
new figures
dwierichs Mar 9, 2023
1e0c2e2
Merge branch 'specialunitary' of github.com:PennyLaneAI/qml into spec…
dwierichs Mar 9, 2023
1f0e690
increase embedded image sizes
dwierichs Mar 9, 2023
f164edf
update intro
dwierichs Mar 9, 2023
33aefdd
optimization curve image
dwierichs Mar 9, 2023
e4939fa
review
dwierichs Mar 13, 2023
700e5ab
Apply suggestions from code review
dwierichs Mar 13, 2023
3a04599
Merge branch 'specialunitary' of github.com:PennyLaneAI/qml into spec…
dwierichs Mar 13, 2023
c8fd1e0
debugging, intro teaser
dwierichs Mar 13, 2023
398a2c5
Apply suggestions from code review
dwierichs Mar 15, 2023
68c47fa
review
dwierichs Mar 15, 2023
2cd3286
Merge branch 'specialunitary' of github.com:PennyLaneAI/qml into spec…
dwierichs Mar 15, 2023
116abbd
Merge branch 'master' into specialunitary
dwierichs Mar 15, 2023
7008c49
new thumbnail
dwierichs Mar 16, 2023
4ab6f5e
Apply suggestions from code review
dwierichs Mar 17, 2023
8109082
finalizing review
dwierichs Mar 17, 2023
520f855
whitespace
dwierichs Mar 17, 2023
9e48110
Merge branch 'master' into specialunitary
co9olguy Mar 29, 2023
cc75743
update date to 30th, incl preprint number, add reference in intro
dwierichs Mar 30, 2023
3283e28
change date to 3rd of April
dwierichs Mar 30, 2023
e0d89b4
fix links
dwierichs Mar 30, 2023
f265e9a
merge
dwierichs Apr 18, 2023
1d1b132
bm macro
dwierichs Apr 18, 2023
d219787
remove duplicate gallery entry
dwierichs Apr 18, 2023
f863b88
Merge branch 'master' into specialunitary
KetpuntoG Apr 19, 2023
2b5b52a
Merge branch 'master' into specialunitary
KetpuntoG Apr 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions demonstrations/tutorial_here_comes_the_sun.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@

.. math::

U(\bm{\theta}) = \exp\left\{\sum_{m=1}^d \theta_m G_m \right\}.
U(\boldsymbol{\theta}) = \exp\left\{\sum_{m=1}^d \theta_m G_m \right\}.

The number of coordinates and Pauli words in :math:`\mathcal{P}^{(n)}` is :math:`d=4^n-1`.
Therefore, this will be the number of parameters that a single ``qml.SpecialUnitary`` gate acting on
Expand All @@ -146,7 +146,7 @@
For unitaries generated by a single operator, i.e. of the form :math:`\exp(i\theta G)`,
there is a plethora of differentiation techniques that allow us to compute its derivative.
However, a standard parameter-shift rule, for example, will not do the job if there are
non-commuting terms :math:`G_m` in the multi-parameter gate :math:`U(\bm{\theta})` above.
non-commuting terms :math:`G_m` in the multi-parameter gate :math:`U(\boldsymbol{\theta})` above.
So how *do* we compute the derivative?

Obtaining the gradient
Expand Down Expand Up @@ -191,11 +191,11 @@

.. math::

\partial_{\text{FD},\theta_j}C(\bm{\theta})
=\left[C\left(\bm{\theta}+\frac{\delta}{2}\bm{e}_j\right)
-C\left(\bm{\theta}-\frac{\delta}{2}\bm{e}_j\right)\right] / \delta.
\partial_{\text{FD},\theta_j}C(\boldsymbol{\theta})
=\left[C\left(\boldsymbol{\theta}+\frac{\delta}{2}\boldsymbol{e}_j\right)
-C\left(\boldsymbol{\theta}-\frac{\delta}{2}\boldsymbol{e}_j\right)\right] / \delta.

Here, :math:`\delta` is a shift parameter that we need to choose and :math:`\bm{e}_j` is the
Here, :math:`\delta` is a shift parameter that we need to choose and :math:`\boldsymbol{e}_j` is the
:math:`j`-th canonical basis vector, i.e. the all-zeros vector with a one in the
:math:`j`-th entry. This approach is agnostic to the differentiated function and does
not exploit its structure.
Expand Down Expand Up @@ -265,7 +265,7 @@ def central_diff_grad(theta, delta):
# so in full generality, but for the particular circuit in this example. We will
# sample ten splitting times to obtain the gradient entry. For each splitting time,
# we need to insert a Pauli-:math:`Y` rotation because :math:`\theta_2` belongs to
# the Pauli-:math:`Y` component of :math:`A(\bm{\theta})`. For this, we define
# the Pauli-:math:`Y` component of :math:`A(\boldsymbol{\theta})`. For this, we define
# an auxiliary circuit.


Expand Down Expand Up @@ -350,7 +350,7 @@ def stochastic_parshift_grad(theta, num_samples):
# three differentiation methods? We will not go into detail here, but refer
# to [#wiersema]_ to see how the custom differentiation rule proposed in the
# main text leads to the lowest mean squared error. For a single-qubit circuit
# similar to the one above, but with the single gate :math:`U(\bm{\theta})=\exp(iaX+ibY)`,
# similar to the one above, but with the single gate :math:`U(\boldsymbol{\theta})=\exp(iaX+ibY)`,
# the derivative and its expected variance are shown in the following
# (recoloured) plot from the manuscript:
#
Expand Down