pytket.circuit.display

Display a circuit as html.

pytket.circuit.display.render_circuit_as_html(circuit: Union[Dict[str, Union[str, float, dict]], pytket.circuit.Circuit], recursive: bool = False, condensed: bool = True, jupyter: bool = False) Optional[str]

Render a circuit as HTML for inline display.

Parameters
  • circuit – the circuit to render.

  • recursive – whether to display nested circuits as circuits themselves, or as generic boxes

  • condensed – whether to render the circuit on one line only (may require scrolling), or allow the circuit to wrap around onto multiple lines

  • jupyter – set to true to render generated HTML in cell output

pytket.circuit.display.render_circuit_jupyter(circuit: Union[Dict[str, Union[str, float, dict]], pytket.circuit.Circuit], recursive: bool = False, condensed: bool = True) None

Render a circuit as jupyter cell output.

Parameters
  • circuit – the circuit to render.

  • recursive – whether to display nested circuits as circuits themselves, or as generic boxes

  • condensed – whether to render the circuit on one line only (may require scrolling), or allow the circuit to wrap around onto multiple lines