algebraixlib.mathobjects.couplet module

Provide the class Couplet; it represents a couplet.

algebraixlib.mathobjects.couplet.make_couplet(*args)[source]

Factory wrapper to create a Couplet.

algebraixlib.mathobjects.couplet.make_couplet_unchecked(*args)[source]

Factory wrapper to create a Couplet (unchecked version).

class algebraixlib.mathobjects.couplet.Couplet(left, right=None, direct_load=False)[source]

Bases: algebraixlib.mathobjects.mathobject.MathObject

A couplet containing a left component and a right component.

Parameters:
  • left – The left component of the couplet, and the default value for the right component (see right). If this argument is not a MathObject, it is converted into an Atom.
  • right – (Optional) The right component of the couplet. If this argument is not a MathObject, it is converted into an Atom. If this argument is missing, the value of left is used and a reflexive couplet where left and right are the same is created.
  • direct_load – (Optional) Set to True if you know that both left and right are instances of MathObject.
left

Read-only property; return the left component of this instance.

right

Read-only property; return the right component of this instance.

get_ground_set() → algebraixlib.structure.Structure[source]

Return the ground set of the lowest-level algebra of self.

__eq__(other)[source]

A value-based comparison for equality. Return True if type and both members match.

__ne__(other)[source]

A value-based comparison for inequality. Return True if type or members don’t match.

__le__(other, NotImplemented=NotImplemented)

Return a <= b. Computed by @total_ordering from (a < b) or (a == b).

__hash__()[source]

Return a hash based on the value that is calculated on demand and cached.

__repr__()[source]

Return the instance’s code representation.

__str__()[source]

Return the instance’s string representation.