Matrices and Spaces of Matrices¶
Sage provides native support for working with matrices over any
commutative or noncommutative ring. The parent object for a matrix
is a matrix space MatrixSpace(R, n, m) of all
\(n\times
m\) matrices over a ring \(R\).
To create a matrix, either use the matrix(...)
function or create a matrix space using the
MatrixSpace command and coerce an object into it.
Matrices also act on row vectors, which you create using the
vector(...) command or by making a
VectorSpace and coercing lists into it. The natural
action of matrices on row vectors is from the right. Sage currently
does not have a column vector class (on which matrices would act
from the left), but this is planned.
In addition to native Sage matrices, Sage also includes the following additional ways to compute with matrices:
Several math software systems included with Sage have their own native matrix support, which can be used from Sage. E.g., PARI, GAP, Maxima, and Singular all have a notion of matrices.
The GSL C-library is included with Sage, and can be used via Cython.
The
scipymodule provides support for sparse numerical linear algebra, among many other things.The
numpymodule, which you load by typingimport numpyis included standard with Sage. It contains a very sophisticated and well developed array class, plus optimized support for numerical linear algebra. Sage’s matrices over RDF and CDF (native floating-point real and complex numbers) use numpy.
Finally, this module contains some data-structures for matrix-like objects like operation tables (e.g. the multiplication table of a group).
- Matrix Spaces
- General matrix Constructor and display options
- Constructors for special matrices
- Helpers for creating matrices
- Matrices over an arbitrary ring
- Base class for matrices, part 0
- Base class for matrices, part 1
- Base class for matrices, part 2
- Generic Asymptotically Fast Strassen Algorithms
- Minimal Polynomials of Linear Recurrence Sequences
- Base class for dense matrices
- Base class for sparse matrices
- Dense Matrices over a general ring
- Sparse Matrices over a general ring
- Dense matrices over the integer ring
- Sparse integer matrices
- Modular algorithm to compute Hermite normal forms of integer matrices
- Saturation over ZZ
- Dense matrices over the rational field
- Sparse rational matrices
- Dense matrices using a NumPy backend
- Dense matrices using a NumPy backend
- Dense matrices over the Real Double Field using NumPy
- Dense matrices over GF(2) using the M4RI library
- Dense matrices over \(\GF{2^e}\) for \(2 \leq e \leq 16\) using the M4RIE library
- Dense matrices over \(\ZZ/n\ZZ\) for \(n < 94906266\) using LinBox’s
Modular<double> - Dense matrices over \(\ZZ/n\ZZ\) for \(n < 2^{8}\) using LinBox’s
Modular<float> - Dense matrices over \(\Zmod{n}\) for \(n < 2^{64}\) using FLINT
- Sparse matrices over \(\ZZ/n\ZZ\) for \(n\) small
- Symbolic dense matrices
- Symbolic sparse matrices
- Dense matrices over the Complex Double Field using NumPy
- Arbitrary precision complex ball matrices
- Dense matrices over univariate polynomials over fields
- Dense matrices over multivariate polynomials over fields
- Matrices over Cyclotomic Fields
- Operation Tables
- Actions used by the coercion model for matrix and vector multiplications
- Functions for changing the base ring of matrices quickly
- Echelon matrices over finite fields.
- Miscellaneous matrix functions
- Matrix windows
- Misc matrix algorithms
- Misc matrix algorithms using MPFR
- Misc matrix algorithms using FLINT
- Calculate symplectic bases for matrices over fields and the integers.
- \(J\)-ideals of matrices
- Benchmarks for matrices
Indices and Tables¶
Bibliography
R.B.J.T Allenby and A. Slomson, How to count, CRC Press (2011)
Christian Bär. The Faddeev-LeVerrier algorithm and the Pfaffian. https://arxiv.org/abs/2008.04247, 2020.
G. Bard. Accelerating Cryptanalysis with the Method of Four Russians. Cryptography E-Print Archive (http://eprint.iacr.org/2006/251.pdf), 2006.
Tomas J. Boothby and Robert W. Bradshaw. Bitslicing and the Method of Four Russians Over Larger Finite Fields. https://arxiv.org/abs/0901.1413, 2009.
Bernhard Beckermann. A reliable method for computing M-Padé approximants on arbitrary staircases. J. Comput. Appl. Math., 40(1):19-42, 1992. https://doi.org/10.1016/0377-0427(92)90039-Z.
Bernhard Beckermann, George Labahn. Fraction-Free Computation of Matrix Rational Interpolants and Matrix GCDs. SIAM J. Matrix Anal. Appl. 22 (2000) 114-144. https://doi.org/10.1137/S0895479897326912
Robert A. Beezer, A First Course in Linear Algebra, https://linear.pugetsound.edu/. Accessed 15 July 2010.
James R. Bunch and Linda Kaufman. Some Stable Methods for Calculating Inertia and Solving Symmetric Linear Systems. Mathematics of Computation, 31(137):163-179, 1977.
Bernhard Beckermann, George Labahn. A Uniform Approach for the Fast Computation of Matrix-Type Padé Approximants. SIAM J. Matrix Anal. Appl. 15 (1994) 804-823. https://doi.org/10.1137/S0895479892230031
Bernhard Beckermann, George Labahn, and Gilles Villard. Shifted normal forms of polynomial matrices. In ISSAC’99, pages 189-196. ACM, 1999. https://doi.org/10.1145/309831.309929.
Bernhard Beckermann, George Labahn, and Gilles Villard. Normal forms for general polynomial matrices. J. Symbolic Comput., 41(6):708-737, 2006. https://doi.org/10.1016/j.jsc.2006.02.001.
P. Butera and M. Pernici Sums of permanental minors using Grassmann algebra, International Journal of Graph Theory and its Applications, 1 (2015), 83-96. https://arxiv.org/abs/1406.5337
Frank Celler and C. R. Leedham-Green, Calculating the Order of an Invertible Matrix, 1997
Andreas W.M. Dress and Walter Wenzel, A Simple Proof of an Identity Concerning Pfaffians of Skew Symmetric Matrices, Advances in Mathematics, volume 112, Issue 1, April 1995, pp. 120-134. https://doi.org/10.1006/aima.1995.1029
S. Fomin and A. Zelevinsky. Cluster algebras I. Foundations, J. Amer. Math. Soc. 15 (2002), no. 2, pp. 497-529. https://arxiv.org/abs/math/0104151 (2001).
G. Golub and C. van Loan. Matrix Computations. 3rd edition, Johns Hopkins Univ. Press, 1996.
Pascal Giorgi and Vincent Neiger. Certification of Minimal Approximant Bases. In ISSAC 2018, pages 167-174. https://doi.org/10.1145/3208976.3208991
Hoffman, Alan J., Anthonius Wilhelmus Johannes Kolen, and Michel Sakarovitch. Totally-balanced and greedy matrices. SIAM Journal on Algebraic Discrete Methods 6.4 (1985): 721-730.
Nicholas J. Higham. Accuracy and Stability of Numerical Algorithms, Second Edition. Society for Industrial and Applied Mathematics, Philadelphia, 2002.
Clemens Heuberger and Roswitha Rissner, Computing \(J\)-Ideals of a Matrix Over a Principal Ideal Domain, https://arxiv.org/abs/1611.10308, 2016.
Claude-Pierre Jeannerod, Vincent Neiger, Eric Schost, and Gilles Villard. Fast Computation of Minimal Interpolation Bases in Popov Form for Arbitrary Shifts. In Proceedings ISSAC 2016 (pages 295-302). https://doi.org/10.1145/2930889.2930928
Claude-Pierre Jeannerod, Vincent Neiger, Eric Schost, and Gilles Villard. Computing Minimal Interpolation Bases. J. Symb. Comput. 83, 2017 (pp 272–314). https://doi.org/10.1016/j.jsc.2016.11.015
Thomas Kailath. Linear Systems, Prentice-Hall, 1980.
Donald E. Knuth, Overlapping Pfaffians, https://arxiv.org/abs/math/9503234v1.
James Kuzmanovich; Andrey Pavlichenkov, Finite Groups of Matrices Whose Entries Are Integers, The American Mathematical Monthly, Vol. 109, No. 2. (2002) pp. 173-186
Hans Liebeck and Anthony Osborne. The Generation of All Rational Orthogonal Matrices. The American Mathematical Monthly, 98(2):131-133, 1991.
Lubiw, Anna. Doubly Lexical Orderings of Matrices. SIAM Journal on Computing 16.5 (1987): 854-879.
T. Mulders, A. Storjohann, On lattice reduction for polynomial matrices, J. Symbolic Comput. 35 (2003), no. 4, 377–401
M. Orlitzky. The Lyapunov rank of an improper cone. Optimization Methods and Software, 32(1):109-125, 2017, https://doi.org/10.1080/10556788.2016.1202246.
V. M. Popov. Invariant description of linear, time-invariant controllable systems. SIAM Journal on Control, 10(2):252-264, 1972. https://doi.org/10.1137/0310020
J. Riordan, An Introduction to Combinatorial Analysis, Dover Publ. (1958)
Roswitha Rissner, Null ideals of matrices over residue class rings of principal ideal domains. Linear Algebra Appl., 494 (2016) 44-69. https://doi.org/10.1016/j.laa.2016.01.004.
Gunter Rote, Division-Free Algorithms for the Determinant and the Pfaffian: Algebraic and Combinatorial Approaches, H. Alt (Ed.): Computational Discrete Mathematics, LNCS 2122, pp. 119-135, 2001. https://page.mi.fu-berlin.de/rote/Papers/pdf/Division-free+algorithms.pdf
C. P. Schnorr and H. H. Hörner. Attacking the Chor-Rivest Cryptosystem by Improved Lattice Reduction. Advances in Cryptology - EUROCRYPT ‘95. LNCS Volume 921, 1995, pp 1-12.
A. Storjohann, An O(n^3) algorithm for Frobenius normal form. Proceedings of the International Symposium on Symbolic and Algebraic Computation (ISSAC’98), ACM Press, 1998, pp. 101-104.
A. Storjohann, Algorithms for Matrix Canonical Forms. Ph.D. Thesis. Department of Computer Science, Swiss Federal Institute of Technology – ETH, 2000.
A. Storjohann, Email Communication. 30 May 2011.
Lloyd N. Trefethen and David Bau III, Numerical Linear Algebra, SIAM, Philadelphia, 1997.
Marc Van Barel and Adhemar Bultheel. “A general module theoretic framework for vector M-Padé and matrix rational interpolation.” Numer. Algorithms, 3:451-462, 1992. https://doi.org/10.1007/BF02141952
Watkins, David S. Fundamentals of Matrix Computations, Third Edition. Wiley, Hoboken, New Jersey, 2010.
W. A. Wolovich. Linear Multivariable Systems, Applied Mathematical Sciences (volume 11). Springer-Verlag New-York, 1974. https://doi.org/10.1007/978-1-4612-6392-0
Wei Zhou and George Labahn. Unimodular completion of polynomial matrices. In Proceedings ISSAC 2014, pages 413-420. ACM, 2014. https://doi.org/10.1145/2608628.2608640