Module: cirq.interop.quirk.cells.parse

Functions

parse_complex(...): Attempts to parse a complex number in exactly the same way as Quirk.

parse_formula(...): Attempts to parse formula text in exactly the same way as Quirk.

parse_matrix(...): Attempts to parse a complex matrix in exactly the same way as Quirk.

PARSE_COMPLEX_TOKEN_MAP_ALL

{
 '(': '(',
 ')': ')',
 '*': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83ca50>,
 '+': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83cad0>,
 '-': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83cb10>,
 '/': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83ca90>,
 '^': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83ca10>,
 'e': E,
 'exp': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83c990>,
 'i': 1j,
 'ln': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83c9d0>,
 'pi': pi,
 'sqrt': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83c2d0>,
 '¼': 0.25,
 '½': 0.5,
 '¾': 0.75,
 '⅐': 0.14285714285714285,
 '⅑': 0.1111111111111111,
 '⅒': 0.1,
 '⅓': 0.3333333333333333,
 '⅔': 0.6666666666666666,
 '⅕': 0.2,
 '⅖': 0.4,
 '⅗': 0.6,
 '⅘': 0.8,
 '⅙': 0.16666666666666666,
 '⅚': 0.8333333333333334,
 '⅛': 0.125,
 '⅜': 0.375,
 '⅝': 0.625,
 '⅞': 0.875,
 '√': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83c2d0>
}

PARSE_COMPLEX_TOKEN_MAP_DEG

{
 '(': '(',
 ')': ')',
 '*': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83ca50>,
 '+': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83cad0>,
 '-': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83cb10>,
 '/': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83ca90>,
 '^': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83ca10>,
 'acos': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83cc10>,
 'arccos': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83cc10>,
 'arcsin': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83cbd0>,
 'asin': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83cbd0>,
 'cos': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83cb50>,
 'e': E,
 'exp': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83c990>,
 'i': 1j,
 'ln': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83c9d0>,
 'pi': pi,
 'sin': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83cb90>,
 'sqrt': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83c2d0>,
 '¼': 0.25,
 '½': 0.5,
 '¾': 0.75,
 '⅐': 0.14285714285714285,
 '⅑': 0.1111111111111111,
 '⅒': 0.1,
 '⅓': 0.3333333333333333,
 '⅔': 0.6666666666666666,
 '⅕': 0.2,
 '⅖': 0.4,
 '⅗': 0.6,
 '⅘': 0.8,
 '⅙': 0.16666666666666666,
 '⅚': 0.8333333333333334,
 '⅛': 0.125,
 '⅜': 0.375,
 '⅝': 0.625,
 '⅞': 0.875,
 '√': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83c2d0>
}

PARSE_COMPLEX_TOKEN_MAP_RAD

{
 '(': '(',
 ')': ')',
 '*': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83ca50>,
 '+': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83cad0>,
 '-': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83cb10>,
 '/': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83ca90>,
 '^': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83ca10>,
 'acos': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83cd10>,
 'asin': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83ccd0>,
 'atan': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83cd90>,
 'cos': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83cc50>,
 'e': E,
 'exp': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83c990>,
 'i': 1j,
 'ln': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83c9d0>,
 'pi': pi,
 'sin': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83cc90>,
 'sqrt': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83c2d0>,
 'tan': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83cd50>,
 '¼': 0.25,
 '½': 0.5,
 '¾': 0.75,
 '⅐': 0.14285714285714285,
 '⅑': 0.1111111111111111,
 '⅒': 0.1,
 '⅓': 0.3333333333333333,
 '⅔': 0.6666666666666666,
 '⅕': 0.2,
 '⅖': 0.4,
 '⅗': 0.6,
 '⅘': 0.8,
 '⅙': 0.16666666666666666,
 '⅚': 0.8333333333333334,
 '⅛': 0.125,
 '⅜': 0.375,
 '⅝': 0.625,
 '⅞': 0.875,
 '√': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7fddfd83c2d0>
}

T Instance of typing.TypeVar
UNICODE_FRACTIONS

{
 '¼': 0.25,
 '½': 0.5,
 '¾': 0.75,
 '⅐': 0.14285714285714285,
 '⅑': 0.1111111111111111,
 '⅒': 0.1,
 '⅓': 0.3333333333333333,
 '⅔': 0.6666666666666666,
 '⅕': 0.2,
 '⅖': 0.4,
 '⅗': 0.6,
 '⅘': 0.8,
 '⅙': 0.16666666666666666,
 '⅚': 0.8333333333333334,
 '⅛': 0.125,
 '⅜': 0.375,
 '⅝': 0.625,
 '⅞': 0.875
}