jacopy.Product

class jacopy.Product(*children)

Bases: Expr

n-ary product. Non-commutative by default.

Commutativity, anti-commutativity and graded (Koszul) signs live in jacopy.algorithms.sort_product; this class only stores the ordered tuple of factors.

Parameters:

children (Expr)

__init__(*children)
Parameters:

children (Expr)

Methods

__init__(*children)

clone()

Return self.

find(predicate)

Yield descendants (including self) satisfying predicate.

make(*args)

Smart constructor.

replace_at(path, new)

Return a new tree with new spliced at path.

substitute_atom(dummy, target)

Return self with every occurrence of dummy replaced by target.

walk()

Pre-order traversal yielding self followed by descendants through children only.

Attributes

children

Tuple of immediate children.

is_atom

property children: Tuple[Expr, ...]

Tuple of immediate children. Atoms return ().

classmethod make(*args)

Smart constructor.

Flattens nested products, absorbs zero (any zero factor yields 0), drops integer ones, and collapses trivial cases. Preserves factor order.

Parameters:

args (Expr)

Return type:

Expr