Add specializations of the Opposite() operator.

This commit is contained in:
Glen Whitney 2017-10-18 21:55:52 +02:00
parent bc8c892898
commit 5cde15c8ee

View File

@ -235,3 +235,31 @@ InstallMethod(RightPerms,
function(fam)
return List(TransposedMat(MultiplicationTable(fam)), x->PermList(x));
end);
## Special case the Opposite function from LOOPS package, since the opposite
## of a left quasigroup is a right quasigroup and vice versa
# Is there a way to do this just once for each direction?
InstallMethod(Opposite, "for left quasigroup",
[ IsLeftQuasigroup ],
L -> RightQuasigroupByMultiplicationTable(
TransposedMat(MultiplicationTable(L))
)
);
InstallMethod(Opposite, "for left rack",
[ IsLeftRack ],
L -> RightRackByMultiplicationTableNC(TransposedMat(MultiplicationTable(L)))
);
InstallMethod(Opposite, "for right quasigroup",
[ IsRightQuasigroup ],
L -> LeftQuasigroupByMultiplicationTable(
TransposedMat(MultiplicationTable(L))
)
);
InstallMethod(Opposite, "for right rack",
[ IsRightRack ],
L -> LeftRackByMultiplicationTableNC(TransposedMat(MultiplicationTable(L)))
);