Skip to content

Commit

Permalink
feature: update circuit drawing (#846)
Browse files Browse the repository at this point in the history
* replace control symbols

* use box drawing characters

* fix tests

* switch to large b/w circle

* first attempt to box symbols

* fix single qubit circuit

* rewrite first tests

* first try to draw verbatim box

* revamp verbatim box

* update tests and skip outdated

* modify last test

* fix connections

* fix linter

* update more tests

* update verbatix box tests

* update last tests, left 6 xfail

* remove margin

* add connecting edges

* code coverage

* finish code coverage

* decomplexify

* add xfail test

* move AsciiDiagram to BoxDrawingDiagram

* keep ascii diagrams as legacy

* add default_diagram_builder field

* replace back circles by C/N

* remove duplicate code

* more simplification

* add comment

* add back build_diagram for readibilty

* use a _build_box method

* simplify _build_parameters

* remove unnecessary code

* mutualize create_output

* add another xfail test

* fix linters

* fix misalignment

* fix linters

* cleanup

* make _fill_symbol private

* clean an branching condition

* draw swap gates with x

* remove commented tests

* clean implementation

* keep AsciiCircuitDiagram as default for now

* reorganize class structure

* fix docstring

* make class-specific method explicit

* fix linters

* fix typos

* remove forgotten argument

* use a utilities class

* do not use a TextCircuitDiagramUtilities

* rename methods

* rename to text_circuit_diagram_utils

* use cls var

* first changes according to PR feedback

* Attempt at simplification (#898)

* add docstrings and rename box_drawing_circuit_diagram after merge

* standardize type hints of _draw_symbol

* small changes according to PR feedback.

* change a staticmethod to a classmethod

---------

Co-authored-by: Cody Wang <speller26@gmail.com>
Co-authored-by: Milan <30416311+krneta@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 6, 2024
1 parent b4245ea commit c49176b
Show file tree
Hide file tree
Showing 10 changed files with 1,981 additions and 408 deletions.
7 changes: 6 additions & 1 deletion src/braket/circuits/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
result_types,
)
from braket.circuits.angled_gate import AngledGate, DoubleAngledGate # noqa: F401
from braket.circuits.ascii_circuit_diagram import AsciiCircuitDiagram # noqa: F401
from braket.circuits.circuit import Circuit # noqa: F401
from braket.circuits.circuit_diagram import CircuitDiagram # noqa: F401
from braket.circuits.compiler_directive import CompilerDirective # noqa: F401
Expand All @@ -38,3 +37,9 @@
from braket.circuits.qubit import Qubit, QubitInput # noqa: F401
from braket.circuits.qubit_set import QubitSet, QubitSetInput # noqa: F401
from braket.circuits.result_type import ObservableResultType, ResultType # noqa: F401
from braket.circuits.text_diagram_builders.ascii_circuit_diagram import ( # noqa: F401
AsciiCircuitDiagram,
)
from braket.circuits.text_diagram_builders.unicode_circuit_diagram import ( # noqa: F401
UnicodeCircuitDiagram,
)
Loading

0 comments on commit c49176b

Please sign in to comment.