Skip to content

Problems when multiplying a matrix object with a matrix#6240

Open
ThomasBreuer wants to merge 5 commits intogap-system:masterfrom
ThomasBreuer:TB_MatrixObj_mult_Matrix
Open

Problems when multiplying a matrix object with a matrix#6240
ThomasBreuer wants to merge 5 commits intogap-system:masterfrom
ThomasBreuer:TB_MatrixObj_mult_Matrix

Conversation

@ThomasBreuer
Copy link
Contributor

addresses #6221

The idea is to catch the multiplication of a non-list IsMatrixObj with an IsMatrix by dedicated methods for \*.

For that, new \* methods for the multiplication of IsGF2MatrixRep with an IsMatrix and of Is8BitMatrixRep with IsMatrix get installed; this is anyhow a good idea because these multiplications were up to now executed by the default list arithmetic.

Besides that, the DisplayString and ViewString methods for IsMatrixObj were fixed; up to now, they were applicable also for IsMatrix.

`IsGF2MatrixRep` and `Is8BitMatrixRep` describe matrices
that are in `IsMatrix and IsMatrixObj`.
Thus these matrices must obey the rules of list arithmetics,
in particular the multiplication of these matrices with other matrices in
`IsMatrix` is defined.

Up to now, the methods that are chosen for such matrix multiplications
are the generic methods.
Now we install `PROD_LIST_SCL_DEFAULT` explicitly as a method.

First of all, this removes some overhead.
(Note that such multiplications really occur in practice,
as one can see in the testfiles:
For example, construct a matrix group with `CyclicGroup` or `GL`;
the generators are in `IsGF2MatrixRep` or `Is8BitMatrixRep` if possible,
due to `ImmutableMatrix`.
Then construct a right coset of this group by prescribing a representative
that is in `IsPlistRep`, and do some computations with it;
multiplications "of mixed type" will happen.)

Second, this yields high ranked methods such that it will be possible
to install `\*` methods of lower rank that signal an error if one tries
to multiply a *non-list* `IsMatrixObj` with an `IsMatrix`.
The multiplication of an `IsMatrixObj` that is *not* in `IsMatrix`
with an `IsMatrix` shall not be allowed, the result is not defined
(and the results without the new methods can be surprising).
Up to now, `ViewString` and `DisplayString` returned something
that makes sense only for objects in `MatrixObj`,
not for `IsMatrix`.

(I had introduced this bug in 2021, apparently the two functions
are not used, otherwise the problem would have been observed earlier.)
@ThomasBreuer ThomasBreuer added kind: bug Issues describing general bugs, and PRs fixing them topic: library release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes labels Feb 18, 2026
@fingolfin
Copy link
Member

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

Labels

kind: bug Issues describing general bugs, and PRs fixing them release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes topic: library

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants