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

Allow for tensor product of a FiniteRankFreeModule dual #34471

Closed
egourgoulhon opened this issue Sep 1, 2022 · 18 comments
Closed

Allow for tensor product of a FiniteRankFreeModule dual #34471

egourgoulhon opened this issue Sep 1, 2022 · 18 comments

Comments

@egourgoulhon
Copy link
Member

Since Sage 9.7.rc0, FiniteRankFreeModule's are endowed with a tensor_product method, thanks to #31276. However, this does not work with the dual:

sage: M = FiniteRankFreeModule(ZZ, 2, name='M')
sage: M.tensor_product(M.tensor_module(1,1))  # OK
Free module of type-(2,1) tensors on the Rank-2 free module M 
 over the Integer Ring
sage: M.tensor_product(M.dual())
...
AttributeError: 'ExtPowerDualFreeModule_with_category' object has 
 no attribute 'tensor_type'

The method ExtPowerDualFreeModule.tensor_type is implemented here,
which fixes the issue:

sage: M.tensor_product(M.dual())
Free module of type-(1,1) tensors on the Rank-2 free module M 
 over the Integer Ring

Depends on #30241

CC: @mkoeppe @tscrim

Component: linear algebra

Reviewer: Eric Gourgoulhon

Issue created by migration from https://trac.sagemath.org/ticket/34471

@egourgoulhon
Copy link
Member Author

@egourgoulhon
Copy link
Member Author

New commits:

f6d1598Add tensor_type to ExtPowerFreeModule and ExtPowerDualFreeModule (#34471)

@egourgoulhon
Copy link
Member Author

Commit: f6d1598

@egourgoulhon egourgoulhon changed the title Allow for tensor_product of a FiniteRankFreeModule dual Allow for tensor product of a FiniteRankFreeModule dual Sep 1, 2022
@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 1, 2022

comment:3

Is this needed when #34474 is merged?

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 1, 2022

comment:4

I'd suggest to do #30241 (a separate implementation class for the dual) instead.

@egourgoulhon
Copy link
Member Author

comment:5

Replying to @mkoeppe:

Is this needed when #34474 is merged?

Only if you plan to do M.tensor_product(M.tensor_module(0, 1)).
You well get an error then.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 2, 2022

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

31b0c07Use of ExtPower(Dual)FreeModule.tensor_type in TensorFreeModule._coerce_map_from_

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 2, 2022

Changed commit from f6d1598 to 31b0c07

@egourgoulhon
Copy link
Member Author

comment:7

Replying to @mkoeppe:

I'd suggest to do #30241 (a separate implementation class for the dual) instead.

This makes sense. On the other hand, it does not harm to endow the classes ExtPowerFreeModule and ExtPowerDualFreeModule with a method tensor_type(). Even, this permits a slight simplification of the code of TensorFreeModule._coerce_map_from_, as shown in the latest commit.

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 2, 2022

comment:8

Replying to @egourgoulhon:

On the other hand, it does not harm to endow the classes ExtPowerFreeModule and ExtPowerDualFreeModule with a method tensor_type().

It does make tensor_product return a wrong result instead of giving an error when one of the factors is an exterior power

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 2, 2022

comment:9

I would propose to close this in favor of #30241

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 2, 2022

Dependencies: #30241

@mkoeppe mkoeppe removed this from the sage-9.7 milestone Sep 2, 2022
@egourgoulhon
Copy link
Member Author

comment:10

Replying to @mkoeppe:

Replying to @egourgoulhon:

On the other hand, it does not harm to endow the classes ExtPowerFreeModule and ExtPowerDualFreeModule with a method tensor_type().

It does make tensor_product return a wrong result instead of giving an error when one of the factors is an exterior power

Ah yes!

@egourgoulhon
Copy link
Member Author

Changed commit from 31b0c07 to none

@egourgoulhon
Copy link
Member Author

Changed branch from public/manifolds/tensor_product_dual-34471 to none

@egourgoulhon
Copy link
Member Author

comment:11

Replying to @mkoeppe:

I would propose to close this in favor of #30241

Agreed

@egourgoulhon
Copy link
Member Author

Changed author from Eric Gourgoulhon to none

@egourgoulhon
Copy link
Member Author

Reviewer: Eric Gourgoulhon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants