The ImageRightAction class
Adapter for computing the image of a point under a right action.
This class provides a call operator with signature (pt: Point, x: Element) ->
Point
, returning the image of the point pt under the right action of the
element x.
>>> from libsemigroups_pybind11 import PPerm, ImageRightAction
>>> x = PPerm([0, 1, 2, 3, 5, 6, 9], [9, 7, 3, 5, 4, 2, 1], 10)
>>> pt = PPerm([0, 1, 2, 3, 5, 6], [0, 1, 2, 3, 5, 6], 10)
>>> func = ImageRightAction(point=pt, element=x)
>>> func(pt, x)
PPerm([2, 3, 4, 5, 7, 9], [2, 3, 4, 5, 7, 9], 10)
>>> func(_, x)
PPerm([1, 3, 4, 5], [1, 3, 4, 5], 10)
>>> func(_, x)
PPerm([4, 5, 7], [4, 5, 7], 10)
>>> func(_, x)
PPerm([4], [4], 10)
>>> func(_, x)
PPerm([], [], 10)
>>> func(_, x)
PPerm([], [], 10)
Contents
Adapter for computing the image of a point under a right action. |
|
Return the image of a point acted on by an element. |
Full API
- class ImageRightAction
- __init__(self: Self, *args, point: Point = None, element: Element = None) None
Construct from sample element and sample point.
- Keyword Arguments:
element (Element) – a sample element.
point (Point) – a sample point.
- Raises:
KeyError – if the action defined by the arguments is not defined.
- __call__(self: ImageRightAction, pt: Point, x: Element) Point
Return the image of a point acted on by an element.
This call operator returns the image of pt acted on by x.
- Parameters:
pt (Point) – the point on which to act.
x (Element) – the element doing the acting.
- Returns:
The image of pt acted on by x.
- Return type:
Point
- Raises:
TypeError – If the wrapped C++ type of the sample objects passed via x and point are not the same as the wrapped types of the arguments in any invocation of the call operator. For example, if point is
PPerm([], [], 256)
, then the underlying C++ type uses 8-bit integers to store image values. So, any partial permutation passed as the 1st argument to the call operator must be of degree at most256
.