qnet.printing.asciiprinter module

ASCII Printer

Summary

Classes:

QnetAsciiDefaultPrinter Printer for an ASCII representation that accepts no settings.
QnetAsciiPrinter Printer for a string (ASCII) representation.

Reference

class qnet.printing.asciiprinter.QnetAsciiPrinter(cache=None, settings=None)[source]

Bases: qnet.printing.base.QnetBasePrinter

Printer for a string (ASCII) representation.

Attributes:
  • _parenth_left (str) – String to use for a left parenthesis (e.g. ‘left(‘ in LaTeX). Used by _split_op()
  • _parenth_left (str) – String to use for a right parenthesis
  • _dagger_sym (str) – Symbol that indicates the complex conjugate of an operator. Used by _split_op()
  • _tensor_sym (str) – Symbol to use for tensor products. Used by _render_hs_label().
sympy_printer_cls

alias of qnet.printing.sympy.SympyStrPrinter

printmethod = '_ascii'
parenthesize(expr, level, *args, strict=False, **kwargs)[source]

Render expr and wrap the result in parentheses if the precedence of expr is below the given level (or at the given level if strict is True. Extra args and kwargs are passed to the internal doit renderer

class qnet.printing.asciiprinter.QnetAsciiDefaultPrinter[source]

Bases: qnet.printing.asciiprinter.QnetAsciiPrinter

Printer for an ASCII representation that accepts no settings. This can be used internally when a well-defined, static representation is needed (e.g. as a sort key)