The PBR class

Class for representing PBRs.

Partitioned binary relations (PBRs) are a generalisation of a bipartitions, and were introduced by Martin and Mazorchuk in [MM11].

Contents

PBR

Class for representing PBRs.

PBR.copy(…)

Copy a PBR object.

PBR.degree(…)

Returns the degree of a PBR.

PBR.number_of_points(…)

Returns the number of points of a PBR.

PBR.product_inplace(…)

Multiply two PBR objects and store the product in self.

Full API

class PBR
__init__(*args, **kwargs)

Overloaded function.

__init__(self: PBR, n: int) None

Construct empty PBR of given degree.

Parameters:

n (int) – the degree

__init__(self: PBR, left: list[list[int]], right: list[list[int]]) None

Construct from adjacencies 1 to n and -1 to -n.

Construct from adjacencies 1 to n and -1 to -n. The parameters left and right should be containers of n lists of integer values, so that the list in position i of left is the list of points adjacent to i in the PBR, and the list in position i of right is the list of points adjacent to n + i in the PBR. A negative value i corresponds to n - i.

Parameters:
  • left (list[list[int]]) – container of adjacencies of 1 to n

  • right (list[list[int]]) – container of adjacencies of n + 1 to 2n.

Raises:

LibsemigroupsError

if the resultant PBR:

  • would not describe a binary relation on an even number of points; or

  • would have a point related to a point that is greater than PBR.degree;

__init__(self: PBR, x: list[list[int]]) None

Construct from adjacencies 0 to 2n - 1.

Construct from adjacencies 0 to 2n - 1. The parameter x must be a container of lists of int with size 2n for some integer n, and the list in position i is the list of points adjacent to i in the PBR constructed.

Parameters:

x (list[list[int]]) – the container of lists of adjacencies.

Raises:

LibsemigroupsError

if the resultant PBR:

  • would not describe a binary relation on an even number of points; or

  • would have a point related to a point that is greater than PBR.degree;

  • x contains a list of points related to a point that is not sorted.

copy(self: PBR) PBR

Copy a PBR object.

Returns:

A copy.

Return type:

PBR

degree(self: PBR) int

Returns the degree of a PBR.

Returns the degree of a PBR, where the degree of a PBR is half the number of points in the PBR.

Returns:

The degree of the PBR.

Return type:

int

Complexity:

Constant.

number_of_points(self: PBR) int

Returns the number of points of a PBR.

Returns:

A value of type int.

Return type:

int

Complexity:

Constant.

product_inplace(self: PBR, x: PBR, y: PBR, thread_id: int) None

Multiply two PBR objects and store the product in self.

The parameter thread_id is required since some temporary storage is required to find the product of x and y. Note that if different threads call this member function with the same value of thread_id then bad things will happen.

Parameters:
  • x (PBR) – the left multiplicand.

  • y (PBR) – the right multiplicand.

  • thread_id (int) – the index of the calling thread (defaults to 0).

Raises:

LibsemigroupsError – if: * the PBR.degree of x is not the same as the PBR.degree of y; * the PBR.degree of self is not the same as the PBR.degree of x; or * either x or y is the same object as self.