Open albi3ro opened 2 years ago
Hello - I have a PR with a couple new styles added, but I am running into a couple errors when completing the PR checklist:
when running make docs
to verify the documentation has been updated, I get
no theme named 'xanadu' found (missing theme.conf?)
when running make test
, I get:
ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...]
__main__.py: error: unrecognized arguments: --no-flaky-report
Can you advise on what I need to do to fix these errors?
Hey @trentfridey! It sounds like missing dependencies; can you see if
pip install xanadu-sphinx-theme flaky
fixes it?
Thanks, that seemed to fix it
The PR is ready for review now
This is an ongoing issue where we always welcome more contributions.
Introduction and Motivation
PennyLane currently has multiple in-built styles for use with our matplotlib circuit drawer:
"default"
"black_white"
"black_white_dark"
"sketch"
"sketch_dark"
"solarized_light"
"solarized_dark"
"default"
See the documentation for these styles on the
qml.drawer
page. These styles work by setting matplotlib'srcParams
dictionary.We welcome contributors to submit new styles.
Each style should update the
plt.rcParams
configuration to make clean and readable circuit diagram graphics. Creating a new style is more about visual design than any coding.Code requirements
To add a new style:
pennylane/drawer/style.py
@_needs_mpl
_styles_map
dictionarytests/drawer/test_style.py
doc/_static/style/style_examples.py
to generate a png demonstrating the new styledoc/code/qml_drawer.rst
so that it also displays the new style in the "Currently Available Styles" section. Note that displaying images side-by-side with rst can be tricky.