Inverses and Determinants of Arrowhead and Diagonal-Plus-Rank-One Matrices over Associative Algebras

: This article considers arrowhead and diagonal-plus-rank-one matrices in F n × n where F ∈ { R , C , H } and where H is a noncommutative algebra of quaternions. We provide unified formulas for fast determinants and inverses for considered matrices. The formulas are unified in the sense that the same formula holds in both commutative and noncommutative associative fields or algebras, with noncommutative examples being matrices of quaternions and block matrices. Each formula requires O ( n ) arithmetic operations, as does multiplication of such matrices with a vector. The formulas are efficiently implemented using the polymorphism or multiple-dispatch feature of the Julia programming language


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 O(n) 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 F n×n , where F ∈ {R, C, H} and where H 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.

Quaternions
Quaternions are a noncommutative associative number system that extends complex numbers, introduced by Hamilton [4,5].For basic quaternions i, j, and k, the quaternions have the form The multiplication table of basic quaternions is as follows.
Let f (x) be a complex analytic function.The value f (q), where q ∈ H, 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 a ± i

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 D ∈ F (n−1)×(n−1) is a diagonal matrix with diagonal elements and α ∈ F, or any symmetric permutation of such matrix.
The diagonal-plus-rank-one matrix (DPR1) is a matrix of the form where ∆ ∈ F n×n is a diagonal matrix with diagonal elements δ i = ∆ ii , x, y ∈ F n , and ρ ∈ F.

Matrix-Vector Multiplication
The obvious formulas for the multiplication of a vector by an arrowhead or a DPR1 matrix require O(n) floating point operations.
Let A = Arrow(D, u, v, α) be an arrowhead matrix with the tip at position A ii = α, and let z be a vector.Then, w = Az, where w j = d j z j + u j z i , j = 1, 2, . . ., i − 1 Further, let A = DPR1(∆, x, y, ρ) be a DPR1 matrix and let β = ρ(y ⋆ z) ≡ ρ(y • z).Then, w = Az, where If elements of the matrices are themselves matrices in F k×k , the elements of the vector z satisfy z i ∈ F k×k , i = 1, . . ., n. 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 O(n) operations, just as the matrix-vector products above; this is unlike general matrices, where these functions require O(n 3 ) operations (see Sections 2 and 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.

Inverses
Lemma 1.Let A = Arrow(D, u, v, α) be a nonsingular arrowhead matrix with the tip at position A ii = α, and let P be the permutation matrix of the permutation p = (1, 2, . . ., i − 1, n, i, i + 1, . . ., n − 1).If all d j ̸ = 0, then the inverse of A is a DPR1 matrix where If d j = 0, then the inverse of A is an arrowhead matrix with the tip of the arrow at position (j, j) and zero at position A ii (i.e., the tip and the zero on the shaft change places).In particular, let P be the permutation matrix of the permutation p = (1, 2, . . ., j − 1, n, j, j + 1, . . ., n − 1).Partition D, u, and v as follows: where 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 A = DPR1(∆, x, y, ρ) be a non-singular DPR1 matrix.If all δ j ̸ = 0, then he inverse of A is a DPR1 matrix where If δ j = 0, then the inverse of A is an arrowhead matrix with the tip of the arrow at position (j, j).In particular, let P be the permutation matrix of the permutation p = (1, 2, . . ., j − 1, n, j, j + 1, . . ., n − 1).Partition ∆, x, and y as follows: where 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.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 F k×k , then Formulas (4)- (7) return the corresponding block matrices, provided that:

•
all inverses within the formulas are well defined • unities in Equations ( 4) and ( 5) are replaced by k × k identity matrices • all operations are executed exactly in the specified order • the adjoint of a block-vector is the transpose of the vector of individual adjoints; that is, if 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.

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.

Real and Complex Matrices
First, we have the following Lemmas.Lemma 3. Let A = Arrow(D, u, v, α) be a real or complex arrowhead matrix.If all d i ̸ = 0, 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 A = DPR1(∆, x, y, ρ) be a real or complex DPR1 matrix.If all δ i ̸ = 0, then the determinant of A is equal to If δ j = 0, then Proof.The proof is modeled after Fact 2.16.3 and Fact 2.16.4 from [10].Formula (13) follows from the factorizations Formula ( 14) is proved as follows.The factorization (Equation (1.1) from [12]) implies that Therefore, and the result follows from Equation (9).

Block Matrices
In the case of block matrices, Lemmas 3 and 4 are applied as follows.Let A = Arrow(D, u, v, α) be a block matrix with d i , u i , v i , α ∈ F k×k , where F ∈ {R, C}.If all d i are nonsingular, then the right-hand side of Equation ( 8) is an element of F k×k .Because the determinant of the product is the product of determinants, we have The proof follows from (10), with the unities replaced by a k × k identity matrix I k×k . If The proof follows by replacing the unities in (11) with I k×k , setting P in (12) to the permutation matrix (which swaps block-row j with block-row n), and using the fact that det(P) = (−1) k .
Let A = DPR1(∆, x, y, ρ) be a block matrix with δ i , x i , y i , ρ ∈ F k×k , where F ∈ {R, C}.If all δ i are non-singular, then The proofs are similar to the proofs of Equations ( 13) and ( 14), respectively, with the unities replaced by I k×k .

Matrices of Quaternions
If F = H, 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 Sdet(A).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 C(A) is a block-matrix with 2 × 2 blocks.
If A is an arrow or a DPR1 matrix, then Sdet(A) 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 C(BC) = C(B)C(C), 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: and respectively.However, the orders presented in Formulas ( 9), ( 17), (14), and ( 18) are more natural, as they follow from the proofs and basic premises.

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.
Finally, using Formula ( 14) with j = 1 and the discussion in Section 3.

Discussion and Conclusions
We have derived formulas for inverses and determinants of arrowhead and diagonalplus-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 O(n) 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.jlnotebook [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.