algebraixlib.mathobjects.couplet module

Provide the class Couplet; it represents a couplet.


Factory wrapper to create a Couplet.


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.

  • 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.

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


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.


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


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).


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


Return the instance’s code representation.


Return the instance’s string representation.