Incidence algebras, entering elements

I have been trying to use incidence algebras, but immediately stumbled on a problem: how to enter elements when the elements of the underlying posets are complicated?

In the example below, I tried a cumbersome hack to enter some elements. It seemingly works, but these elements are not treated equaly as for instance the .an_element()

R = posets.YoungDiagramPoset([2,2]).incidence_algebra(QQ)
A1 = R.product_on_basis((1,1),(1,1))
A2 = R.product_on_basis((0,0),(0,0))
A3 = 3*A1 + 7*A2
ane = R.an_element()
print(A1,A1.parent())
print(ane,ane.parent())

print(ane.to_matrix())
print(A1.to_matrix())


The last statement gives an error "ValueError: tuple.index(x): x not in tuple" showing that my handcrafted elements are not full citizens in R. How am I supposed to enter my elements?

Edit: the following works, so the mysterious behaviour of product_on_basis no longer concerns me.

R = posets.YoungDiagramPoset([2,2]).incidence_algebra(QQ)
f = 5*R[(0,0),(0,0)]
f.to_matrix()


Further edit: .product_on_basis works correctly, and non-mysteriously, if invoked correctly:

h=R.product_on_basis(((1,1),(1,1)),((1,1),(1,1)))
h.to_matrix()

edit retag close merge delete

Sort by ยป oldest newest most voted

Basis elements in the incidence algebra. i.e. a single interval, are added like this:

R = posets.YoungDiagramPoset([2,2]).incidence_algebra(QQ)
f = R[(0,0),(0,0)]


.product_on_basis works as intended, but its arguments should be a pair of intervals in the poset, which translates to a pair of pairs of poset elements. With the same incidence algebra R as before, and the same poset, simply do

h=R.product_on_basis(((1,1),(1,1)),((1,1),(1,1)))

more

If arguments are not what's required, it should report an error rather than silently produce meaningless results. So, it's still a bug in my opinion.

( 2022-06-12 17:36:41 +0100 )edit