Abstract
We address the practical issue that popular computation platforms like Matlab\(^{\copyright }\) are unable to perform the Jordan normal (canonical) form J and the associated transform matrix P on a high-dimension matrix. Given the knowledge of the eigenvalues and eigenvectors of n-square matrix A obtained on these platforms, we present an efficient algorithm of Jordan transform with detailed computation steps. The efficiency is demonstrated by comparing the simulation results of 11 examples with varying orders of n to that computed by the symbolic-based and capacity-limited routine \([P, J] = {\textsf {jordan}}(A)\) in Matlab\(^{\copyright }\). Applications in stochastic dynamics are addressed.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
1 Introduction
The similarity between square matrices is an important equivalence relationship in linear algebra. In complex field, not all square matrices can be diagonalized. But every square matrix is similar to a Jordan normal form, which is also called Jordan matrix, through a similarity transform known as the Jordan transform. Jordan matrix is an “almost diagonal” upper triangular matrix (or lower triangular matrix in some convention). Its diagonal elements are the eigenvalues of the matrix, and the form includes diagonal matrix as a special case. As long as the Jordan canonical form of a matrix is known, the linear-algebraic nature of the matrix can be seen at a glance. Jordan matrix plays an important role not only in algebraic theory, but also in physics and in engineering control [1, 2] etc.
For a set of linear-differential equations of constant coefficients, the Jordan canonical form can be employed in analyzing the properties of the solutions [3]. In further development, Frobenius first proposed one hundred years ago that a square matrix can be decomposed into the product of two symmetric matrices \(A_{n,n} = S_1S_2\) with one of the two being nonsingular [4]. The proposal was rediscovered by Taussky and Zassenhaus in 1959 [5]. Such a significant matrix factorization can be proved within the framework of Jordan transform [6,7,8]. More recently, Kwon, Ao and Thouless proved in stochastic system near fixed point that the strict Lyapunov function can be obtained with the help of Jordan transform [9]. The same can be extended to the work of Chen et al. since 2020 [10, 11].
Chen’s work explores the rich phenomena of nonlinear quasi limit cycles near fixed points and make connections to similar properties found in the field of artificial deep neural networks [12, 13]. The computational analysis requires the solution of continuous Lyapunov equation. It is highly desirable that we find another method that can be fully controlled and does not rely on the command of lyap in e.g. Matlab\(^{\copyright }\) when performing numerical simulations. Such a task may be accomplished by having an efficient algorithm of Jordan transform to improve the computational efficiency. The ability to overcome the limitation is of great significance in the relevant field of stochastic dynamical analysis.
There have been many studies on getting the Jordan canonical form. For example, Chi and Ye [14] studied the Jordan form by the singular value decomposition (SVD). But when the difference between the individual matrix elements becomes large, the work fails to obtain satisfying accuracy. For another example, Yu and Cheng [15] provided an algorithm for computing the Jordan canonical form using elementary transforms. The pressing problem is that on popular platforms one can not obtain the Jordan normal matrix and/or the transform matrix efficiently. In the case of Matlab\(^{\copyright }\), the Jordan matrix J and the transform matrix P is given by \([P, J] = {\normalsize {\textsf {jordan}}}(A)\). But the computation is actually carried out by symbolic manipulations hence is limited to very small dimensions. For an highly anisotropic n-square matrix A with \(n>12\), the command could simply fail to produce a result. Even on a block-like matrix, it can barely handle a size of \(n>50\). Such a capability is useless for practical applications. In this paper, we present a new algorithm to compute the Jordan transform. The success is demonstrated on e.g. the Matlab\(^{\copyright }\) platform.
2 Computational Logics
In complex field, an n-square matrix A has t distinct eigenvalues \(\{\lambda _1, \lambda _2, \ldots , \lambda _t\}\), corresponding to \(s\ge t\) linearly independent eigenvectors. Let the algebraic multiplicity of eigenvalue \(\lambda _i\) (\(i\in [1,t]\)) be \(m_i\) in the Jordan form, with the geometric multiplicity \(\rho _i\) that corresponds to the order of the eigenspace for the ith eigenvalue. In other words, eigenvalue \(\lambda _i\) has \(\rho _i\) linearly independent eigenvector(s). We have \(\sum _{i=1}^t m_i = n\), \(m_i \ge \rho _i\), and \(\sum _{i=1}^t \rho _i = s\le n\). When \(s = n\), matrix A is diagonalizable. Namely, there exists an \(n^{\text{th}}\)-order invertible matrix M such that \(M^{-1}AM\) becomes a diagonal matrix in which the diagonal elements are the eigenvalues of matrix A. But when \(s < n\), matrix A has multiple eigenvalue(s) \(\lambda _i\), whose \(m_i > \rho _i\). In this case, the n-square matrix A is not diagonalizable. There is an \(n\)th-order invertible matrix P satisfying
The matrix J is the Jordan normal form, which is similar to the matrix A. In the above, the square matrix \(J_{ij} (\lambda _i)\) (\(j = 1, 2, \ldots , \rho _i\)) is a Jordan block, which can be written as:
where \(J_{ij}(\lambda _i)\) is a \(k_{j}\)th-order square matrix, and \(\sum _{j = 1} ^{\rho _i} \text{dim} (J_{ij}(\lambda _{i})) = \sum _{j=1} ^{\rho _i} k_{j} = m_i\).
In order to obtain the Jordan normal form of n-square matrix A, we first need to find the transform matrix \(P = \{P_1, P_2,\ldots , P_t\}\), where \(P_i = \{P_{i1}, P_{i2},\ldots , P_{i\rho _i}\}\), and \(P_{ij}\) is a column vector array. In a single Jordan block \(J_{ij} (\lambda _i)\), the corresponding eigenvectors \(P_{ij} = \{u_1, u_2,\ldots , u_{k_{j}}\}\) satisfy:
where we have dropped the subscript j on k for simplicity. Introducing a matrix \(N_{i} = A-\lambda _iI\), Eq. (4) can be rewritten as:
where we have dropped the subscript i on \(N_{i}\) for the same reason. The relationship in Eq. (4) or (5) is called Jordan chain. Where \(u_1\) is the eigenvector and \(\{u_2,\ldots , u_{k_j}\}\) are generalized eigenvectors of matrix A, which are respectively in the null-space of matrix N [i.e. \(\text{kernel}(N)\)] and the generalized eigenspace [i.e. \(\text{kernel}(N^{m_i})\)]. According to Eq. (5), \(N^{k} u_{k} = 0\) (and \(1 < k \le m_i\)), so that \(N^{m_i} u_{k} = 0\). Therefore, the generalized eigenvector \(u_k\) can be obtained from a basis of \(N^{m_i}\) with zero eigenvalue and then the eigenvector \(u_1\) can be deduced inversely. Eventually the reversible matrix P can be found and the Jordan transform of square matrix A is realized.
3 Implementation of Jordan Transform
In accordance with the computational logics presented in Sect. 2, a flow chat of the algorithm proposed for Jordan transform is shown in Fig. 1. For a given n-square matrix A, the specific steps are as follows.
(1) Compute the eigenvalues \(\Lambda = \{\lambda _i\}\) and eigenvectors \(V = \{v_i\}\) of A;
(2) Record the eigenvalues and the corresponding algebraic multiplicity \(\{\lambda _i, m_i\}\) \((i =1, 2,\ldots , t);\)
(3) Judgment: If all the algebraic multiplicities equal 1, that is \(\forall\) i, \(m_i \equiv 1\), the matrix A is diagonalizable. In this case, \(P = V\) and \(J = \Lambda\) is a diagonal matrix;
(4) Judgment: Else for each \(m_{i} > 1\), compute the geometric multiplicity of the eigenvalue. If the algebraic multiplicities equal to their geometric multiplicities for all of them, that is \(\forall\) \(m_i >1\), \(m_i \equiv \rho _i\), A is also diagonalizable. We too have \(P = V\) and the diagonal \(J = \Lambda ;\)
(5) Failing on the conditions set in steps (3) and (4), A is not diagonalizable. Single out those eigenvalues with \(m_i = \rho _i\), each of their “Jordan blocks” reduces to an \(m_i\)th-order diagonal square matrix with the element \(\lambda _i\). In this case, \(P_i = \{v_i\}\) (multiple columns);
(6) When \(m_i > \rho _i\), there are 2 or more Jordan blocks corresponding to \(\lambda _i\). Let \(N = A-\lambda _iI\), \(N_p = N^{m_i}\), and record the corresponding null-space \(S = \text{kernel}(N)\), \(G = \text{kernel}(N_p);\)
(7) The column vector arrays S and G recorded in step (6) are respectively the space composed of eigenvectors and that of the generalized eigenvectors. From the two we can obtain the column vector array R that is not in S: \(R = \{ r_k \mid r_k \in G, r_k \notin S \}\), \(1 \le k \le R_c\), where \(R_c\) is the number of columns in R and the columns in array R are mutually orthogonal;
(8) Construct an array of columns for each column in the column vector array R: Let \(p_k = [r_k]\), compute \(Nr_k\) and add the result to \(p_k\), i.e. \(p_k = [Nr_k, p_k]\) (in Matlab\(^{\copyright }\) language). Repeat the procedure with \(r_k = Nr_k\) until \(Nr_k = 0\) (maximum \(m_i\) iterations);
(9) When \(R_c \ge 2\), it is necessary to check the validity of the column vector array \(p_k\). The leftist column in \(p_k\) must be in the space of S so that \(Np_k(:,1) = 0\) (in Matlab\(^{\copyright }\) language, and \(p_k(:,1)\) refers to the leftist column or the first column in the vector array \(p_k\)). Otherwise it is removed. If the dimension of the array of two first columns \(\text{dim}([p_k(:,1), p_{k'}(:,1)]) = 1\), the two vector groups \(p_k\) and \(p_{k'}\) are equivalent, corresponding to the same Jordan block. In this case, the longer array is kept: \(k = \{\text{max}\{\text{dim}(p_k), \text{dim}(p_{k'})\}\}_{(k,k')}\), \(P_{ik} = p_k\). When \(\text{dim}([p_k(:,1), p_{k'}(:,1)]) > 1\), both are retained;
(10) The (generalized) eigenvector group \(P_{ik}\) corresponding to each Jordan block can be so obtained through step (9). But it is necessary to further check if some eigenvectors in S are left out. If so add them to the array of \(p_i\): \(p_i = \{p_i \in S, p_i \notin \{P_{ik}\} \}\);
(11) After steps (5)–(10), the generalized eigenvector group for the ith eigenvalue is
(12) Output the transform matrix P and the Jordan normal form J of n-square matrix A as
4 Results
The effectiveness of the new routine \(([P, J] = {\normalsize {\textsf {newjordan}}}(A))\) proposed in this paper may be verified by comparing it with \([P_1, J_1] = {\normalsize {\textsf {jordan}}}(A)\), the Jordan transform routine in Matlab\(^{\copyright }\). Due to the ordering of eigenvalues, the sequence of the resulting Jordan blocks may be different. The check the difference, it is sufficient to define a pseudo error \(\varepsilon = \Vert \sum _i^{n}\sum _j^{n}\Vert a_{ij}\Vert - \sum _i^{n}\sum _j^{n}\Vert b_{ij}\Vert \Vert\), where \(a_{ij}\) and \(b_{ij}\) are the matrix elements of \(J_1\) and J respectively.
Take the 6 low-order square matrices \(A_i\) (\(i = 1,2,\ldots , 6\)) as examples 1 to example 6,
Then we combine them to get Example 7 and Example 8 as \(A_7 = \text{diag}(A_1, A_2, A_3, A_4, A_5, A_6)\) and \(A_8 = \text{diag}(A_7, A_7)\). Finally, make three random rows \(A_{9, 10, 11}^{\prime } = \text{round}(\text{rand}(n)*10)\) with order \(n = 5, 10, 1000\), and let \(A_9 = \text{diag}(A_9^{\prime }, A_1)\), \(A_{10} = \text{diag}(A_{10}^{\prime }, A_1)\) and \(A_{11} = \text{diag}(A_{11}^{\prime }, A_1)\) be examples 9~11 (We will not show \(A _{11}^{\prime }\) in this paper as \(n=1000\) is too large).
On a Matlab\(^{\copyright }\) platform, the computation times for the two routines jordan and newjordan and the errors between them are shown in Table 1 (not recorded if the times exceeded 10 min). They are averaged over five calculations for each sample.
5 Discussions
We conclude this work with exemplary discussions relevant to real applications. Consider a set of stochastic differential equation
where x is a multidimensional vector and \(\zeta\) is a random noise. According to the structural analysis of stochastic dynamics near a fixed point published in PNAS [9], the equations can be decomposed into
In the above, the matrix D is symmetric and semi-positive definite, the matrix Q is antisymmetric, and U is symmetric. On a stable fixed point and setting D to the diffusion matrix by \(\zeta (t)\), U becomes a semi-positive matrix for the thermodynamic potential, a crucial functional for various physical analyses.
Based on the symmetry and antisymmetry of the matrices, one can obtain
This is a type of continuous Lyapunov equation. For real symmetric F, Eq. (12) can be rewritten as
Here \(\lambda _{\alpha , \beta }\) are the eigenvalues of F. \({\tilde{Q}}_{\alpha \beta }\) are \({\tilde{D}}_{\alpha \beta }\) are the matrix elements of Q and D under the representation of F.
But for general cases it is necessary to consider the Jordan transform of the F,
where the matrix \(L^{-1}\) is the transform matrix computed in this paper and \(\Lambda\) is the corresponding Jordan matrix. Similarly, in the representation of matrix F, \({\tilde{Q}} = LQL^{T}, {\tilde{D}} = LDL^{T}\), the upper triangular matrix elements (\(\alpha < \beta\)) of matrix \({\tilde{Q}}\) can be expressed as:
Complete details can be found in [9].
To summarize, this paper discusses how to effectively calculate the Jordan canonical form and the transform matrix of nth-order square matrix A on popular platforms like Matlab\(^{\copyright }\). The eigenvalues, eigenvectors and generalized eigenvectors of an n-square A provides new insights into the Jordan transform. On a very general consideration, the new algorithm proposed realizes Jordan transform without the limitation by the order of the matrix. It quickly gives the Jordan normal form J and the corresponding transform matrix P. When dealing with practical problems, such as the high-dimensional complex, nonlinear systems presented in [10, 11, 16, 17], the method may play a crucial role and improve the computational efficiency.
Availability of Data and Material
The necessary formulae and the steps to perform the computations are detailed in IMPLEMENTATION OF JORDAN TRANSFORM. This does not need a specific platform or a specially purposed software package. The data used to justify the results and conclusions of this work are entirely presented within the body of the manuscript. The code used in this paper is available upon request from chenyongcong@shu.edu.cn.
References
Yu, R.F., Zhou, X.Y., Yuan, M.Q.: The practical step-by-step procedure of high-order dynamic response analysis for general damped system. In: International Conference on Applied Materials and Electronics Engineering. vol. 378–379, pp. 161–165 (2012)
Yevstafyeva, V.V.: Existence of t/k-periodic solutions of a nonlinear nonautonomous system whose matrix has a multiple eigenvalue. Math Notes. 109(3–4), 551–562 (2021)
Horn, R.A., Johnson, C.R.: Matrix Analysis, pp. 121–142. Cambridge University Press, Cambridge (1990)
Frobenius, F.G.: Über die Mit Einer Matrix Vertauschbaren Matrizen, pp. 3–15. Sitzungsber. Preuss. Akad. Wiss., Berlin (1910)
Taussky, O., Zassenhaus, H.: On the similarity transformation between a matrix and its transpose. Pac. J. Math. 9(3), 893–896 (1959)
Bosch, A.J.: Note on the factorization of a square matrix into two Hermitian or symmetric matrices. SIAM Rev. 29(3), 463–468 (1987)
Uhlig, F.: Computing matrix symmetrizers, finally possible via the Huang and Nong algorithm. Linear Multilinear A. 61(7), 954–969 (2014)
Dopico, F., Uhlig, F.: Computing matrix symmetrizers, part 2: New methods using eigendata and linear means; a comparison. Linear Algebra Appl. 504, 590–622 (2016)
Kwon, C., Ao, P., Thouless, D.J.: Structure of stochastic dynamics near fixed points. Proc. Natl. Acad. Sci. 102, 13029–13033 (2005)
Chen, Y.-C., Shi, C.X., Kosterlitz, J.M., Zhu, X.M., Ao, P.: Global potential, topology, and pattern selection in a noisy stabilized Kuramoto–Sivashinsky equation. Proc. Natl. Acad. Sci. 117(38), 23227–23234 (2020)
Chen, Y.-C., Shi, C.X., Kosterlitz, J.M., Zhu, X.M., Ao, P.: Topology, vorticity and limit cycle in a stabilized Kuramoto–Sivashinsky equation. Proc. Natl. Acad. Sci. 119(49), 2211359119 (2022)
Pratik, C., Stefano, S.: Stochastic gradient descent performs variational inference, converges to limit cycles for deep networks. In: International Conference on Learning Representations (2018)
Feng, Y., Tu, Y.: The inverse variance–flatness relation in stochastic gradient descent is critical for finding flat minima. Proc. Natl. Acad. Sci. 118(9), 2015617118 (2021)
Chi, B., Ye, Q.K.: Computing the eigenvectors of a matrix with multiplex eigenvalues by SVD method. Appl. Math. Mech-ENGL. 25(3), 257–262 (2004)
Yu, M.J., Cheng, X.H.: An algorithm for the Jordan canonical form and the transition matrix. In: IEEE International Conference of Online Analysis and Computing Science. pp. 235–238 (2016)
**ong, X., Chen, Y.-C., Shi, C.X., Ao, P.: On the stochastic gradient descent and inverse variance–flatness relation in artificial neural networks. Ar**v preprint. ar**v:2207.04932
Bohmer, C.G., Harko, T.: Nonlinear stability analysis of the Emden–Fowler equation. J. Nonlinear Math. Phys. 17(4), 503–516 (2010)
Acknowledgements
This work was supported in part by the National Natural Science Foundation of China no. 16Z103060007 (PA).
Funding
This work was supported in part by the National Natural Science Foundation of China no. 16Z103060007 (PA).
Author information
Authors and Affiliations
Contributions
CX designed and performed the research; CX and Y-C analyzed data, wrote the manuscript; Y-C, X and P revised the manuscript.
Corresponding author
Ethics declarations
Conflict of interest
The authors declare no competing interest.
Ethics Approval
Not applicable.
Consent to Participate
Not applicable.
Consent for Publication
Not applicable.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Shi, C., Chen, YC., **ong, X. et al. Computation of Large-Dimension Jordan Normal Transform via Popular Platforms. J Nonlinear Math Phys 30, 834–842 (2023). https://doi.org/10.1007/s44198-023-00108-6
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s44198-023-00108-6