ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 25 Apr 2024 05:22:20 +0200Sage produces non-invertible transformation matrix to SR Jordan formhttps://ask.sagemath.org/question/77072/sage-produces-non-invertible-transformation-matrix-to-sr-jordan-form/Consider the following matrix:
`M = 1/4 * matrix([(0, 0, -(I + 1)*sqrt(2), -(I + 1)*sqrt(2), (I + 1)*sqrt(2), (I + 1)*sqrt(2)),
(0, 0, -(I - 1)*sqrt(2), (I - 1)*sqrt(2), (I - 1)*sqrt(2), -(I - 1)*sqrt(2)),
((I - 1)*sqrt(2), (I - 1)*sqrt(2), I - 1, I - 1, I - 1, I - 1),
(-(I + 1)*sqrt(2), (I + 1)*sqrt(2), -I - 1, I + 1, -I - 1, I + 1),
((I - 1)*sqrt(2), (I - 1)*sqrt(2), -I + 1, -I + 1, -I + 1, -I + 1),
(-(I + 1)*sqrt(2), (I + 1)*sqrt(2), I + 1, -I - 1, I + 1, -I - 1)])`
The matrix `M` is diagonalizable. Indeed, let ` z = exp(i*pi/3)`; then `M` is similar to `J = diagonal_matrix([ -1, -1, z, z, z.conjugate(), z.conjugate() ])`. For example, one can use `matrix(QQbar, M).is_similar(matrix(QQbar, J))` to obtain a similarity transformation. We must embed M (implicitly defined over SR) into QQbar to have exactness to perform the similarity computation. Indeed, both `M.is_similar(J)` and `M.diagonalization()` raise respectively `TypeError` and `ValueError` as expected. Since `M` is diagonalizable, the diagonalization agrees (up to permutation) with the Jordan form `matrix(QQbar, M).jordan_form()` as expected.
In SageMath version 10.4.beta3 as well as 9.5 I can also run `M.jordan_form()` with no errors thrown; the answer agrees with `matrix(QQbar, M).jordan_form()`. However, `matrix(QQbar, M).jordan_form(transformation=True)` and `M.jordan_form(transformation=True)` do not agree; the latter produces a transformation matrix that is not invertible!
The documentation for Matrix_symbolic_dense.jordan_form suggests that matrices over SR support Jordan form with the transformation flag set to true--why in this case does Sage appear to produce a non-invertible transformation matrix for a correctly computed Jordan form? Or should I in general be converting away from SR to perform similarity transformations in Sage?
swhiteheadThu, 25 Apr 2024 05:22:20 +0200https://ask.sagemath.org/question/77072/Who is the encoder of jordan_form in SageMath?https://ask.sagemath.org/question/65752/who-is-the-encoder-of-jordan_form-in-sagemath/One month ago, the following question involving the function jordan_form was posted https://ask.sagemath.org/question/65314/jordan-form-and-simultaneous-diagonalization/ but it got no answer.
Answering this question requires to know how the function jordan_form was encoded, so it may be more relevant to ask directly the one who encoded this function in SageMath. Who is it?Sébastien PalcouxThu, 05 Jan 2023 08:11:34 +0100https://ask.sagemath.org/question/65752/Jordan form and simultaneous diagonalizationhttps://ask.sagemath.org/question/65314/jordan-form-and-simultaneous-diagonalization/Let $m$ be a block diagonal matrix $diag(b_1, \dots, b_m)$. Let $(p_i)$ be the orthogonal projections such that $b_i = p_i m p_i$. If we compute the Jordan form of $m$ using SageMath as follows:
sage: jf, q = m.jordan_form(transformation=True)
**Question 1**: Does SageMath computes the Jordan form of $m$ by computing the Jordan form of each $b_i$?
(more precisely, $p_i$ commutes with $\pi^{-1} q \pi$, for some permutation matrix $\pi$?).
In fact, what we are really interested in here is the simultanenous diagonalization: let $m$, $n$ be two simultaneously diagonalizable matrix. Make the following:
sage: jf1, q1 = m.jordan_form(transformation=True)
sage: nn= ~q1 * n * q1
sage: jf2, q2 = nn.jordan_form(transformation=True)
**Question 2**: Is it true that the change-of-basis matrix $q=q_1q_2$ both diagonalizes $m$ and $n$?
A positive answer to Q1 should imply a positive answer to Q2.
If you know a better way to make simultaneous diagonalization, please let me know. More generally, we are also interested in simultaneous block-diagonalization, more precisely, if $m$ and $n$ does not commute, the $*$-algebra they generate is isomorphic to $\bigoplus_i M_{n_i}(\mathbb{C})$ with at least one $i$ such that $n_i>1$, and we are interested in the block-diagonalization according to this decomposition.Sébastien PalcouxSun, 11 Dec 2022 10:08:28 +0100https://ask.sagemath.org/question/65314/How does SageMath compute the Jordan form of a block diagonal matrix?https://ask.sagemath.org/question/65313/how-does-sagemath-compute-the-jordan-form-of-a-block-diagonal-matrix/ Let $M$ be a block diagonal matrix $diag(B_1, \dots, B_m)$. Let $(p_i)$ be the orthogonal projections such that $B_i = p_i M p_i$. If you compute the Jordan form of $M$ using SageMath as follows:
sage: jf, q = M.jordan_form(transformation=True)
**Question**: Is it true that $q$ commutes with $p_i$ for all $i$?
It would be true if SageMath computes the Jordan form of $M$ by computing the Jordan form of each $B_i$.Sébastien PalcouxSun, 11 Dec 2022 10:08:27 +0100https://ask.sagemath.org/question/65313/