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

[SVG] Noise hack and font fix #3076

Merged
merged 7 commits into from
Jun 9, 2020
Merged

Conversation

mpharrigan
Copy link
Collaborator

  • Specify the font. This should not be a change for viewing in Jupyter notebook but fixes opening the svg data in e.g. inkscape where the default font is different and the boxes aren't the right size
  • Don't display virtual tags (for noise) xref Tagging noise operations clutters the circuit output #2905

@googlebot googlebot added the cla: yes Makes googlebot stop complaining. label Jun 5, 2020
def fixup_text(text: str):
if '\n' in text:
return '?'
if '[<virtual>]' in text:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems awfully specific.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can wait for #2984 (comment) and then it will be unnecessary but I'm using this patch currently

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is contrib, so I'd just make sure we have an issue to fix this before moving to cirq, and maybe a link from that issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's a comment linking to the issue; I'll put a backref on the issue itself

def fixup_text(text: str):
if '\n' in text:
return '?'
if '[<virtual>]' in text:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is contrib, so I'd just make sure we have an issue to fix this before moving to cirq, and maybe a link from that issue.

@mpharrigan mpharrigan added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jun 9, 2020
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jun 9, 2020
@CirqBot
Copy link
Collaborator

CirqBot commented Jun 9, 2020

Automerge cancelled: A status check is failing.

@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Jun 9, 2020
@mpharrigan mpharrigan added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jun 9, 2020
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jun 9, 2020
@CirqBot CirqBot merged commit 20fb717 into quantumlib:master Jun 9, 2020
@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Jun 9, 2020
@mpharrigan mpharrigan deleted the 2020-06-svg branch June 10, 2020 14:55
MichaelBroughton added a commit that referenced this pull request Jun 12, 2020
* [SVG] Noise hack and font fix (#3076)


 - Specify the font. This should not be a change for viewing in Jupyter notebook but fixes opening the svg data in e.g. inkscape where the default font is different and the boxes aren't the right size
 - Don't display virtual tags (for noise) xref #2905

* Support multi-qubit measurement in plot_state_histogram (#3054)

* Add generated code for batch.proto (#3086)

Review: @dstrain115

* Fix flakes in random_circuit_test (#3084)

* Added api docs gen (copy from TFQ).

* updated site_path prefix.

* removed pre-built.

* rename.

* move to dev_tools.

* removed __future__ and formatting.

* yet more formatting.

Co-authored-by: Matthew Harrigan <[email protected]>
Co-authored-by: Animesh Sinha <[email protected]>
Co-authored-by: Matthew Neeley <[email protected]>
Co-authored-by: Dave Bacon <[email protected]>
MichaelBroughton added a commit that referenced this pull request Jun 12, 2020
* [SVG] Noise hack and font fix (#3076)


 - Specify the font. This should not be a change for viewing in Jupyter notebook but fixes opening the svg data in e.g. inkscape where the default font is different and the boxes aren't the right size
 - Don't display virtual tags (for noise) xref #2905

* Support multi-qubit measurement in plot_state_histogram (#3054)

* Add generated code for batch.proto (#3086)

Review: @dstrain115

* Fix flakes in random_circuit_test (#3084)

* Fix Quirk import extra gates bug

* Move image files to docs/images/

* Move unneeded site assets

* Move Sphinx templates, Makefile, conf, and init

* Added api docs gen (copy from TFQ). (#3089)

* [SVG] Noise hack and font fix (#3076)


 - Specify the font. This should not be a change for viewing in Jupyter notebook but fixes opening the svg data in e.g. inkscape where the default font is different and the boxes aren't the right size
 - Don't display virtual tags (for noise) xref #2905

* Support multi-qubit measurement in plot_state_histogram (#3054)

* Add generated code for batch.proto (#3086)

Review: @dstrain115

* Fix flakes in random_circuit_test (#3084)

* Added api docs gen (copy from TFQ).

* updated site_path prefix.

* removed pre-built.

* rename.

* move to dev_tools.

* removed __future__ and formatting.

* yet more formatting.

Co-authored-by: Matthew Harrigan <[email protected]>
Co-authored-by: Animesh Sinha <[email protected]>
Co-authored-by: Matthew Neeley <[email protected]>
Co-authored-by: Dave Bacon <[email protected]>

* Move doc tools to /dev_tools/docs/

* Move examples index into tutorials/

* Move basics tutorial into tutorials/

* Encode URL bracket so not mistaken for template.

* Update references to moves docs and image files.

* Update references to docs_coverage_test.py

* Format py with check/format-incremental --apply

* Move Sphinx RST files

* Add _index.yaml for site

* Add initial _book.yaml for leftnav

* Manually format docs/_sphinx/conf.py for CI

* Update references to moved api.rst file

* Move docs/_sphinx to dev_tools/docs/sphinx

* Update README.rst path for snippets_test.py

* Move run_doctest to dev_tools/docs/

* Move build-docs.sh to dev_tools/docs/sphinx/

* Update references to build-docs.sh

* Remove build_docs CI test

Co-authored-by: Matthew Harrigan <[email protected]>
Co-authored-by: Animesh Sinha <[email protected]>
Co-authored-by: Matthew Neeley <[email protected]>
Co-authored-by: Dave Bacon <[email protected]>
Co-authored-by: Matteo Pompili <[email protected]>
Co-authored-by: MichaelBroughton <[email protected]>
balopat pushed a commit to balopat/Cirq that referenced this pull request Aug 18, 2020
* [SVG] Noise hack and font fix (quantumlib#3076)

 - Specify the font. This should not be a change for viewing in Jupyter notebook but fixes opening the svg data in e.g. inkscape where the default font is different and the boxes aren't the right size
 - Don't display virtual tags (for noise) xref quantumlib#2905

* Support multi-qubit measurement in plot_state_histogram (quantumlib#3054)

* Add generated code for batch.proto (quantumlib#3086)

Review: @dstrain115

* Fix flakes in random_circuit_test (quantumlib#3084)

* Added api docs gen (copy from TFQ).

* updated site_path prefix.

* removed pre-built.

* rename.

* move to dev_tools.

* removed __future__ and formatting.

* yet more formatting.

Co-authored-by: Matthew Harrigan <[email protected]>
Co-authored-by: Animesh Sinha <[email protected]>
Co-authored-by: Matthew Neeley <[email protected]>
Co-authored-by: Dave Bacon <[email protected]>
balopat pushed a commit to balopat/Cirq that referenced this pull request Aug 18, 2020
* [SVG] Noise hack and font fix (quantumlib#3076)

 - Specify the font. This should not be a change for viewing in Jupyter notebook but fixes opening the svg data in e.g. inkscape where the default font is different and the boxes aren't the right size
 - Don't display virtual tags (for noise) xref quantumlib#2905

* Support multi-qubit measurement in plot_state_histogram (quantumlib#3054)

* Add generated code for batch.proto (quantumlib#3086)

Review: @dstrain115

* Fix flakes in random_circuit_test (quantumlib#3084)

* Fix Quirk import extra gates bug

* Move image files to docs/images/

* Move unneeded site assets

* Move Sphinx templates, Makefile, conf, and init

* Added api docs gen (copy from TFQ). (quantumlib#3089)

* [SVG] Noise hack and font fix (quantumlib#3076)

 - Specify the font. This should not be a change for viewing in Jupyter notebook but fixes opening the svg data in e.g. inkscape where the default font is different and the boxes aren't the right size
 - Don't display virtual tags (for noise) xref quantumlib#2905

* Support multi-qubit measurement in plot_state_histogram (quantumlib#3054)

* Add generated code for batch.proto (quantumlib#3086)

Review: @dstrain115

* Fix flakes in random_circuit_test (quantumlib#3084)

* Added api docs gen (copy from TFQ).

* updated site_path prefix.

* removed pre-built.

* rename.

* move to dev_tools.

* removed __future__ and formatting.

* yet more formatting.

Co-authored-by: Matthew Harrigan <[email protected]>
Co-authored-by: Animesh Sinha <[email protected]>
Co-authored-by: Matthew Neeley <[email protected]>
Co-authored-by: Dave Bacon <[email protected]>

* Move doc tools to /dev_tools/docs/

* Move examples index into tutorials/

* Move basics tutorial into tutorials/

* Encode URL bracket so not mistaken for template.

* Update references to moves docs and image files.

* Update references to docs_coverage_test.py

* Format py with check/format-incremental --apply

* Move Sphinx RST files

* Add _index.yaml for site

* Add initial _book.yaml for leftnav

* Manually format docs/_sphinx/conf.py for CI

* Update references to moved api.rst file

* Move docs/_sphinx to dev_tools/docs/sphinx

* Update README.rst path for snippets_test.py

* Move run_doctest to dev_tools/docs/

* Move build-docs.sh to dev_tools/docs/sphinx/

* Update references to build-docs.sh

* Remove build_docs CI test

Co-authored-by: Matthew Harrigan <[email protected]>
Co-authored-by: Animesh Sinha <[email protected]>
Co-authored-by: Matthew Neeley <[email protected]>
Co-authored-by: Dave Bacon <[email protected]>
Co-authored-by: Matteo Pompili <[email protected]>
Co-authored-by: MichaelBroughton <[email protected]>
tonybruguier pushed a commit to tonybruguier/Cirq that referenced this pull request Aug 23, 2020
 - Specify the font. This should not be a change for viewing in Jupyter notebook but fixes opening the svg data in e.g. inkscape where the default font is different and the boxes aren't the right size
 - Don't display virtual tags (for noise) xref quantumlib#2905
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Makes googlebot stop complaining.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants