Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit bd3334c

Browse files
author
Release Manager
committed
Trac #30518: eigenvectors over QQbar are incorrectly conjugated
Eigenvectors over QQbar could get incorrectly conjugated. In the following example from [https://groups.google.com/g/sage- devel/c/9Ss98-XKR9c devel], the eigenvectors of a matrix over `QuadraticField(-1)` are computed in two ways, one of which incorrectly returns the conjugate of some eigenvectors. By converting the matrix to `QQbar` first: {{{ sage: K.<i> = QuadraticField(-1) sage: m = matrix(K, 4, [2,4*i,-i,0, -4*i,2,-1,0, 2*i,-2,0,0, 4*i+4, 4*i-4,1-i,-2]) sage: sorted([(e, matrix.column(vs)) for e, vs, _ in m.change_ring(QQbar).eigenvectors_right()]) [( [ 1 0] [1*I 0] [ 0 0] -2, [ 0 1] ), ( [ 1.000000000000000? + 0.?e-16*I] [ 0.?e-16 - 1.000000000000000?*I] [ 0.?e-16 - 6.605551275463989?*I] -0.6055512754639893?, [1.000000000000000? + 1.000000000000000?*I] ), ( [ 1.000000000000000? + 0.?e-17*I] [ 0.?e-17 - 1.000000000000000?*I] [ 0.?e-17 + 0.6055512754639893?*I] 6.605551275463989?, [1.000000000000000? + 1.000000000000000?*I] )] }}} Supposedly, this result is correct. In contrast, computing the eigenvectors directly, without first converting to `QQbar`, leads to some eigenvectors getting conjugated: {{{ sage: sorted([(QQbar(e), matrix.column(QQbar, vs)) for e, vs, _ in m.eigenvectors_right()]) [( [1 0] [I 0] [0 0] -2, [0 1] ), ( [ 1] [ 0.?e-54 + 1.000000000000000?*I] [ 0.?e-53 + 6.605551275463989?*I] -0.6055512754639893?, [1.000000000000000? - 1.000000000000000?*I] ), ( [ 1] [ 0.?e-53 + 1.000000000000000?*I] [ 0.?e-52 - 0.6055512754639893?*I] 6.605551275463989?, [1.000000000000000? - 1.000000000000000?*I] )] }}} Note that the `QuadraticField` constructor automatically sets an embedding. {{{ sage: K.coerce_embedding() Generic morphism: From: Number Field in i with defining polynomial x^2 + 1 with i = 1*I To: Complex Lazy Field Defn: i -> 1*I }}} URL: https://trac.sagemath.org/30518 Reported by: gh-mwageringel Ticket author(s): Vincent Delecroix Reviewer(s): Marc Mezzarobba
2 parents de9c3d5 + c227dad commit bd3334c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/sage/matrix/matrix2.pyx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6590,6 +6590,12 @@ cdef class Matrix(Matrix1):
65906590
doctest:...: DeprecationWarning: "extend" should be used as keyword argument
65916591
See https://trac.sagemath.org/29243 for details.
65926592
[]
6593+
6594+
Check :trac:`30518`::
6595+
6596+
sage: K.<i> = QuadraticField(-1)
6597+
sage: m = matrix(K, 4, [2,4*i,-i,0, -4*i,2,-1,0, 2*i,-2,0,0, 4*i+4, 4*i-4,1-i,-2])
6598+
sage: assert all(m*v == e*v for e, vs, _ in m.eigenvectors_right() for v in vs)
65936599
"""
65946600
if other is not None:
65956601
if isinstance(other, bool):

0 commit comments

Comments
 (0)