jacopy.MultiEval

class jacopy.MultiEval(head, *args, alternating=True, slot_kind='vector')

Bases: Expr

Multilinear evaluation head(arg_1, …, arg_p).

Parameters:
  • head (Expr) – The form or multivector being evaluated.

  • *args (Expr) – Vector fields (for slot_kind="vector") or 1-forms (for slot_kind="covector"). At least one arg is required, a zero-arg “evaluation” is just head itself; constructing a MultiEval with no args is a category error.

  • alternating (bool) – When True (default), the node is graded-antisymmetric in its argument slots. The jacopy.calculus.multi_eval_axioms engine rules use this flag to decide whether repeat-arg zeroing fires.

  • slot_kind (str) – "vector" (default) when args are vector fields, or "covector" when args are 1-forms. Documentation only, does not affect structural algebra.

__init__(head, *args, alternating=True, slot_kind='vector')
Parameters:
Return type:

None

Methods

__init__(head, *args[, alternating, slot_kind])

clone()

Return self.

find(predicate)

Yield descendants (including self) satisfying predicate.

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.

swapped(i, j)

Return (new_node, sign) for a swap of args i and j.

walk()

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

with_args(*new_args)

Return a copy with the same head/flags but new argument tuple.

Attributes

alternating

args

arity

children

Tuple of immediate children.

head

is_atom

slot_kind

property children: Tuple[Expr, ...]

Tuple of immediate children. Atoms return ().

with_args(*new_args)

Return a copy with the same head/flags but new argument tuple.

Parameters:

new_args (Expr)

Return type:

MultiEval

swapped(i, j)

Return (new_node, sign) for a swap of args i and j.

For alternating=True the sign is -1 when i != j and +1 when i == j. For alternating=False the sign is always +1 (slot-linear with no symmetry).

Out-of-range indices raise IndexError.

Parameters:
Return type:

Tuple[MultiEval, int]