#17361: Poset: Add ordinal_product
---------------------------------+-----------------------------
Reporter: jmantysalo | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-wishlist
Component: combinatorics | Resolution:
Keywords: poset | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
---------------------------------+-----------------------------
Description changed by jmantysalo:
Old description:
> Add the ordinal product function of posets. See Enumerative
> combinatorics, p. 284.
New description:
Add the ordinal product (Enumerative combinatorics, p. 284) function of
posets. In ordinal product of `P` and `Q` we have `(p,q) <= (p',q')` if
either `p <= p'` or `p == p'` and `q <= q'`. This is easy one, just needs
docstring etc. Direct example code:
{{{
def ordinal_product(P, Q):
# Note: P*Q is not isomorphic to Q*P
elms=[(s,t) for s in P for t in Q]
rels_a=[((s,t),(s, t_)) for s in P for t in Q for t_ in Q if Q.lt(t,
t_)]
rels_b=[((s,t),(s_, t_)) for s in P for t in Q for s_ in P for t_ in Q
if P.lt(s, s_)]
return Poset((elms, rels_a+rels_b))
}}}
--
--
Ticket URL: <http://trac.sagemath.org/ticket/17361#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.