-
-
Notifications
You must be signed in to change notification settings - Fork 565
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
FiniteDimensionalAlgebra.is_unitary is not sufficient #19473
Comments
Commit: |
Work Issues: check that it works (my sage is still compiling); test for speed regressions |
Branch: public/ticket/19473 |
Author: Darij Grinberg |
comment:2
The wrong claim "If a finite-dimensional algebra over a field admits a left identity, then this is the unique left identity, and it is also a right identity" is my fault (introduced in trac_12141_finite_algebras.patch at #12141). I have no idea what I was thinking... About the mutability: can't we just make the matrices in the table immutable using the |
comment:3
Maybe (I don't see a downside to this, but I know little of matrices in Sage...). But we'd have to make the list immutable too. |
comment:4
Replying to @darijgr:
As far as I know there is no downside, but I'm not an expert either.
Instead of a list, we could return a tuple (or an immutable sequence). |
comment:5
I would get rid of the We also need to fix the category, which is wrong for non-associative, non-unital cases. |
comment:6
OK, feel free to rollback my 2nd commit, which as I see just now is broken anyway. I'm all for immutability, though I am not sure if we want |
comment:7
Some things with New commits:
|
Changed branch from public/ticket/19473 to public/algebra/finite_dim_algebra_fixes-19473 |
Reviewer: Travis Scrimshaw |
Changed author from Darij Grinberg to Darij Grinberg, Travis Scrimshaw |
comment:8
BTW, the previous branch had doctest failures noted on the patchbot. |
Changed work issues from check that it works (my sage is still compiling); test for speed regressions to none |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:10
Actually my fix for the unitality assumed associativity. I need to fix it again to work in the magmatic case... |
comment:11
OK, now I am lost. |
Work Issues: clear up associativity requirement; if necessary, change superclass and is_unitary method |
comment:12
From what I see, there are no additional tests in |
comment:13
Replying to @tscrim:
How does introducing
I agree. It is unfortunate that refining the category after initialisation is possibly problematic. |
comment:14
Here is Johan Bosman's implementation of @cached_method
def is_unitary(self):
"""
Return True if ``self`` is unitary.
EXAMPLES::
sage: B = FiniteDimensionalAlgebra(QQ, [Matrix([[1,0],[0,1]]), Matrix([[0,1],[-1,0]])])
sage: B.is_unitary()
True
sage: C = FiniteDimensionalAlgebra(QQ, [Matrix([[0,0],[0,0]]), Matrix([[0,0],[0,0]])])
sage: C.is_unitary()
False
"""
n = self._degree
k = self.base_ring()
if n == 0:
self._one = vector(k, [])
return True
B1 = reduce(lambda x, y: x.augment(y),
self._table, Matrix(k, n, 0))
B2 = reduce(lambda x, y: x.augment(y),
self.left_table(), Matrix(k, n, 0))
# This is the vector obtained by concatenating the rows of the
# n times n identity matrix:
v = vector(k, (n - 1) * ([1] + n * [0]) + [1])
try:
sol1 = B1.solve_left(v)
sol2 = B2.solve_left(v)
except ValueError:
return False
if sol1 == sol2:
self._one = sol1
return True
else:
return False If this is correct, we can just re-use it. |
comment:15
Replying to @pjbruin:
We can separate off the table issues into a separate ticket, that is okay with me. Want me to do that?
The other option would be to add boolean parameters that do checks in the initialization (which would require some minor refactoring if we wanted to go the |
comment:16
Replying to @tscrim:
It seems to me that there are four mostly independent issues:
|
comment:17
Replying to @pjbruin:
Then let us just fix 1 here and use the changes on the current branch as a followup ticket. |
comment:18
+1 for splitting 1&2 | 3&4. This is particularly helpful to me, as I am fairly sure I can review 1&2, but probably not 3&4 these days. Johan Bosman's approach looks correct (mathematically -- haven't checked the programming). It isn't even necessary to check that the two identities are equal, since their existence already yields their equality. |
comment:19
Replying to @darijgr:
Indeed, I have now also convinced myself of this. This means that we can replace if sol1 == sol2:
self._one = sol1
return True
else:
return False by assert sol1 == sol2
return True (note that at this point the fact that |
comment:20
One more thing. The definition
of
because it is far better for the entries of |
Changed author from Darij Grinberg, Travis Scrimshaw to Peter Bruin |
Changed work issues from clear up associativity requirement; if necessary, change superclass and is_unitary method to none |
Changed branch from public/algebra/finite_dim_algebra_fixes-19473 to public/algebras/unitary_fd_algerba-19473 |
Changed reviewer from Travis Scrimshaw to Darij Grinberg, Travis Scrimshaw |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:23
LGTM, but I've added some doctests to make sure this doesn't regress. Positive review, if you agree. |
Changed branch from public/algebras/unitary_fd_algerba-19473 to |
Here is the semigroup algebra (over
QQ
) of the semigroup with two elements whose product is given byx*y == y
:Sage claims that it is unitary:
based on the following wrong concept:
On a slightly related note, the
table
method onFiniteDimensionalAlgebra
returns mutable matrices, and mutating them corrupts the algebra.CC: @sagetrac-sage-combinat @tscrim @nthiery
Component: algebra
Keywords: finite-dimensional algebra
Author: Peter Bruin
Branch/Commit:
366feae
Reviewer: Darij Grinberg, Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/19473
The text was updated successfully, but these errors were encountered: