import builtins
import enum
from quil import _quil
from quil._quil import instructions
import typing
__all__ = [
"EvaluationError",
"Expression",
"ExpressionFunction",
"FunctionCallExpression",
"InfixExpression",
"InfixOperator",
"ParseExpressionError",
"PrefixExpression",
"PrefixOperator",
]
class EvaluationError(_quil.QuilError):
...
class Expression:
def __add__(self, other: Expression) -> Expression: ...
def __getnewargs__(self) -> builtins.tuple[instructions.MemoryReference | FunctionCallExpression | InfixExpression | builtins.complex | PrefixExpression | builtins.str]: ...
def __mul__(self, other: Expression) -> Expression: ...
def __repr__(self) -> builtins.str:
def __sub__(self, other: Expression) -> Expression: ...
def __truediv__(self, other: Expression) -> Expression: ...
def evaluate(self, variables: typing.Mapping[builtins.str, builtins.complex], memory_references: typing.Mapping[builtins.str, typing.Sequence[builtins.float]]) -> builtins.complex:
def into_simplified(self) -> Expression:
@staticmethod
def parse(input: builtins.str) -> Expression:
def substitute_variables(self, variable_values: typing.Mapping[builtins.str, Expression]) -> Expression:
def to_real(self) -> builtins.float:
@typing.final
class Address(Expression):
__match_args__ = ("_0",)
@property
def _0(self) -> instructions.MemoryReference: ...
def __getitem__(self, key: builtins.int, /) -> typing.Any: ...
def __len__(self) -> builtins.int: ...
def __new__(cls, _0: instructions.MemoryReference) -> Expression.Address: ...
@typing.final
class FunctionCall(Expression):
__match_args__ = ("_0",)
@property
def _0(self) -> FunctionCallExpression: ...
def __getitem__(self, key: builtins.int, /) -> typing.Any: ...
def __len__(self) -> builtins.int: ...
def __new__(cls, _0: FunctionCallExpression) -> Expression.FunctionCall: ...
@typing.final
class Infix(Expression):
__match_args__ = ("_0",)
@property
def _0(self) -> InfixExpression: ...
def __getitem__(self, key: builtins.int, /) -> typing.Any: ...
def __len__(self) -> builtins.int: ...
def __new__(cls, _0: InfixExpression) -> Expression.Infix: ...
@typing.final
class Number(Expression):
__match_args__ = ("_0",)
@property
def _0(self) -> builtins.complex: ...
def __getitem__(self, key: builtins.int, /) -> typing.Any: ...
def __len__(self) -> builtins.int: ...
def __new__(cls, _0: builtins.complex) -> Expression.Number: ...
@typing.final
class Pi(Expression):
__match_args__ = ()
def __getitem__(self, key: builtins.int, /) -> typing.Any: ...
def __len__(self) -> builtins.int: ...
def __new__(cls) -> Expression.Pi: ...
@typing.final
class Prefix(Expression):
__match_args__ = ("_0",)
@property
def _0(self) -> PrefixExpression: ...
def __getitem__(self, key: builtins.int, /) -> typing.Any: ...
def __len__(self) -> builtins.int: ...
def __new__(cls, _0: PrefixExpression) -> Expression.Prefix: ...
@typing.final
class Variable(Expression):
__match_args__ = ("_0",)
@property
def _0(self) -> builtins.str: ...
def __getitem__(self, key: builtins.int, /) -> typing.Any: ...
def __len__(self) -> builtins.int: ...
def __new__(cls, _0: builtins.str) -> Expression.Variable: ...
class FunctionCallExpression:
@property
def expression(self) -> Expression: ...
@property
def function(self) -> ExpressionFunction: ...
def __eq__(self, other: builtins.object, /) -> builtins.bool: ...
def __getnewargs__(self) -> tuple[ExpressionFunction, Expression]: ...
def __hash__(self) -> builtins.int: ...
def __new__(cls, function: ExpressionFunction, expression: Expression) -> FunctionCallExpression: ...
def __repr__(self) -> builtins.str:
class InfixExpression:
@property
def left(self) -> Expression: ...
@property
def operator(self) -> InfixOperator: ...
@property
def right(self) -> Expression: ...
def __eq__(self, other: builtins.object, /) -> builtins.bool: ...
def __getnewargs__(self) -> tuple[Expression, InfixOperator, Expression]: ...
def __hash__(self) -> builtins.int: ...
def __new__(cls, left: Expression, operator: InfixOperator, right: Expression) -> InfixExpression: ...
def __repr__(self) -> builtins.str:
class ParseExpressionError(_quil.QuilError):
...
class PrefixExpression:
@property
def expression(self) -> Expression: ...
@property
def operator(self) -> PrefixOperator: ...
def __eq__(self, other: builtins.object, /) -> builtins.bool: ...
def __getnewargs__(self) -> tuple[PrefixOperator, Expression]: ...
def __hash__(self) -> builtins.int: ...
def __new__(cls, operator: PrefixOperator, expression: Expression) -> PrefixExpression: ...
def __repr__(self) -> builtins.str:
@typing.final
class ExpressionFunction(enum.Enum):
CIS = ...
COSINE = ...
EXPONENT = ...
SINE = ...
SQUARE_ROOT = ...
def __getnewargs__(self) -> tuple[builtins.int]: ...
def __new__(cls, value: builtins.int) -> ExpressionFunction: ...
def __repr__(self) -> builtins.str:
@typing.final
class InfixOperator(enum.Enum):
CARET = ...
PLUS = ...
MINUS = ...
SLASH = ...
STAR = ...
def __getnewargs__(self) -> tuple[builtins.int]: ...
def __new__(cls, value: builtins.int) -> InfixOperator: ...
def __repr__(self) -> builtins.str:
@typing.final
class PrefixOperator(enum.Enum):
PLUS = ...
MINUS = ...
def __getnewargs__(self) -> tuple[builtins.int]: ...
def __new__(cls, value: builtins.int) -> PrefixOperator: ...
def __repr__(self) -> builtins.str: