Week#9

gsoc
qutip
code
week#9
Author

Rushiraj Gadhvi

Published

July 25, 2024

This week, the TextRenderer module was developed to render both single-qubit and multi-qubit gates. Additionally, three new color themes were added to MatRenderer, and user customization input was improved by converting the style dictionary to a StyleConfig dataclass for better organization. And bug fixes.

This Week

  1. Implementation of TextRenderer

    This week, primary focus has been on building the TextRenderer module. The module now successfully renders both single-qubit and multi-qubit gates. At the moment, the TextRenderer operates independently, but next step it will be integrating it with the Base-Class Renderer.

    The rendering format follows a layer-by-layer approach. As we process each gate, we aim to place them as close to each other as possible while maintaining a clear layer structure. This method ensures that the rendered output is easy to understand. This is also the same methodology that was used in MatRenderer.

    The rendered gates are stored as a list of strings, divided into three parts: top, middle, and bottom. Each part represents a different section of the gate, making it easier to manage.

    {
        top: [render str for the top of the 1st wire, 2nd wire, 3rd wire ...],
        mid: [render str for the middle of the 1st wire, 2nd wire, 3rd wire ...],
        bot: [render str for the bottom of the 1st wire, 2nd wire, 3rd wire ...],
    }
  • MultiQubit Gate Rendering

As shown in the figure below, if a gate spans qubits that have not been used as targets or controls, it does not render connections to those wires.

  • SingleQubit Gate Rendering

  1. Addition of new color-theme

    Included three new color themes to MatRenderer:

    • Light

    • Dark

    • Modern

  2. Implemented Dataclass for MatRenderer

    Last week, to handle user customization input style dictionary was implemented, which was converted to a StyleConfig dataclass. This change made our code cleaner and more organized by effectively separating customization parameters from constants.

  3. Bugfix

    Fixed, the bug spotted by Neill during rendring trotter-simulation-circuit.

Plan for Next Week

  • Make Progress with TextRenderer, specilly fix control / target node rendering
  • Add more gates: CNOT, SWAP, TOFFOLI
  • Implement suggested chabges in MatRenderer PR