Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Details yang baxter #38941

Merged
merged 3 commits into from
Nov 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/sage/combinat/yang_baxter_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def YangBaxterGraph(partition=None, root=None, operators=None):

OUTPUT: either:

- :class:`YangBaxterGraph_partition` -- if partition is defined
- :class:`YangBaxterGraph_generic` -- if partition is ``None``
- :class:`YangBaxterGraph_partition` -- if partition is defined
- :class:`YangBaxterGraph_generic` -- if partition is ``None``

EXAMPLES:

Expand Down Expand Up @@ -108,8 +108,7 @@ def YangBaxterGraph(partition=None, root=None, operators=None):
"""
if partition is None:
return YangBaxterGraph_generic(root=root, operators=operators)
else:
return YangBaxterGraph_partition(partition=Partition(partition))
return YangBaxterGraph_partition(partition=Partition(partition))
fchapoton marked this conversation as resolved.
Show resolved Hide resolved

# *********** General class for Yang-Baxter Graphs ***********

Expand Down Expand Up @@ -203,7 +202,7 @@ def _digraph(self):
digraph.add_edge(u, v, l)
return digraph

def __hash__(self):
def __hash__(self) -> int:
r"""
TESTS::

Expand Down Expand Up @@ -236,7 +235,7 @@ def __eq__(self, other) -> bool:
sage: Y3.__eq__(Y2)
False
"""
return type(self) is type(other) and self._digraph == other._digraph
return isinstance(other, YangBaxterGraph_generic) and self._digraph == other._digraph

def __ne__(self, other) -> bool:
r"""
Expand Down Expand Up @@ -634,7 +633,7 @@ def _digraph(self):
[((0, 1, 0), (1, 0, 0), Swap positions 0 and 1)]
"""
digraph = super()._digraph
for (u, v, op) in digraph.edges(sort=True):
for u, v, op in digraph.edges(sort=True):
fchapoton marked this conversation as resolved.
Show resolved Hide resolved
digraph.set_edge_label(u, v, SwapOperator(op.position()))
return digraph

Expand Down Expand Up @@ -777,7 +776,7 @@ def __init__(self, i):
"""
self._position = i

def __hash__(self):
def __hash__(self) -> int:
r"""
TESTS::

Expand Down
Loading