quantumlib / Cirq

A Python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
Apache License 2.0
4.23k stars 1.01k forks source link

Circuit._repr_svg_ with nice diagrams for ipython #2313

Open mpharrigan opened 4 years ago

mpharrigan commented 4 years ago

https://ipython.readthedocs.io/en/stable/config/integrating.html#rich-display

Also see https://github.com/perak/quantum-circuit for a MIT licensed package that makes nice SVG circuits

mpharrigan commented 4 years ago

Partially done in #2323

I'm not going to work on it any more. Someone could pick this up and address the following things

mpharrigan commented 4 years ago
mpharrigan commented 4 years ago
vanhalen42 commented 2 years ago

Hey @mpharrigan, I am right now working on the following issues of #4499.

For this, I changed the int to float and it still worked fine for me. What specific bug were you facing while using non-integer coordinates?

https://github.com/vanhalen42/Cirq/blob/baa4310b7dddd8603f530771ee63e37701cf859b/cirq-core/cirq/contrib/svg/svg.py#L189-L217

https://github.com/vanhalen42/Cirq/blob/baa4310b7dddd8603f530771ee63e37701cf859b/cirq-core/cirq/contrib/svg/svg.py#L166-L171

I see that currently, the implementation has hard-coded values. Do you have any idea how we could make this dynamically space the lines based on the user's dimensions? May I know what exactly do you prefer for the second task listed?

westurner commented 1 year ago

See also: