From ea38c9de014fa8d33e5d9803d72f0b7509654b65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivana=20Kure=C4=8Di=C4=87?= Date: Thu, 31 Aug 2023 21:49:44 +0200 Subject: [PATCH 1/9] black labels --- pennylane/drawer/plot.mplstyle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pennylane/drawer/plot.mplstyle b/pennylane/drawer/plot.mplstyle index 858551a30cf..bc3070b67f2 100644 --- a/pennylane/drawer/plot.mplstyle +++ b/pennylane/drawer/plot.mplstyle @@ -11,7 +11,7 @@ axes.edgecolor: BCBABA axes.linewidth: 1 axes.grid: True axes.titlesize: x-large -axes.labelcolor: BCBABA +axes.labelcolor: black xtick.color: black xtick.direction: out From 8188dc42ff418778ca499776067ce728a8914719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivana=20Kure=C4=8Di=C4=87?= Date: Thu, 7 Sep 2023 17:17:54 +0200 Subject: [PATCH 2/9] dpi to 300 --- pennylane/drawer/plot.mplstyle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pennylane/drawer/plot.mplstyle b/pennylane/drawer/plot.mplstyle index bc3070b67f2..90e15fe270c 100644 --- a/pennylane/drawer/plot.mplstyle +++ b/pennylane/drawer/plot.mplstyle @@ -22,4 +22,6 @@ grid.color: F0EEEF grid.linestyle: : font.sans-serif: Quicksand, DejaVu Sans, Bitstream Vera Sans, Computer Modern Sans Serif, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif -font.weight: bold \ No newline at end of file +font.weight: bold + +figure.dpi: 300 \ No newline at end of file From e790c950a9ee295c22fdc870171d4dcc9b0fdbe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivana=20Kure=C4=8Di=C4=87?= Date: Wed, 13 Sep 2023 15:46:19 +0200 Subject: [PATCH 3/9] added font-related instructions to docs --- debug.log | 1 + doc/code/qml_drawer.rst | 5 +++++ pennylane/drawer/plot.mplstyle | 1 + 3 files changed, 7 insertions(+) create mode 100644 debug.log diff --git a/debug.log b/debug.log new file mode 100644 index 00000000000..e4f4268a523 --- /dev/null +++ b/debug.log @@ -0,0 +1 @@ +[0913/101931.146:ERROR:registration_protocol_win.cc(107)] CreateFile: Das System kann die angegebene Datei nicht finden. (0x2) diff --git a/doc/code/qml_drawer.rst b/doc/code/qml_drawer.rst index e280537e80e..76e38e665c8 100644 --- a/doc/code/qml_drawer.rst +++ b/doc/code/qml_drawer.rst @@ -42,6 +42,11 @@ The following images are generated via the code: qml.drawer.use_style(style) fig, ax = qml.draw_mpl(circuit)(1.2345, 1.2345) +Note that the shown ``pennylane`` style can be replicated exactly by having the +Quicksand Bold font installed and refreshing the Matplotlib font cache (by +deleting the fontlist file in ``.matplotlib``). If this font is not available, +the drawer will fall back on a default font. + Currently Available Styles ^^^^^^^^^^^^^^^^^^^^^^^^^^ .. |bws| image:: ../_static/style/black_white_style.png diff --git a/pennylane/drawer/plot.mplstyle b/pennylane/drawer/plot.mplstyle index 90e15fe270c..4e2e5a352f5 100644 --- a/pennylane/drawer/plot.mplstyle +++ b/pennylane/drawer/plot.mplstyle @@ -1,4 +1,5 @@ # PennyLane plot palette +# To use the Quicksand Bold font, first install it and then refresh the Matplotlib font cache (delete the fontlist file in .matplotlib) axes.prop_cycle: cycler('color', ['70CEFF', 'FF87EB', 'FFE096', 'D7A2F6', 'FDC9DE', 'E1EBA8', 'C6FDD9', 'B5F2ED']) patch.linewidth: 0.5 From dc946622a2babdd3ae753a588980cec8bfe2a824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivana=20Kure=C4=8Di=C4=87?= Date: Wed, 13 Sep 2023 16:52:25 +0200 Subject: [PATCH 4/9] cache dir --- doc/code/qml_drawer.rst | 5 +++-- pennylane/drawer/plot.mplstyle | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/code/qml_drawer.rst b/doc/code/qml_drawer.rst index 76e38e665c8..adb5569d5f2 100644 --- a/doc/code/qml_drawer.rst +++ b/doc/code/qml_drawer.rst @@ -44,8 +44,9 @@ The following images are generated via the code: Note that the shown ``pennylane`` style can be replicated exactly by having the Quicksand Bold font installed and refreshing the Matplotlib font cache (by -deleting the fontlist file in ``.matplotlib``). If this font is not available, -the drawer will fall back on a default font. +deleting the fontlist file in the Matplotlib cache directory) — to find the +cache directory, run ``matplotlib.get_cachedir()``. If this font is not +available, the drawer will fall back on a default font. Currently Available Styles ^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/pennylane/drawer/plot.mplstyle b/pennylane/drawer/plot.mplstyle index 4e2e5a352f5..4902a4e6ad7 100644 --- a/pennylane/drawer/plot.mplstyle +++ b/pennylane/drawer/plot.mplstyle @@ -1,5 +1,5 @@ # PennyLane plot palette -# To use the Quicksand Bold font, first install it and then refresh the Matplotlib font cache (delete the fontlist file in .matplotlib) +# To use the Quicksand Bold font, first install it and then refresh the Matplotlib font cache (delete the fontlist file in the cache directory). To find the cache directory location, run matplotlib.get_cachedir() axes.prop_cycle: cycler('color', ['70CEFF', 'FF87EB', 'FFE096', 'D7A2F6', 'FDC9DE', 'E1EBA8', 'C6FDD9', 'B5F2ED']) patch.linewidth: 0.5 From ef98a293264e76c67428366ff44bbcf478f560bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivana=20Kure=C4=8Di=C4=87?= Date: Wed, 18 Oct 2023 13:24:39 +0200 Subject: [PATCH 5/9] added log [skip ci] --- doc/releases/changelog-dev.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/releases/changelog-dev.md b/doc/releases/changelog-dev.md index b904b6e4aa8..409085813ba 100644 --- a/doc/releases/changelog-dev.md +++ b/doc/releases/changelog-dev.md @@ -217,6 +217,8 @@ of the computed qubit operator, if imaginary components are smaller than a threshold. [(#4639)](https://github.com/PennyLaneAI/pennylane/pull/4639) +* Plots generated with the `pennylane.drawer.plot` style of `matplotlib.pyplot` now have black axis labels and are generated at a default DPI of 300. Documentation for the use of the `pennylane` style of `qml.drawer` and the `pennylane.drawer.plot` style of `matplotlib.pyplot` has also been improved. [(#4690)](https://github.com/PennyLaneAI/pennylane/pull/4690) +

Breaking changes 💔

From fced89ca179cd73b0cfb660bfc65aa98445a7b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivana=20Kure=C4=8Di=C4=87?= Date: Wed, 18 Oct 2023 14:02:20 +0200 Subject: [PATCH 6/9] log edit [skip ci] --- doc/releases/changelog-dev.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/doc/releases/changelog-dev.md b/doc/releases/changelog-dev.md index 409085813ba..6ac464fb63f 100644 --- a/doc/releases/changelog-dev.md +++ b/doc/releases/changelog-dev.md @@ -217,7 +217,9 @@ of the computed qubit operator, if imaginary components are smaller than a threshold. [(#4639)](https://github.com/PennyLaneAI/pennylane/pull/4639) -* Plots generated with the `pennylane.drawer.plot` style of `matplotlib.pyplot` now have black axis labels and are generated at a default DPI of 300. Documentation for the use of the `pennylane` style of `qml.drawer` and the `pennylane.drawer.plot` style of `matplotlib.pyplot` has also been improved. [(#4690)](https://github.com/PennyLaneAI/pennylane/pull/4690) +* Plots generated with the `pennylane.drawer.plot` style of `matplotlib.pyplot` now have black + axis labels and are generated at a default DPI of 300. + [(#4690)](https://github.com/PennyLaneAI/pennylane/pull/4690)

Breaking changes 💔

@@ -361,7 +363,13 @@ Note that these functions are unstable while device upgrades are underway. [(#4555)](https://github.com/PennyLaneAI/pennylane/pull/4555) -* Minor documentation improvement to the usage example in the `qml.QuantumMonteCarlo` page. Integral was missing the differential dx with respect to which the integration is being performed. [(#4593)](https://github.com/PennyLaneAI/pennylane/pull/4593) +* Minor documentation improvement to the usage example in the `qml.QuantumMonteCarlo` page. + Integral was missing the differential dx with respect to which the integration is being performed. + [(#4593)](https://github.com/PennyLaneAI/pennylane/pull/4593) + +* Minor documentation improvement for the use of the `pennylane` style of `qml.drawer` and the + `pennylane.drawer.plot` style of `matplotlib.pyplot`. The use of the default font was clarified. + [(#4690)](https://github.com/PennyLaneAI/pennylane/pull/4690)

Bug fixes 🐛

@@ -404,7 +412,8 @@ Stepan Fomichev, Joana Fraxanet, Diego Guala, Soran Jahangiri, -Korbinian Kottmann +Korbinian Kottmann, +Ivana Kurecic, Christina Lee, Lillian M. A. Frederiksen, Vincent Michaud-Rioux, From 101c5d9bee14bca99d60197bfca3f296b2d50558 Mon Sep 17 00:00:00 2001 From: Ivana Kurecic Date: Wed, 18 Oct 2023 14:37:55 +0200 Subject: [PATCH 7/9] as suggested Co-authored-by: Korbinian Kottmann <43949391+Qottmann@users.noreply.github.com> --- doc/code/qml_drawer.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/code/qml_drawer.rst b/doc/code/qml_drawer.rst index adb5569d5f2..034aead8c87 100644 --- a/doc/code/qml_drawer.rst +++ b/doc/code/qml_drawer.rst @@ -44,7 +44,7 @@ The following images are generated via the code: Note that the shown ``pennylane`` style can be replicated exactly by having the Quicksand Bold font installed and refreshing the Matplotlib font cache (by -deleting the fontlist file in the Matplotlib cache directory) — to find the +deleting the ``fontlist`` file in the Matplotlib cache directory) — to find the cache directory, run ``matplotlib.get_cachedir()``. If this font is not available, the drawer will fall back on a default font. From 5bcdf3907d7d1639b1900554796202ca5080b93c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivana=20Kure=C4=8Di=C4=87?= Date: Wed, 18 Oct 2023 21:15:29 +0200 Subject: [PATCH 8/9] explanation for style image gen --- debug.log | 1 - doc/code/qml_drawer.rst | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) delete mode 100644 debug.log diff --git a/debug.log b/debug.log deleted file mode 100644 index e4f4268a523..00000000000 --- a/debug.log +++ /dev/null @@ -1 +0,0 @@ -[0913/101931.146:ERROR:registration_protocol_win.cc(107)] CreateFile: Das System kann die angegebene Datei nicht finden. (0x2) diff --git a/doc/code/qml_drawer.rst b/doc/code/qml_drawer.rst index 034aead8c87..87b2c0f0a47 100644 --- a/doc/code/qml_drawer.rst +++ b/doc/code/qml_drawer.rst @@ -26,7 +26,9 @@ be reset with ``qml.drawer.use_style('black_white')``. available_styles use_style -The following images are generated via the code: +The following images are generated via the following code, where ``style`` is +replaced by an available style specification string (e.g., ``pennylane`` or +``solarized_light``): .. code-block:: python From 0787fd529dc494c1a88859b35b2f82a2809b8599 Mon Sep 17 00:00:00 2001 From: Ivana Kurecic Date: Thu, 19 Oct 2023 15:43:46 +0200 Subject: [PATCH 9/9] Update doc/code/qml_drawer.rst Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com> --- doc/code/qml_drawer.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/code/qml_drawer.rst b/doc/code/qml_drawer.rst index 87b2c0f0a47..9bf0e46c2e5 100644 --- a/doc/code/qml_drawer.rst +++ b/doc/code/qml_drawer.rst @@ -27,8 +27,8 @@ be reset with ``qml.drawer.use_style('black_white')``. use_style The following images are generated via the following code, where ``style`` is -replaced by an available style specification string (e.g., ``pennylane`` or -``solarized_light``): +replaced by an available style specification string (e.g., ``"pennylane"`` or +``"solarized_light"``): .. code-block:: python