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 0x7f63d36d4490>,
 '+': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4510>,
 '-': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4550>,
 '/': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d44d0>,
 '^': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4450>,
 'e': E,
 'exp': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d43d0>,
 'i': 1j,
 'ln': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4410>,
 'pi': pi,
 'sqrt': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63e40dda90>,
 '¼': 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 0x7f63e40dda90>
}

PARSE_COMPLEX_TOKEN_MAP_DEG

{
 '(': '(',
 ')': ')',
 '*': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4490>,
 '+': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4510>,
 '-': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4550>,
 '/': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d44d0>,
 '^': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4450>,
 'acos': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4650>,
 'arccos': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4650>,
 'arcsin': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4610>,
 'asin': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4610>,
 'cos': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4590>,
 'e': E,
 'exp': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d43d0>,
 'i': 1j,
 'ln': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4410>,
 'pi': pi,
 'sin': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d45d0>,
 'sqrt': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63e40dda90>,
 '¼': 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 0x7f63e40dda90>
}

PARSE_COMPLEX_TOKEN_MAP_RAD

{
 '(': '(',
 ')': ')',
 '*': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4490>,
 '+': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4510>,
 '-': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4550>,
 '/': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d44d0>,
 '^': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4450>,
 'acos': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4750>,
 'asin': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4710>,
 'atan': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d47d0>,
 'cos': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4690>,
 'e': E,
 'exp': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d43d0>,
 'i': 1j,
 'ln': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4410>,
 'pi': pi,
 'sin': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d46d0>,
 'sqrt': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63e40dda90>,
 'tan': <cirq.interop.quirk.cells.parse._CustomQuirkOperationToken object at 0x7f63d36d4790>,
 '¼': 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 0x7f63e40dda90>
}

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
}