Opened 5 years ago

Last modified 5 weeks ago

#24900 needs_work defect

Tensor product and coefficients

Reported by: Florent Hivert Owned by:
Priority: major Milestone: sage-9.8
Component: linear algebra Keywords: tensor product, free modules
Cc: Nicolas M. Thiéry, Travis Scrimshaw, Matthias Köppe Merged in:
Authors: Florent Hivert Reviewers:
Report Upstream: N/A Work issues:
Branch: public/cartesian_24900 (Commits, GitHub, GitLab) Commit: bfa36e785be6af5bb7031d785c8469acfcd1472b
Dependencies: #19195 Stopgaps:

Status badges

Description

Tensor products of combinatorial free modules still use an old version of cartesian product. As a consequence extracting a coefficient is not possible:

sage: F = CombinatorialFreeModule(ZZ, [1,2]); F.__custom_name = "F"
sage: G = CombinatorialFreeModule(ZZ, [3,4]); G.__custom_name = "G"
sage: T = tensor([F, G]); T
sage: T.basis()[(1,3)].coefficient((1,3))
...
NotImplementedError:

I fix that. As a side effect, this change the result of an_element so that I have to fix a few doctests.

Moreover, building the tensor of two infinite dimensional FM now raises a correct warning:

sage: F = CombinatorialFreeModule(ZZ, NN)
sage: T = tensor([F, F]); T
Free module generated by Non negative integer semiring over Integer Ring ⊗ Free module generated by Non negative integer semiring over Integer Ring
sage: T.an_element()
/home/data/Sage-Install/sage-dev/local/lib/python2.7/site-packages/sage/categories/sets_cat.py:2159: UserWarning: Sage is not able to determine whether the factors of this Cartesian product are finite. The lexicographic ordering might not go through all elements.
  warn("Sage is not able to determine whether the factors of "
2*B[0] ⊗ B[1] + B[0] ⊗ B[0] + 3*B[0] ⊗ B[2] + B[42] ⊗ B[42]

I'm hiding this by asking only finite dim FM.

Change History (10)

comment:1 Changed 5 years ago by Florent Hivert

Branch: u/hivert/tensor_product_and_coefficients

comment:2 Changed 5 years ago by Florent Hivert

Authors: Florent Hivert
Commit: 009c70a07140b6df68ac61ccd38db52c0b1188b1
Status: newneeds_review

New commits:

009c70aFix tensor prod. using old cartesian prod.

comment:3 Changed 5 years ago by Frédéric Chapoton

many failing doctests

comment:4 Changed 5 years ago by Frédéric Chapoton

Status: needs_reviewneeds_work

comment:5 Changed 5 years ago by Travis Scrimshaw

Cc: Travis Scrimshaw added

comment:6 Changed 6 weeks ago by Frédéric Chapoton

Branch: u/hivert/tensor_product_and_coefficientspublic/cartesian_24900
Commit: 009c70a07140b6df68ac61ccd38db52c0b1188b129190d35dd8266187b91f482064d785b934cb7a8

rebased, just to see where this stands now


New commits:

29190d3Fix tensor prod. using old cartesian prod.

comment:7 Changed 6 weeks ago by Frédéric Chapoton

Cc: Matthias Köppe added
Milestone: sage-8.2sage-9.7

comment:8 Changed 6 weeks ago by git

Commit: 29190d35dd8266187b91f482064d785b934cb7a8bfa36e785be6af5bb7031d785c8469acfcd1472b

Branch pushed to git repo; I updated commit sha1. New commits:

bfa36e7fix one doctest

comment:9 Changed 5 weeks ago by Matthias Köppe

Dependencies: #19195

comment:10 Changed 5 weeks ago by Matthias Köppe

Milestone: sage-9.7sage-9.8
Note: See TracTickets for help on using tickets.