quil.expression

class Expression:
def from_address(inner):

The Python wrapper for [Expression::Address], creating a [PyExpression] and taking a Python argument.

def from_function_call(inner):

The Python wrapper for [Expression::FunctionCall], creating a [PyExpression] and taking a Python argument.

def from_infix(inner):

The Python wrapper for [Expression::Infix], creating a [PyExpression] and taking a Python argument.

def from_number(inner):

The Python wrapper for [Expression::Number], creating a [PyExpression] and taking a Python argument.

def new_pi():

Create a new [PyExpression] wrapping a [Expression::PiConstant].

def from_prefix(inner):

The Python wrapper for [Expression::Prefix], creating a [PyExpression] and taking a Python argument.

def from_variable(inner):

The Python wrapper for [Expression::Variable], creating a [PyExpression] and taking a Python argument.

def inner(self, /):

Directly return the Python version of the variant discriminant wrapped by this value; i.e., performs the match Expression::Variant(x) => x for every variant constructor in [Expression]

def is_address(self, /):

Tests if this [PyExpression] wraps a [Expression::address] value

def as_address(self, /):

Returns x if this [PyExpression] wraps a Expression::address(x); otherwise returns (Python) None. On the Rust side, this corresponds to either Some(x) or [None].

def to_address(self, /):

Returns x if this [PyExpression] wraps a Expression::address(x); otherwise raises a ValueError. On the Rust side, this corresponds to either Ok(x) or Err(...).

def is_function_call(self, /):

Tests if this [PyExpression] wraps a [Expression::function_call] value

def as_function_call(self, /):

Returns x if this [PyExpression] wraps a Expression::function_call(x); otherwise returns (Python) None. On the Rust side, this corresponds to either Some(x) or [None].

def to_function_call(self, /):

Returns x if this [PyExpression] wraps a Expression::function_call(x); otherwise raises a ValueError. On the Rust side, this corresponds to either Ok(x) or Err(...).

def is_infix(self, /):

Tests if this [PyExpression] wraps a [Expression::infix] value

def as_infix(self, /):

Returns x if this [PyExpression] wraps a Expression::infix(x); otherwise returns (Python) None. On the Rust side, this corresponds to either Some(x) or [None].

def to_infix(self, /):

Returns x if this [PyExpression] wraps a Expression::infix(x); otherwise raises a ValueError. On the Rust side, this corresponds to either Ok(x) or Err(...).

def is_number(self, /):

Tests if this [PyExpression] wraps a [Expression::number] value

def as_number(self, /):

Returns x if this [PyExpression] wraps a Expression::number(x); otherwise returns (Python) None. On the Rust side, this corresponds to either Some(x) or [None].

def to_number(self, /):

Returns x if this [PyExpression] wraps a Expression::number(x); otherwise raises a ValueError. On the Rust side, this corresponds to either Ok(x) or Err(...).

def is_pi(self, /):

Tests if this [PyExpression] wraps a [Expression::pi] value

def is_prefix(self, /):

Tests if this [PyExpression] wraps a [Expression::prefix] value

def as_prefix(self, /):

Returns x if this [PyExpression] wraps a Expression::prefix(x); otherwise returns (Python) None. On the Rust side, this corresponds to either Some(x) or [None].

def to_prefix(self, /):

Returns x if this [PyExpression] wraps a Expression::prefix(x); otherwise raises a ValueError. On the Rust side, this corresponds to either Ok(x) or Err(...).

def is_variable(self, /):

Tests if this [PyExpression] wraps a [Expression::variable] value

def as_variable(self, /):

Returns x if this [PyExpression] wraps a Expression::variable(x); otherwise returns (Python) None. On the Rust side, this corresponds to either Some(x) or [None].

def to_variable(self, /):

Returns x if this [PyExpression] wraps a Expression::variable(x); otherwise raises a ValueError. On the Rust side, this corresponds to either Ok(x) or Err(...).

def to_quil(self, /):
def to_quil_or_debug(self, /):
def parse(input):

Implements a static parse method for Python in terms of the Rust FromStr instance.

def simplify(self, /):
def into_simplified(self, /):
def evaluate(self, /, variables, memory_references):
def substitute_variables(self, /, variable_values):
def to_real(self, /):
class FunctionCallExpression:
expression

Get the expression field from Python. Annotated with @property.

function

Get the function field from Python. Annotated with @property.

class InfixExpression:
left

Get the left field from Python. Annotated with @property.

right

Get the right field from Python. Annotated with @property.

operator

Get the operator field from Python. Annotated with @property.

class PrefixExpression:
operator

Get the operator field from Python. Annotated with @property.

expression

Get the expression field from Python. Annotated with @property.

class ExpressionFunction:
Cis = Cis
Cosine = Cosine
Exponent = Exponent
Sine = Sine
SquareRoot = SquareRoot
class PrefixOperator:
Plus = Plus
Minus = Minus
class InfixOperator:
Caret = Caret
Plus = Plus
Minus = Minus
Slash = Slash
Star = Star
class EvaluationError(builtins.ValueError):

Inappropriate argument value (of correct type).

class ParseExpressionError(builtins.ValueError):

Inappropriate argument value (of correct type).