qalgebra.printing.unicodeprinter module

Unicode Printer

Summary

Classes:

QalgebraUnicodePrinter

Printer for a string (Unicode) representation.

SubSupFmt

A format string that divides into a name, subscript, and superscript.

SubSupFmtNoUni

SubSupFmt with default unicode_sub_super=False.

Reference

class qalgebra.printing.unicodeprinter.SubSupFmt(name, sub=None, sup=None, unicode_sub_super=True)[source]

Bases: object

A format string that divides into a name, subscript, and superscript.

>>> fmt = SubSupFmt('{name}', sub='({i},{j})', sup='({sup})')
>>> fmt.format(name='alpha', i='mu', j='nu', sup=1)
'α_(μ,ν)^(1)'
>>> fmt = SubSupFmt('{name}', sub='{sub}', sup='({sup})')
>>> fmt.format(name='alpha', sub='1', sup=1)
'α₁⁽¹⁾'
format(**kwargs)[source]

Format and combine the name, subscript, and superscript.

class qalgebra.printing.unicodeprinter.SubSupFmtNoUni(name, sub=None, sup=None, unicode_sub_super=False)[source]

Bases: qalgebra.printing.unicodeprinter.SubSupFmt

SubSupFmt with default unicode_sub_super=False.

class qalgebra.printing.unicodeprinter.QalgebraUnicodePrinter(cache=None, settings=None)[source]

Bases: qalgebra.printing.asciiprinter.QalgebraAsciiPrinter

Printer for a string (Unicode) representation.

sympy_printer_cls

alias of qalgebra.printing.sympy.SympyUnicodePrinter

printmethod: str = '_unicode'