1. Introduction and Definitions
Arrowhead matrices and diagonal-plus-rank-one (DPR1) matrices arise in many applications. Computations with such matrices are parts of many important linear algebra algorithm; for details, see [
1,
2,
3]. Here, we prove unified formulas for matrix-vector multiplications, determinants, and inverses for both types of matrices having elements in commutative and noncommutative associative fields or algebras. Our results complement and extend existing results in the literature. Each formula requires
arithmetic operations. Although the formulas are similar to established and widely recognized results, their application and the derivation of proofs for block matrices and matrices of quaternions is a novelty. The formulas are efficiently implemented using the polymorphism or multiple-dispatch feature of the Julia programming language. To the best of our knowledge, this is the first successful attempt to use the same code in various commutative and noncommutative settings.
All matrices are in , where and where is a noncommutative algebra of quaternions.
The rest of this paper is organized as follows. In this section, we state basic definitions and formulas. In
Section 2, we present fast formulas for inverses of arrowhead and DPR1 matrices and explain how to prove and apply the formulas to block matrices. In
Section 3, we provide fast formulas for determinants of arrowhead and DPR1 matrices. In particular, in
Section 3.1 we state and prove formulas for real and complex matrices; in
Section 3.2, we explain how to apply formulas to block matrices; and in
Section 3.3, we define the Study determinant for matrices of quaternions and show how it can be computed in two ways, namely, direct formulas and using homomorphism to complex matrices. The application of our results is illustrated by examples in
Section 4. Finally, a discussion and conclusions are provided in
Section 5.
We first state some basic definitions and formulas.
1.1. Quaternions
Quaternions are a noncommutative associative number system that extends complex numbers, introduced by Hamilton [
4,
5]. For basic quaternions
,
, and
, the quaternions have the form
The multiplication table of basic quaternions is as follows.
Conjugation is provided by
Let
be a complex analytic function. The value
, where
, is computed by evaluating the extension of
f to the quaternions at
q (see [
6]). All of the above is implemented in the Julia (v1.10) [
7] package quaternions.jl (v0.7.6) [
8].
Quaternions are homomorphic to
with eigenvalues
.
1.2. Arrowhead and DPR1 Matrices
Let ★ denote the transpose of a real matrix, the conjugate transpose (adjoint) of a complex or quaternion matrix, and the conjugate of a scalar.
The arrowhead matrix (Arrow) is a matrix of the form
where
is a diagonal matrix with diagonal elements
,
, and
, or any symmetric permutation of such matrix.
The diagonal-plus-rank-one matrix (DPR1) is a matrix of the form
where
is a diagonal matrix with diagonal elements
,
, and
.
1.3. Matrix-Vector Multiplication
The obvious formulas for the multiplication of a vector by an arrowhead or a DPR1 matrix require floating point operations.
Let
be an arrowhead matrix with the tip at position
, and let
z be a vector. Then,
, where
Further, let
be a DPR1 matrix and let
. Then,
, where
If elements of the matrices are themselves matrices in
, the elements of the vector
z satisfy
,
. Formulas (
2) and (
3) hold directly and yield a block vector
w.
The determinants and the inverses of arrowhead and DPR1 matrices are computed using
operations, just as the matrix-vector products above; this is unlike general matrices, where these functions require
operations (see
Section 2 and
Section 3 for details). This fact can be used in deriving fast algorithms for eigenvalue decomposition of such matrices [
9]. The basic idea in deriving formulas in the noncommutative setting is that the operations within a particular formula should be executed in the specified order.
2. Inverses
Lemma 1. Let be a nonsingular arrowhead matrix with the tip at position , and let P be the permutation matrix of the permutation . If all , then the inverse of A is a DPR1 matrixwhere If , then the inverse of A is an arrowhead matrix with the tip of the arrow at position and zero at position (i.e., the tip and the zero on the shaft change places). In particular, let be the permutation matrix of the permutation . Partition D, u, and v as follows: Proof. The Formula (
4) follows by multiplication:
Formula (
5) is similar to the formula from Section 2 of [
3]. The proof follows by multiplication, and is similar to the above proof of Equation (
4). □
Lemma 2. Let be a non-singular DPR1 matrix. If all , then he inverse of A is a DPR1 matrixwhere If , then the inverse of A is an arrowhead matrix with the tip of the arrow at position . In particular, let P be the permutation matrix of the permutation . Partition Δ
, x, and y as follows: Proof. Formula (
6) follows from Fact 2.16.3 of [
10]. The proof is by direct multiplication, and we present it below for the sake of completeness.
Formula (
7) is similar to the formula from Section 2 of [
11]. The proof follows by multiplication, and is similar to the above proof of Equation (
6). □
Remark 1. For matrices of quaternions, due to their non-commutativity, the operations must be executed in the exact order specified.
Remark 2. If elements of the matrices are themselves matrices in , then Formulas (4)–(7) return the corresponding block matrices, provided that: With the above conditions fulfilled, the proofs of Lemmas 1 and 2 hold for block matrices as well. A block arrowhead or DPR1 matrix may be non-singular even if some of the inverses within the formulas do not exist. In such cases, the respective inverses do not have the structure required by Lemmas 1 and 2; thus, Formulas (4)–(7) cannot be applied. 3. Determinants
Determinants are computed using two basic facts: the determinant of the triangular matrix is a product of diagonal elements, and the determinant of the product is the product of determinants.
3.1. Real and Complex Matrices
First, we have the following Lemmas.
Lemma 3. Let be a real or complex arrowhead matrix. If all , then the determinant of A is equal to Proof. The proof is modeled after Proposition 2.8.3, Fact 2.14.2, and Fact 2.16.2 from [
10]. Formula (
8) follows from the factorization
Formula (
9) is proved as follows. Let
P be the permutation matrix that swaps rows
j and
n; then,
where
I denotes the identity matrix of the appropriate dimension. Therefore,
as desired. □
Lemma 4. Let be a real or complex DPR1 matrix. If all , then the determinant of A is equal to Proof. The proof is modeled after Fact 2.16.3 and Fact 2.16.4 from [
10]. Formula (
13) follows from the factorizations
and
Formula (
14) is proved as follows. The factorization (Equation (1.1) from [
12]) implies that
Therefore,
and the result follows from Equation (
9). □
3.2. Block Matrices
In the case of block matrices, Lemmas 3 and 4 are applied as follows. Let
be a block matrix with
, where
. If all
are nonsingular, then the right-hand side of Equation (
8) is an element of
. Because the determinant of the product is the product of determinants, we have
The proof follows from (
10), with the unities replaced by a
identity matrix
.
The proof follows by replacing the unities in (
11) with
, setting
P in (
12) to the permutation matrix (which swaps block-row
j with block-row
n), and using the fact that
.
Let
be a block matrix with
, where
. If all
are non-singular, then
The proofs are similar to the proofs of Equations (
13) and (
14), respectively, with the unities replaced by
.
3.3. Matrices of Quaternions
If
, then the standard determinant is not well defined due to noncommutativity. Instead, the determinant of the matrix of quaternions is defined using a determinant of its corresponding homomorphic complex matrix; see [
13] (Section 3) and [
14]. Such a determinant is called the Study determinant, and is denoted by
. More precisely, using (
1) element-wise, we can define
as the complex matrix homomorphic to
A. Then,
The Study determinant is real and non-negative; see [
13] (Theorem 5) and [
14]. Note that
is a block-matrix with
blocks.
If
A is an arrow or a DPR1 matrix, then
can be computed using the formulas from
Section 3.2 for complex block matrices. Alternatively, as the product of determinants is the determinant of the product, and for any (matrices of) quaternions
B and
C it holds that
, we can also use the formulas from Lemmas 3 and 4 directly, then compute the Study determinant of the final result. The same arguments show that both approaches are valid for block matrices of quaternions as well.
Remark 3. Because Formula (9) involves only multiplications, it can be expressed more cohesively for real and complex matrices as In the non-commutative setting of block matrices, using the facts that the determinant of the product is the product of determinants and vice versa, Formula (17) can also be expressed as The determinants of the matrices of quaternions and block matrices of quaternions are computed using representations as complex block matrices. Therefore, the same argument applies here, and the two above formulas can be used in this case as well. The same arguments apply to Formulas (14) and (18) for DPR1 matrices, yielding more cohesive versions:andrespectively. However, the orders presented in Formulas (9), (17), (14), and (18) are more natural, as they follow from the proofs and basic premises. 4. Examples
In this section, we illustrate our results with two examples. The first example deals with arrowhead block matrices and the second with DPR1 matrices of quaternions.
Example 1. Letthat is, , where (with denoting the zero matrix) Using Formula (4) from Lemma 1 and Remark 2 (note that all matrix entries are properly rounded), we havewhere Further, using (16) and (22), we have To provide an example for the case of the zero-block on the diagonal, let be the block-matrix equal to matrix A from (21), except with the -block set to zero, that is, , whereand where u, v, and α are provided by (22). Using Formula (5) from Lemma 1 and Remark 2, the matrix is an arrowhead matrix Finally, using Formula (17) with , we have Similarly, using the more cohesive form in (19), we have Example 2. For the sake of simplicity, we shall denote the following quaternion: Letthat is, , where Using Formula (6) from Lemma 2 (with all matrix entries properly rounded), we havewhere To provide an example for the case of a zero element on the diagonal, let be the DPR1 matrix of quaternions equal to matrix B from (23), except with the -element set to zero. More precisely, , whereand where x, y, and ρ are provided by (24). Using Formula (7) from Lemma 2 with , the matrix is an arrowhead matrix Finally, using Formula (14) with and the discussion in Section 3.3, we have Similarly, using the more cohesive form in (20), we have 5. Discussion and Conclusions
We have derived formulas for inverses and determinants of arrowhead and diagonal-plus-rank-one matrices where the elements are real numbers, complex numbers, or quaternions, along with block matrices of all three types of elements. Each formula requires arithmetic operations, meaning that they are optimal. Each formula is unified in the sense that the same formula is used for any type of matrix element, including block matrices. When formulas for inverses are applied to matrices of quaternions or block matrices the operations must be executed in the exact order specified due to the noncommutativity.
Although the formulas are similar to established and widely recognized results for real and complex arrowhead and DPR1 matrices [
1,
2,
10,
13], our results are novel and complement the existing results, as we have proved that they hold in noncommutative algebras for matrices of quaternions and block-matrices.
The code, written in the Julia programming language [
7], is available in the fast.jl notebook [
15]. The code relies on Julia’s polymorphism (or multiple-dispatch) feature. To the best of our knowledge, this is one of the first attempts to use the same code in computing various linear algebra objects in both commutative and noncommutative settings.
Author Contributions
N.J.S. and I.S. developed the original idea, derived the programs, developed the theoretical results, performed numerical testing, and wrote the manuscript. All authors have read and agreed to the published version of the manuscript.
Funding
This work has been fully supported by the Croatian Science Foundation under the project ‘Matrix Algorithms in Noncommutative Associative Algebras’ (IP-2020-02-2240).
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
Available online at [
15].
Acknowledgments
The authors wish to express their thanks to the reviewers and the editor for their succinct and valuable comments.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Golub, G.H.; Loan, C.F.V. Matrix Computations, 4th ed.; The John Hopkins University Press: Baltimore, MD, USA, 2013. [Google Scholar]
- Najafi, H.S.; Edalatpanah, S.A.; Gravvanis, G.A. An efficient method for computing the inverse of arrowhead matrices. Appl. Math. Lett. 2014, 33, 1–5. [Google Scholar] [CrossRef]
- Stor, N.J.; Slapničar, I.; Barlow, J.L. Accurate eigenvalue decomposition of real symmetric arrowhead matrices and applications. Linear Algebra Appl. 2015, 464, 62–89. [Google Scholar] [CrossRef]
- Hamilton, W.R. Lectures on Quaternions; Hodges and Smith: Dublin, Ireland, 1853. [Google Scholar]
- Hamilton, W.R. Elements of Quaternions; Hamilton, W.E., Ed.; Longmans, Green, and Co.: London, UK, 1866. [Google Scholar]
- Sudbery, A. Quaternionic analysis. Math. Proc. Camb. Philos. Soc. 1979, 85, 199–225. [Google Scholar] [CrossRef]
- The Julia Language. Available online: http://julialang.org/ (accessed on 2 May 2024).
- Quaternions.jl. Available online: https://github.com/JuliaGeometry/Quaternions.jl (accessed on 2 May 2024).
- Chaysri, T.; Stor, N.J.; Slapničar, I. Fast Eigenvalue Decomposition of Arrowhead and Diagonal-Plus-Rank-k Matrices of Quaternions. Mathematics 2024, 12, 1327. [Google Scholar] [CrossRef]
- Bernstein, D.S. Matrix Mathematics; Princeton University Press: Princeton, NJ, USA, 2009. [Google Scholar]
- Stor, N.J.; Slapničar, I.; Barlow, J.L. Forward stable eigenvalue decomposition of rank-one modifications of diagonal matrices. Linear Algebra Appl. 2015, 487, 301–315. [Google Scholar] [CrossRef]
- Powell, P.D. Calculating determinants of block matrices. arXiv 2011, arXiv:1112.4379. [Google Scholar] [CrossRef]
- Aslaksen, H. Quaternionic determinants. Math. Intell. 1996, 18, 57–65. [Google Scholar] [CrossRef]
- Cohen, N.; Leo, S.D. The quaternionic determinant. Electron. J. Linear Algebra 2000, 7, 100–111. [Google Scholar] [CrossRef]
- Matrix Algorithms in Noncommutative Associative Algebras. Available online: https://github.com/ivanslapnicar/MANAA/ (accessed on 2 May 2024).
| Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).