Effective Methods of QR-Decompositions of Square Complex Matrices by Fast Discrete Signal-Induced Heap Transforms ()
1. Introduction
The QR-decomposition, or factorization of a non-singular matrix
into a unitary matrix Q and an upper triangular matrix R, as well as the factorization
with a low triangular matrix L are powerful tools for solving linear systems of equations
in many applications in computing and data analysis [1] - [7] . Here, the matrix A is a real or complex non-singular matrix. The matrix Q is unitary, and therefore its inverse is the transpose conjugate
matrix. The calculation of inverse of the triangular matrix is not a difficult task. Therefore, the solution of the system of equation can be calculated by
for the QR-decomposition, and
for the QL-decomposition. Many known methods of QR-decomposition of real matrices were modified for the complex case. They include the Gramm-Schmidt process [8] , the method of Householder transformations (or Householder reflections) [9] , and the Givens rotations [10] [11] [12] .
In this work, we focus on the QR-decomposition and describe three types of decompositions, by using the concept of the discrete signal-induced heap transform (DsiHT) [13] [14] [15] . In the case of real matrices, the detail description of the DsiHT method of QR-decomposition is given in [16] . For complex matrices, there are different types of 2 × 2 basic complex unitary transforms can that transfer energy of the 2-point signal to the first components, while zeroing the second one. The path of the DsiHT, i.e., the order of sequential processing (or rotating in some cases) of data of the signal is an important characteristic of the transform. The DsiHTs with different paths result in different QR-decomposition of the same matrix, as shown in [17] on examples with the so-called weak and strong-DsiHTs. The interesting property of the QR-decomposition by the DsiHT is in the presence of analytical equations that allow calculating the transforms and their matrices without using the basic matrices of rotations. The case with complex matrices is much richer than real matrices, since there are many different basic transforms, not only “Givens rotations,” that can be considered in the DsiHT. Examples of such transforms and their application in QR-decom- position of complex matrices are described and compared with the complex Householder transform-based QR-decomposition.
The rest of this paper is organized in the following way. In Section 2, the concept of the DsiHT is described with examples of two-wheel carriages that illustrate the performance of the transform. The basic complex matrices of the 2 × 2 transforms composing the N-point DsiHT are described in Section 3. These matrices are classified by the basic transforms use them and are called the T, G, and M-type complex matrices. The concept of the DsiHT which can be calculated without matrices but by analytical formulas is also described. The QR-decom- positions with three types of DsiHTs are presented with examples in Section 4. It is shown that the M-type DsiHT based QR decomposition is close to the result of the Householder transform method, and other two types of QR-decomposi- tion differ much. The scripts for MATLAB-based codes for computing the DsiHT and described QR-decompositions are given in Section 5. In Section 6, the concept of the mixed QR-decomposition is presented, when different type DsiHTs are used in different stages of decomposition. The number of such decompositions is greater than
for an N × N complex matrices, which is a very large number for large N. The questions related to the selection of the QR-decompo- sition from such large number of cases are not discussed here in detail, since it beyond the score of this work.
2. Basic 2 × 2 Matrices in Complex Algebra
In this section, we describe briefly the concept of the discrete signal-induced heap transform (DsiHT) [13] [15] . The transform is unitary and is defined by a non-zero vector, or signal
, without any constrain on the length N and signal itself; it may be real and complex. This signal is called the generator of the DsiHT; the signal generates the unitary transform which is applying on other signals
. We consider the case when the N-point DsiHT is calculating by (N − 1) basic transformations T, each of which is applying only on two components of the renewal vector z in a certain order, or a path.
In the simple form, the DsiHT is calculated by applying a set of basic transformations T. The 2 × 2 matrix of such a transformation is defined by a chosen vector
from the condition
(1)
In the case when x and y are real, T can be considered as the Givens rotation with the matrix
If
, the angle of rotation
, or
.
The concept of the N-point DsiHT of the signal z is illustrated in the diagram of Figure 1. This is the so-called weak carriage with two wheels, one “rotates” the generator x and another wheel “rotates” the signal z. When the carriage moves, the generator components work together with the first element x0 and update/renew its value at each step. At the same time, the transformation T, which is determined during the rotation of the first wheel, is applying to the two
![]()
Figure 1. The two-wheel carriage of the DsiHT.
components of the input signal z. In this wheel, the components of z are processing together with the first element z0 and update its value.
The N-point DsiHT with such a carriage is called a weak DsiHT, since the components
and
of the generator and signal are processed in the natural order of the index n, i.e.,
with
, then
, and the same for the signal z. This is the natural path of the DsiHT and the path can be chosen differently [16] [18] . For instance, the concept of the strong DsiHT is defined by the path in order
with
, then
, and the same for the signal z. The carriage of the strong DsiHT is illustrated in Figure 2.
We consider the DsiHT with the natural path.
Algorithm of the DsiHT with the generator
.
The input signal is
.
1) Stage
.
· Calculate the matrix of the transform
that is generated by the vector
.
· Calculate the transform
.
· Calculate the new value
of
in the transform
.
2) Stage
.
· Calculate the matrix of the transform
that is generated by the vector
.
· Calculate the transform
.
· Calculate the new value
in the transform
.
3) Stage
.
· Continue calculations as in Step 2, to get the rest values of the output
, and
.
The output signal is
.
To simplicity the notations in the two-wheel carriage in Figure 1,
denotes
and
denotes
on the kth stage of rotations. Thus, during the composition of the N-point DsiHT, H, a set of parameters, or angles
, is calculated, which is called the angular representation of the generator x [15] .
![]()
Figure 2. The two-wheel carriage of the strong DsiHT.
The transformation H is separable and calculated as
(2)
When
, the transform of the vector x is collected to one heap; it is transferred to the first component,
, where
.
Example 1: For the
case, we consider the generator
with the norm
. The matrix and the set of five angles (in radians) of the 6-point x-DsiHT are
The matrix
of the transform can be written as
, where the diagonal matrix
and the matrix
is
The determinant of the matrix
. The first row of the matrix
is the generator x and the last row is the same generator only with the splash at the end. This value is calculated by
; it is the energy of the generator without the last component, i.e.,
.
For the 6-point DsiHT with the path of the strong carriage, we have the following data. The angular representation is
,
and the matrix
of this DsiHT with
is
This matrix can be presented as
Here, the diagonal matrix
. Thus, we have two different matrices
and
such that
If we take a vector z, for instance equal
with the norm
, we obtain the following transforms:
and
.
Below are the script of the MATLAB-based code to calculate the matrices of these two DsiHTs.


Calculation of the DsiHT by Analytical Equations
It is important to note that the N-point DsiHT can be obtained without calculation of the angles
and trigonometric functions
and
, but by using the analytical formulas [16] . For that, we consider the following notations, which represent respectively the partial cross-correlation of z with the vector generator x:
, (3)
and the partial and full energies of the signal generator
(4)
The components of the DsiHT on the k-th iteration can be expressed by the correlation data as follows:
(5)
On the final stage, the value of the first component is defined by
(6)
which is the correlation coefficient of the input signal z with the normalized generator x. For a given generator, all values of
and
can be calculated in advance. In the case when
,
and
, for all
.
The coefficients
of the matrix of the N-point DsiHT can be obtained from Equations (3)-(6). The m-th column of the DsiHT matrix H can be calculated, by applying the unit vector
with 1 on the m-th position, where
. Therefore, the coefficients of the transform can be calculated by
(7)
(8)
where
.
3. Complex Basic Matrices
The N-point DsiHT is calculated, by applying (N − 1) basic transformations T on two different components of the renewal vector in a certain order, or the path. In this section, we consider the concept of the complex DsiHT. The basic transformation of the DsiHT, which is defined by a complex vector
, and then, is applied to a complex input
is calculated as follows:
(9)
The complex matrix of this transformation is
and the determinant is 1. It is not difficult to verify that the matrix T is unitary, i.e., the multiplication of T with its conjugate transpositon
, where I is the 2 × 2 identity matrix.
When the input equals to the generator, i.e.,
, we obtain the real transform
(10)
3.1. DsiHT with Analytical Equations
The complex DsiHT can also be calculated by using analytical Equations (5) and (6), similar to the case with real vectors. For complex vectors, the partial cross- correlation of z with the vector—generator x in the first k components is calculated by
, (11)
and the energies in the first k components of the signal-generator by
(12)
The 2 × 2 matrix calculated by analytical Equations (7) and (8) for the
case will be denoted by M. This matrix is different from matrix T and equals
(13)
One coefficient of the matrix is a real number, and all coefficients are complex in the matrix T. The matrix M is unitary and the determinant of the matrix is the complex number
(14)
and
. The matrix product
equals
3.2. DsiHT with Complex Givens Rotations
We consider the known complex Givens rotation [4] which is defined by the matrix
(15)
Here, the complex sign function is defined by
. The determinant of this matrix is 1. For the
case, the above matrix is defined as
i.e., it is considered that
. The matrix G is half-complex, meaning that in each row and column there is a real number
. It should be noted that all coefficients of the basic matrix T in Equation (9) are complex numbers. When applying the matrix G on the vector-generator
we obtain
or
(16)
where
is a complex number with norm 1. The matrix G is unitary, i.e.,
.
It should be noted that one can express the matrix G by T and by M, as
(17)
Example 2: Let us consider two complex numbers
and
. For these numbers,
and
. We obtain the following matrices:
and
The determinants of these matrices,
,
, and
. Up to the coefficient
, the ma- trix T is integer-valued for integer complex generator, and matrices G and M are more complicated; they have additional coefficients with
. When applying these matrices on the vector
, we obtain the following vectors:
and
. Thus, the results of the transforms T and M are different from G in the first component which is complex. Now, we consider the transforms of the vector
,
The outputs of T, M, and G are different. The matrix M has commom with matrices T and G. The second components of the transform G and M are the same, and the first components of the transform T and M are the same. For all these transforms, the energy of the input vector is preserved,
,
,
,
.
To describe the difference between the DsiHT generated by basic 2 × 2 transforms of different types, we consider the matrices of these DsiHTs for the
case.
Example 3: The complex vector-generator is
We have the following 4 × 4 matrices of the DsiHT calculated with basic transforms T, M, and G:
The determinants of these matrices equal
,
, and
. The matrices
and
are different only in coefficients of the 2nd rows. The difference of the matrices
and
is in the first two rows. In the matrices
and
, the first rows are proportional to the vector generator. Indeed, for the matrix
we have
The vector-generator x is not in the first row of matrix G. The first coefficient of this matrix is the real number 0.6220, not complex as in the vector-generator.
For the input vector
, the transforms equal
It is not difficult to verify that in the general
case, the difference between the matrices
and
is only in the coefficeints of the first two rows. Thus, the DsiHT of signals differ only in the first components of the transform, if instead of the basic matrices T the matrices G are used.
As illustrative example, we consider the complex signal z of length 500 with real and imaginary parts shown in Figure 3 in parts (a) and (b), respectively.
The signal-generator x is calculated by
The complex signal z after processing by the DsiHT with generator x is shown in Figure 4. The basic transforms of this DsiHT are with the matrices of type T.
The results of the DsiHT of the signal z, when using matrices of types M and G are almost the same as for the T-type DsiHT. As mentioned above, the difference of these transforms is in the first two components;
Thus, we have three types of matrices T, M, and G for basic transforms that
(a)
(b)
Figure 3. The complex signal z of length 500; (a) real and (b) imaginary parts.
(a)
(b)
Figure 4. The 500-point T-type DsiHT of the signal z; (a) real and (b) imaginary parts.
can be used in the QR decomposition by the DsiHT. These matrices are different, but these transforms move the energy of vector
to the first component and zeroing the second one.
4. QR Decompositions with the DsiHT
In this section, we analyze the application of the DsiHTs that are based on basic transformations T, M and G in QR decomposition of a square complex matrix. The QR-decomposition is described in detail on the example with a 4 × 4 matrix. Let X be the following 4 × 4 complex square matrix with
:
.
First, we take the first column of the matrix as the vector
. This vecor will be the generator for the DsiHT, which we consider of the type M. We denote the matrix of DsiHT by
. The application of the DsiHT on the same vector is a vector
, where
is the energy of the vector,
. Therefore, when multiplying the matrices
and X, we obtain the matrix
of the following form:
In the second step, this 3 × 3 complex submatrix
is processed similarly.
The first vector-column
is used as a generator for the 3-point
DsiHT. We denote by
the matrix of this DsiHT. As a result, we obtain the following matrix:
Here,
. In the last stage of calculation, the basic trans-
form with the vector-generator
is applied on two vectors
and
. Denoting by
the matrix of this transform, we obtain the final triangularization,
,
where
. The matrix of the transformation, or triangularization
is
(18)
Each of these DsiHTs is unitary, and therefore this matrix T is unitary. The inverse matrix
is also unitary and can be written as
(19)
Thus, we have an explicit representation of the matrix Q. Here, the operation A' denotes the conjugate transposition of a matrix A. Thus,
and we obtain the following decomposition of the matrix X:
(20)
It should be noted that if we apply instead of M-type DsiHT the transform of type T or G in the above example, the diagonal coefficients of the matrix R will be changed as follows. In the case of the T-type DsiHT,
and in the case of the G-type DsiHT, these coefficients will be changed as
Example 4 × 4: We consider the method of QR-decomposition that is similar to the method of the Householder transformations, only the DsiHTs will be used instead of the Householder transformations. First, we calculate the DsiHT by using the analytical equations, instead of matrix multiplications.
Let X be the following complex 4 × 4 matrix:
The method of QR decomposition of X with the DsiHTs results in the following presentations of the matrix
.
a) T-type DsiHT:
The matrix Q is
and the triangular matrix equals
The first column of the matrix
is proportional to the first column of the matrix X,
b) M-type DsiHT
The matrix Q is
and the triangular matrix is
Up to the signs ±, many coefficients of the matrix
are equal to the coefficients of
, and the main difference in the 4th columns of these matrices. In the matrices
and
, the last coefficients are different, others are the same or differ only in the sign.
c) Householder Transforms
We consider for comparison the Householder transform decomposition
. The Householder transformation [6] is defined as
, where the normalized vector w is calculated
and
is a given vector. When running the MATLAB function “qr.m,” we obtain the following matrices:
and
The last column of the matrix
is different from the last columns of the matrices
and
, other coefficients are equal up to the sign. The same differences can be seen in the triangular matrices
,
, and
.
d) G-type DsiHT:
The matrix Q is
and the triangular matrix is
This decomposition is very different from the above three QR-decompositions. All coefficients of the first 3 columns of matrices
and
differ from the coefficients of the corresponding matrices of the above decompositions by the T-and M-type, as well as the Householder QR decomposition. The last columns in matrices
and
are equal, as well as in matrices
and
.
Here, we want to mention that if we apply the strong DsiHTs starting from the last column of the matrix, we obtain the decomposition of the matrix
with the left triangular matrix. For the G-type strong DsiHT, the matrix Q is
and the left triangular matrix is
One can notice from this example that the QR-decomposition by the G-type DsiHTs differs much from the decomposition by the Householder transforms. The QR-decomposition by M-type DsiHTs is very similar to the Householder transform method. The M-type DsiHT is fast and can be implemented by using 2 × 2 basic transformations, as well by the analytical equations. To analyse the difference of these two decompositions in more detail, we consider the example with a 6 × 6 complex matrix X.
Example 6 × 6: Let the matrix X be the following:
The QR-decomposition by the M-type DsiHTs results in the following matrices:
and
The method of Householder transforms which is performed by the MATLAB function “qr.m” results in the following matrices
and
in the QR-de- composition
. In the matrix
, the last column differs from the same column in the matrix
, when using the M-type matrices in QR-decom- position. The remaining part, or the 6 × 5 sub-matrix of
differs from the same sub-matrix of
only by the sign. Thus, we can write the matrix
in the following way:
⨆
All coefficients of the triangular matrix
, except the last coefficient, equal to the corresponding coefficients of the matrix
with the sign minus. In matrix
, this coefficient equals −4.1941 and in the matrix
such coefficient is 2.1708 + 3.5886. Therefore, we can write that
5. The Scripts for the Decomposition by the DsiHT
Below are MATLAB-based codes for QR-decomposition of a complex square matrix X, by using the DsiHT. The function “amqr_compex.m” is for QR-de- composition of X by the DsiHT with the basic transforms T, M, and G. The Householder transform-based QR decomposition is calculated in this example by the MATLAB function “qr.” All matrices in the examples given in Section 4 were calculated by these codes.

The function amqr_complex is used to calculate the QR decomposition by the DsiHTs. The parameter “ntype” is selected as 1, 2, and 3 for the T, M, and G-type DsiHTs, respectively. If parameter “ntype” is set to 0, the M -type DsiHT is calculated by analytical Equations (4)-(6) in the function msob_enanalcomp. The calculation of 2 × 2 basic matrices of types T, M, and G are accomplished by the corresponding functions msob2T, msob2M, and msob2G in the main function msob_complexA that calculates the DsiHT. The scripts of all these functions are given below.




Below is the script of the function “msob_complex1sp.m” to compute the strong G-type DsiHT. To calculate the strong T and M-types DsiHT, the corresponding function can be written in a similar way.

6. Mixed Type DsiHT QR Decomposition
It is clear that on different stages of QR-decomposition by the DsiHT, we can change the type of the DsiHT. Such mixed type QR-decompositions can be considered and applied in practice together with the described above QR-decom- positions by the T, M, and G-type DsiHTs.
As an example, we consider the matrix X given in Example 6 × 6 in Section 4 with the following set of types of transforms: [T M G T T], or [1 2 3 1 1] in numbers when running the codes. It means that the first transform which will be used to obtain the first heap in the first column of in the matrix X is the T-type DsiHT. The second transform is the M-type DsiHT to get the second heap in the matrix, or coefficient number (2, 2) in the triangular matrix R, and so on. As a result, we obtain the decomposition of the matrix
, where the unitary matrix is
When comparing with the QR-decomposition by the M-type DsiHT, one can notice that the columns number 3 and 6 and the sign on the 5th column are different in matrices
and
. The triangular matrix equals to
In this matrix, the coefficients of the 3rd and 6th rows and the sign in 5th row differ from the corresponding coefficients of matrix
.
It should be noted that instead of combination of types [1 2 3 1 1], we can use other combinations with 1, 2, and 3. The number of such combinations is 35 = 243. In general case of the N × N matrix, we can choose one combination of with numbers presenting the types of the DsiHT. The number of such combinations equals
and they can be used for calculating the QR-decomposition by the DsiHTs. The combinations with all 1s, 2s, and 3s correspond to the QR-decom- positions by the T, G, and M-type DsiHTs. Also, different paths can be used for the DsiHT, which increases the number of possible QR decompositions.
In conclusion, we consider a few QR-decompositions which were calculated for the pseudorandom integer N × N matrices X with complex coefficients with real and imaginary parts in the range 1:N. For that, the MATLAB function “randi.m” is used. Twelve values of N were arbitrary chosen to be 6, 13, 17, 19, 21, 40, 64, 100, 128, 201, 256, and 400. The QR-decompositions for each of these values of N were calculated by the M-type DsiHT and the Householder transforms; the script of the code is given below for the QR decomposition of the random complex 400 × 400 matrix.

7. Summary Results
To compare the results of the QR-decomposition, the precision of computation was estimated by the 2-norms of the matrix
and matrix
, by using the MATLAB function “norm.m.” The results of estimations are given in Table 1.
![]()
Table 1. The precision of the QR-decomposition by the M-type DsiHT and Householder transforms.
One can notice that in most cases the 2-norm of the QR-decomposition by the M-type DsiHTs is less than the same norm when using the Householder transforms.
8. Conclusion
We described three different types of QR-decompositions that include the DsiHT with T, G, and M-type complex matrices. The decomposition by analytical formulas was also given for the M-type DsiHT. The mixed type QR-decomposition, when different type DsiHTs are used in different stages of the algorithm was also presented. For an N × N complex nonsingular matrix, the number of such decompositions is greater than
. Examples of the QR-decomposition were given in detail for the 4 × 4 and 6 × 6 complex matrices and compared with the Householder transform-based QR-decomposition. MATLAB-based scripts of the codes for calculating the DsiHTs and QR decompositions are given. The different QL-decompositions of a complex matrix can be obtained in a similar way. We believe that the concept of the DsiHT can be generalized to the quaternion space [20] and the QR-decomposition of the quaternion matrix can be calculated and used together with the known methods of decompositions [19] .