uconf.models.lie

Finite-arity model of the Lie operad in a Hall-type basis.

Classes

Lie(n, base_ring)

Lie operad component in arity n.

class uconf.models.lie.Lie(n, base_ring)[source]

Bases: CombinatorialFreeModule

Lie operad component in arity n.

Basis keys are permutations of (1, ..., n-1) and encode nested brackets [x_i, -] ending in x_n.

Computational data (PBW matrix, its left-inverse, word/basis-key lists, and associative expansions) are cached via sage.misc.cachefunc.cached_method(). Since CombinatorialFreeModule inherits from UniqueRepresentation, Lie(n, base_ring) always returns the same instance for a given (n, base_ring) pair, so these instance-level caches are automatically shared across all callers—including compose(), which creates a new Lie parent on each invocation.

EXAMPLES:

sage: from sage.all import QQ
sage: from uconf import Lie
sage: L3 = Lie(3, QQ)
sage: x = L3((1, 2))
sage: x.arity()
3
sage: x.permute([2, 1, 3]).parent() is L3
True
connectivity: ClassVar[int] = 0

All components live in degree 0 (the Lie operad is concentrated in degree 0).

__init__(n, base_ring)[source]

Initialize Lie(n) over base_ring.

arity()[source]

Return the arity of this Lie operad component.

Return type:

int

basis_iter(d)[source]

Iterate over the canonical Lie basis in this fixed arity and the given degree.

Parameters:

d (int)

Return type:

Iterator[Element]

graded_basis[source]

/home/runner/work/uconf/uconf/src/uconf/models/lie.py (starting at line 285) Return the Family of all basis elements in degree d.

Type:

File

static unit(base_ring)[source]

Return the operadic unit in arity 1.

static unit_key()[source]

Return the basis key of the unit element in arity 1.

Return type:

tuple

degree_on_basis(element)[source]

Return homological degree on basis elements (always 0 here).

Return type:

int

static compose(x, i, y)[source]

Operadic composition x \circ_i y in the Lie operad.

Parameters

x, y:

Lie-operad elements over the same base ring.

i:

Input slot of x into which y is inserted.

Returns

Lie.Element

The composite in arity x.arity() + y.arity() - 1.

The implementation follows the algorithmic approach described in Bremner–Dotsenko Algebraic Operads: An Algorithmic Companion:

  1. Expand x and y into the associative word basis once each, combining all terms into single dicts before the composition loop. This avoids calling _assoc_from_basis_key() redundantly for every outer word of x (the bottleneck in the original code).

  2. Perform variable-substitution and renaming in a single double loop over the pre-aggregated word dicts.

  3. Recover the Lie coordinates via a pre-cached left-inverse matrix (one matrix–vector multiply) rather than a fresh linear solve.

EXAMPLES:

sage: from sage.all import QQ
sage: from uconf import Lie
sage: x = Lie(2, QQ)((1,))
sage: y = Lie(2, QQ)((1,))
sage: Lie.compose(x, 2, y).arity()
3
Parameters:
Return type:

Element

Lie.Element[source]

alias of Element