What did I do this week?
- Bugs fix in MatRenderer
Resolved some of the bugs present inMatRenderer
, specifically theconnection indicators
where not getting rendered properly when bulging of gates was set to zero.
- Exploration for TextRenderer
Another significant area of my work involved the exploration ofTextRenderer
. This phase included experimenting with various approaches to establish an efficient workflow. A critical part of this process was the manual selection and finalization of a specific set of ASCII characters. These characters are integral for accurately representing circuit elements in text form. Drawing inspiration from methodologies used in libraries like Qiskit, I gained valuable insights into optimizing text-based rendering for circuit diagrams.
For reference, here are some of the ASCII codes and corresponding symbols selected for rendering purposes:
ASCII Code | Symbol |
---|---|
179 | │ |
180 | ┤ |
191 | ┐ |
192 | └ |
193 | ┬ |
194 | ┴ |
195 | ├ |
196 | ─ |
ASCII Code | Symbol |
---|---|
217 | ┘ |
218 | ┌ |
186 | ║ |
187 | ╗ |
188 | ╝ |
200 | ╚ |
201 | ╔ |
202 | ╦ |
ASCII Code | Symbol |
---|---|
203 | ╩ |
204 | ╠ |
205 | ═ |
206 | ╣ |
185 | ╛ |
45 | - |
88 | X |
254 | █ |
Example of Rendering Style To visualize the rendering style, below are examples of circuit diagrams rendered using our current approach:
- Finalised on WorkFlow for TextRenderer
As for the finalized workflow, for easy maintainance of code in future. A method to somehow utilizeMatRenderer
’s funciton for theTextRenderer
would be the optimum solution. This can be achieved by trying to replicate the layer by layer rendering process that was used inMatRenderer
, but this would need further verififcation (plenty of edge cases are a possibility here). The main issue with this isMatRenderer
usesmatplotlib
’s feature to renderer objects onto different layers which is not possible in the case of ordered string rendering.
Points Discussed in Meet
- Finalization of the API structure to streamline functionality.
- Workflow for Text Renderer, including the idea to create a seperate Base Class for
MatRenderer
andTextRenderer
. - We can improve the
extend_lines()
funtion inMatRenderer
Plan for Next Week
Looking ahead, the following tasks are prioritized for the upcoming week:
- Clean the code, and move latex plotting out of
circuit.py
- Transferring LaTeX plotting functionalities out of
circuit.py
for improved code organization. - Continuing the implementation and refinement of the text rendering capabilities.