1. Introduction
At present, many algorithms and methods are being developed to work on a quantum computer. The work of researchers in the field of developing quantum computing methods is rapidly gaining momentum due to the prospects related to big promises that a quantum computer will solve many complex problems faster than a traditional computer. Here, we mention methods for breaking modern encryptions [
1,
2] and processing large datasets in machine learning [
3,
4]. Difficulties arise when working with quantum circuits containing a large number of qubits, and this, of course, attracts mathematicians and engineers to solve various puzzles in quantum computation. Qubits are described together by quantum superpositions, and this suggests that a quantum system can be in several states at once before it is observed or measured [
5,
6]. When working with qubits, a linear and probabilistic model is assumed for them. For instance, we may consider three qubits as a 3-qubit superposition
, knowing that at any instant, only one of eight states
can be observed. Each amplitude
defines the probability
(or
if
is complex) of observing three qubits in the computational basis state
Also, all operators on qubit superpositions are invertible, namely, they are described by unitary transformations. Therefore, many problems of representing and processing data in the form of multi-qubit superpositions become complex. An example is quantum processing of color images, where there is still no single and accepted model, but, on the contrary, many different models are proposed and used for solving different tasks in image processing [
7,
8,
9].
The problem we discuss in this article is the development of quantum circuit design methods for effective calculating multi-qubit operations, especially for a large number of qubits. Quantum circuits for multi-qubit operations are complex, not only because all operations are linear and unitary, but also because calculations should be performed on normalized data. Multi-qubit operations are typically decomposed into two-qubit and single-qubit gates with control qubits and usually in large numbers [
10,
11,
12,
13,
14]. In other words, the matrix
of a multi-qubit operation needs to be decomposed in an effective way by elementary operations, such as, for instance, the rotations and phase gates.
Different methods of matrix decomposition were developed, which include the Gram–Schmidt process [
15,
16,
17], the Householder transformation-based method [
18,
19], cosine-sine decomposition (CSD) [
20], and QR decomposition by Givens rotations [
21,
22,
23,
24,
25]. In the QR decomposition of a square matrix
, the matrix
is triangular, and the matrix
is unitary and can be composed by rotations. Implementation of these decompositions in quantum circuits for multi-qubit operations and state preparation includes many permutations [
26,
27,
28,
29]. These additional permutations are controlled NOT operations and Gray code-based permutations, which are used to fulfill the computations only on bit planes that differ by only one bit. Such bit planes (BP) are called adjacent bit planes. As mentioned in our previous works [
30,
31], we believe that multiple switching of information flows from one set of qubits to others in the circuits (because of numerous permutations and CNOT gates) reduces the efficiency of quantum circuits.
This is true even for a small number of qubits. Consider the data in
Table 1, which shows the number of CNOTs in the known circuits for
-qubit operations (see [
32], p. 1008). This table includes the number of CNOTs in the known QR decomposition, cosine-sine decomposition (CSD), and the quantum Shannon decomposition (QSD). In the case of 7 qubits, the number of CNOTs is greater than 4091 (theoretical) and 7660 in QSD, while, as shown in this work, the number of all required operations (which are only 2D elementary rotations) is equal to 8128. We also mention that permutations are not mandatory elements in a universal set of gates. In the QsiHT-based method of QR decomposition, the quantum circuits for multi-qubit operations can be built without permutations. However, that was proven, and quantum circuits were fully described only for 3- and 4-qubit operations (real and complex) [
30]. The construction of permutation-free circuits in the general case was not subject to description at that time.
In this work, the QR decomposition for computing 5-qubit operations is described in detail with roadmaps and circuits. Here, the roadmap represents a diagram of how basic gates, or single-qubit operations, work when performing calculations. Such maps make it easy to construct quantum circuits, as will be shown in this work. As in our previous works, the presented QR decomposition is based on the concept of the -point discrete-time signal-induced heap transformation (DsiHT). For , the analog of this transformation is the -qubit quantum signal-induced heap transformation (QsiHT). The QR decomposition requires 31 QsiHTs with a total of 496 elementary rotation gates. For that, new roadmaps of all these transformations and quantum circuits are described in detail. As an example of the 5-qubit operation, we show how to compose the roadmap and build effective quantum circuits for large qubit operations. All roadmaps are composed by using fast paths of the heap transformations, which allows us for the first time to perform all calculations without permutations.
The key contributions of this work are as follows:
Effective roadmaps with “fast paths” for all 31 QsiHTs in the QR decomposition of a 5-qubit operation. No additional permutations with Gray codes or control NOT gates are required in the decomposition.
Recurrent method of road mapping for 5-qubit operations from the roadmaps of the 4- and 3-qubit QsiHTs. For that, new roadmaps for these transformations are used.
A general circuit for preparing the 3- and 4-qubit from the computational basis states ,
A general method of QR decomposition of any multi-qubit real operation with only elementary rotation gates.
A universal and transparent circuit for a quantum 5-qubit operation, which requires only 496 controlled elementary rotations and 1 phase shift gate.
A general method for constructing quantum circuits for multi-qubit operations with a maximum of elementary 2D rotation gates and 1 phase shift gate, and no permutations, for qubits.
The rest of the paper is organized as follows. The concept of the DsiHT is briefly discussed, and roadmaps for effective calculation of the QsiHT are presented in
Section 2. Examples of the 3-qubit QsiHTs are described.
Section 3 presents the concept of the narrowed QsiHT with examples described the roadmaps and circuits for three and four qubits. In
Section 4, the case with a 5-qubit operation is described. Analytical equations for calculating the roadmaps and quantum circuits for
-qubit operations are given when
The QsiHT-based QR decomposition of a square matrix is considered in
Section 5. The quantum circuit of a 5-qubit unitary operation is also presented. All roadmaps and quantum circuits for calculating 3-, 4-, and 5-qubit operations are given in the
Supplementary Materials.
2. The Concept of the DsiHT
In this section, we consider the DsiHT, which is induced, or generated, by one given signal [
36]. Here we assume that we know what signal the generator needs to be converted into, for example, this signal can be one of the basis vectors,
. In general, such a unitary transformation can be generated by two or more signals. As an example, we mention the method of preparation of two quantum states by the DsiHT generated by two signals [
37]. As illustrated in
Figure 1, when processing an input signal
, a set of 2-point transformations
are calculated sequentially from certain values of
and
of the signal-generator.
The
-point DsiHT is denoted by
or
. The transform of the generator itself is a given signal,
In other words, the required parameters
of the transformation are calculated from the condition
. The basic transformations are considered to be linear,
with coefficients
, and
. The signal
is considered to be the following signal:
where the number
is the norm or the energy of the signal,
The transformation moves the energy of the signal
into one point, or as we say, into one single heap.
The basic transformations are considered to be elementary rotations with the matrices
The coefficients
, and
of the linear transformation in Equation (1) are defined from one of the following conditions. We consider real transformations, namely, the Givens rotations,
, which are described in the matrix form as
The angle is calculated by
, and
if
. This rotation will also be denoted as
Also, we consider an elementary rotation defined as
where
. This rotation will also be denoted as
Because of the property
+
the rotation in Equation (5) can be written as the Givens rotation,
. Thus, the coefficients of the transformation
are equal to
The
-point DsiHT is composed sequentially by the series of 2-point operations
,
At every stage of composition, only two components of the signal
will be processed to calculate the angle
of the rotation
or
. One of the rotation outputs will be zeroed, and the other will be used for the next calculations,
or
.
Then, this rotation will be applied to the corresponding components of the input signal
,
A few of these components will be renewed during the calculations, as well. Thus, it is a two-level transformation. At the first level, the basic transformations
are generated, and at the second level, they are applied to the input signal. The input signal
can also be processed after generating the entire transformation, DsiHT. In other words, after calculating all the angles when placing the heap in the first component of the transform
the transform of the input signal is calculated,
Also, we consider the DsiHT, which moves the whole energy of the generator
into component #
, where integer
. In this case, we call this transformation the DsiHT with the heap at point
. Thus, the transformation is defined under the following condition:
This transformation is denoted by
, and for the
case, we consider
We will use these transformations in the process of the QR decomposition of a multi-qubit quantum operation, which is described in
Section 5. It should be noted that the main characteristic of the DsiHT,
, is the path, or the order in which the transformation is assembled from the basic 2-point rotations
. The set of angles, which is called
the angular representation of the generator and is denoted by
, is calculated from the generator with the condition of Equations (4) and (5) [
36]. In quantum computation, it is desired to compose operations only on adjacent bit planes to avoid additional permutations. We will design the
-point DsiHTs, or
-qubit QsiHTs, in quantum computation only with paths that allow us to compose these transformations by rotations only on adjacent bit planes. Such paths are called fast paths and described for 2-, 3-, and 4-qubit operations in [
30]. In this work, we renewed many of these paths in order to obtain an effective method of constructing such paths for
-qubit unitary operators, in the general case when
2.
First, to illustrate the process of calculation of the DsiHT, we consider an example of the transformation with a fast path.
Example 1. Let us consider the case. Figure 2 shows the signal-flow graph of the 8-point DsiHT. Each 2D rotation , is denoted by the operation in the form of ‘X’, which we call the butterfly. These butterflies are numbered from top to bottom and left to right, and zero outputs are indicated by small open circles, and non-zero inputs and outputs by the bullets. The algorithm of the angular representation of the generator is described as follows:
and
and
and ;
and
and
and
and
The transform is The heap of the transform (shown in a red circle) is denoted by , because this component was renewed three times. If you change the last rotation by the angle , then the last step of calculation changes as
- 7’
.
This is the transform with the heap at point 4,
The transform of the input signal z is calculated as follows:
The transform is (see
Figure 2, part (b))
The quantum analogue of this transformation, which is called 3-qubit QsiHT, is defined as the following transformation of amplitudes. Consider the 3-qubit representations of the signal generator
and the input signal
,
Definition 1. The quantum transform of the generator superposition is defined as and the transform of is defined as For the
-qubit QsiHT, we consider the roadmap that is shown in
Figure 3 in part (a). This map describes the scheme of processing the signal-generator
and it includes the column of binary representation of numbers
, which allows us to verify if all butterflies operate only on disjoint bit-planes. The horizontal lines connecting the outputs and inputs of the butterflies are not shown (the qubits are not connected by traditional wires). The corresponding quantum circuit of the analogue 3-qubit QsiHT with 7 controlled rotation gates is shown in part (b).
The matrix of this transformation can be written as
Here,
denotes the
matrix of the rotation by the angle
, that operates on the biplanes
and
, where
Example 2. Consider the generator ′ with the norm We describe the 8-point DsiHTs with the heaps at point numbers 0, 1, and 3.
- A.
The matrix of the 8-point DsiHT with the heap at point #0 can be written as
Here, the diagonal matrix is
Representing a matrix in integer form is convenient for consideration. The matrix
was calculated by using the roadmap shown in
Figure 3 in part (a). The set of angles of rotations is (in degrees)
The transform of the generator is
- B.
Now, we consider the 8-point DsiHT with the heap at point #1 and the corresponding 3-qubit QsiHT. It is clear that such a transformation can be obtained by adding one permutation (0,1), or the controlled Pauli X gate with the matrix
, that is,
, to the above transformation
. Here,
denotes the
identity matrix. We will calculate the transformation
without such additional permutation. The roadmap and the corresponding quantum circuit of this transformation are shown in
Figure 4 in parts (a) and (b), respectively. Note that the first output values of the first four butterflies are zero. In the roadmap in
Figure 3, part (a), the second output values of these butterflies are zero.
The matrix of this transformation can be written as
where the diagonal matrix is
The second row of the integer multiplier of the matrix
is equal to the generator. The set of rotation angles is
The transform of the generator is
Considering the 3-qubit superposition with the amplitudes of the given generator
the transform results in the following basis state:
.
Thus, we can write that
The 3-qubit superposition can be prepared by seven rotations as
The apostrophe is used for the matrix transposition. The quantum circuit to initiate the 3-qubit superposition
from the basis state
is given in
Figure 5.
- C.
The matrix of the 8-point DsiHT with the heap at point #3 can be written as follows:
Here, the diagonal matrix is
The set of rotation angles is
The transform
.
Figure 6 shows the roadmap and the quantum circuit for this transformation in parts (a) and (b), respectively.
One can note that the above three circuits with seven rotation gates each have a similar form. The same is true for all 3-qubit QsiHTs with heaps at other points. Therefore, all eight 3-qubit QsiHTs with heaps at points
can be described by a single quantum circuit, which is shown in
Figure 7 in part (a). There are four numbered control bits, each of which is represented on this diagram by a diamond shape. These diamonds describe 0- or 1-control qubits, depending on the heap point
. The table in part (b) shows the value of each of these control qubits. Each row in this table shows the same set of control qubits for pairs
and
, for the transformations
and
when
They differ only in the angles at the last rotation gate
as
and
, respectively.
We can redraw the circuit in
Figure 5 for the general case of preparing the given 3-qubit state
from one of the basic states
, where
Such a single quantum circuit is given in
Figure 8 with four changing control qubits indicated by the small diamond-shape figures, which have the same meaning as indicated in the table in
Figure 7 in part (b). For each
, the change of only one angle
by (
) allows us to prepare two copies of the 3-qubit
from the basis states
and
.
Similar circuits can be composed for calculating the
-qubit QsiHTs with the heap at different points, when
.
Figure 9 shows the general quantum circuit for all sixteen 4-qubit DsiHTs,
, with the heap at points
This circuit was drawn up based on 16 roadmaps of the 4-qubit QsiHTs, which are given in
Supplementary Materials S1.
The ‘reverse’ circuit to initiate the 4-qubit superposition
from the basis states
, is given in
Figure 10. Here, we use the notation
There are 11 changing control qubits, which are each numbered and shown in a diamond shape. These control qubits are defined in
Table 2, for all pairs of heap points
and
when
The numbers 0 in this table indicate that the diamond control qubits are 0-control qubits, and the numbers 1 are for 1-control qubits.
There are 15 rotation gates
in total in the above quantum circuit (in
Figure 9). Each of these rotations is of type
or
.
Table 3 shows what type of rotation gate is used for all of these gates in the 4-qubit QsiHTs with the heaps at points
The number 1 stands for the rotation
and 2 for the rotation
For the 4-qubit QsiHT with heap point
}, the rotations are the same, as for the heap point (
excluding the last column for rotation gate #15 to be of type
(or 2 in the table).
A similar table for the 3-qubit QsiHTs, which are calculated by the general circuit in
Figure 7, is given in
Table 4. This table can be obtained from
Table 3, after deleting the columns for gates #5, 6, 7, 8, 11, 12, 14, and 15, as well as the last four rows.
The circuits in
Figure 3,
Figure 4 and
Figure 6 show a recurring pattern in the construction of roadmaps and circuits for the higher qubit QsiHTs. To illustrate this, we consider the 4-qubit QsiHT.
Example 3. The 4-qubit QsiHT with the heap at point #5 (and point #13) is considered. The roadmap for this transformation is shown in Figure 11. This roadmap was designed by using similar parts in order to simplify the construction of large qubit circuits using small qubit circuits.
Figure 12 illustrates a scheme of calculation of the 4-qubit transformation, by using the similar 3-qubit transformations which are controlled by the first qubit.
The full circuit with 15 controlled rotation gates is given in
Figure 13. This circuit can be used for both transformations
and
. Only the angle of the last rotation gate needs to be changed from
(for
) to
(for
).
The roadmaps and quantum circuits for all 4-qubit QsiHTs
are given in
Supplementary Materials S1. The general circuit for these transformations is given in
Figure 14.
The angle is
, that is, it changes with
. Three control qubits in the shape of a diamond each correspond to 0- or 1-control qubits. The meaning of these three control qubits is given in
Table 5. This table is easy to remember, since it shows the numbers
in their binary representation.
3. The Narrowed DsiHT
In this section, we consider the concept of the narrowed
-point DsiHT, which processes signals not on all bit planes. As an example, we consider the
case with the condition that the first two components of the input signals do not change. This transformation is denoted by
. We consider a generator
and an input signal
The transformation is defined as
under the condition that
where
is the norm of the vector
(
). The 8-point DsiHT,
can be considered as
The 3-qubit superposition of the generator
is transformed into the following superposition:
In the general case of , we denote by the narrowed -point DsiHT (as well as its quantum analogue, the narrowed -qubit QsiHT), which processes all bit planes starting from bit plane number , where . Also, we consider , when .
Example 4. Consider the generator with norm The matrix of the narrowed 3-qubit QsiHT, can be written as
Here, the diagonal matrix is
Five rotations in this transformation work with the following angles:
The transform of the generator is
On the quantum 3-qubit superposition
the transform is calculated as follows:
The roadmap and the quantum circuit of this transformation are shown in
Figure 15 in parts (a) and (b), respectively.
We also consider the narrowed 3-qubit QsiHT,
. The matrix of this transformation can be written as
where the diagonal matrix
Four rotations with the angles from the set
are used in this transformation. The roadmap of this transformation is shown in
Figure 16 in part (a), and the quantum circuit is given in part (b). The transform of the generator is
and for the 3-qubit superposition is
All rotations and bit planes on which the rotations work are given in
Table 6, for the narrowed 3-qubit QsiHTs
, when
The simple notations are used in this table. For example,
for
means that on bit planes 2 and 3, the rotation
works. For the transformation for
the notation
means that on bit planes 4 and 5, the rotation
works.
The roadmaps and the quantum circuits for the 4-qubit QsiHTs,
,
, were first given in [
30] (with a slightly different designation,
). Following this work, many roadmaps were redrawn to have a unique form of roadmaps for a large number of qubits. These roadmaps and quantum circuits for the 4-qubit QsiHTs are given in
Supplementary Materials S2. Now, let us look at one of them and illustrate a simple recurrent form of composition of such transformations.
Example 5. The 4-qubit QsiHTs, , is described. Figure 17 shows the roadmap of the transformation with 13 butterflies, or rotations. When this roadmap was made, it was divided into several parts that show us a recurrent form. Therefore, the 4-qubit transformation
can be easily constructed using the circuits of the 3-qubit transformations
and
, as shown in
Figure 18.
Figure 19 shows the full quantum circuit with 13 rotation gates for calculating this transformation.
The general circuit for the first eight transformations
when
, is shown in
Figure 20 in part (a). Three numbered control qubits, each in the shape of a diamond, are the same 0- or 1-control qubits, as in the circuit given in
Figure 14. The second part of the transformations,
when
can be reduced to the calculation of the 3-qubit transformations
, which are controlled by the 1st qubit. The general circuit for these 4-qubit transformations is shown in part (b).
Table 7 shows all bit planes and types of rotations used in the narrowed 4-qubit QsiHTs
, for
For each of these transformations, the bit planes have been divided into two parts, namely, from 0 to 7 (shown in red color) and from 8 to 15 (shown in black color). The total number of bit planes, as well as the rotations, is equal to 120. The roadmaps and the quantum circuits for these transformations are given in
Supplementary Materials S2. According to the circuits in
Figure 20, this table can be divided into two parts, with the first 8 transformations
, for
and the next ones for
In turn, the second part can be divided similarly for transformations defined for
, when
and
.
It is obvious that this table can be used to generate a 4-qubit operation. This can be done by randomly selecting the angle values for all 120 rotations.
5. DsiHT-Based QR Decomposition
In this section, we briefly describe the QR decomposition of a
unitary matrix, when
[
21,
38]. The DsiHTs with fast paths will be used for the decomposition to avoid any permutations. The DsiHT-based method is described in our previous work [
30], but with different roadmaps and only for the cases when
, and
. In other words, we were able to calculate any 2-, 3-, and 4-qubit operations (real and complex) by only rotations.
The unitary matrix with real or complex coefficients can be presented as , where is a unitary matrix which is composed by matrices of the DsiHTs and is a diagonal matrix, with coefficients lying on the unit circle. During this decomposition by DsiHTs, the matrix is transformed sequentially into a diagonal matrix . We consider the case when the matrix is real. The case with complex matrices can also be described by the complex DsiHTs with the same set of roadmaps.
The method of QR decomposition is simple and illustrated below, for a unitary 8
matrix,
The matrix diagonalization is accomplished by
DsiHTs,
The first transformation, is generated by the first column of the first matrix, , in Equation (64). Applying this transformation on each column of , we obtain a new unitary matrix (the second one in Equation (64)). The matrix is unitary. Therefore, except for the first coefficient on the diagonal of the matrix , all coefficients of the first row and column are equal to 0.
In the second stage of calculation, the 8-point narrowed DsiHT, is generated by the second column of the matrix Then, the new unitary matrix will have zero coefficients on the first two rows and columns, except for the coefficient on the diagonal, as shown in Equation (64).
In the next stage of calculation, the 8-point narrowed DsiHT, is generated by the second column of the matrix Using this transformation, we obtain the unitary matrix , which will have zero coefficients on the first three rows and columns, except the coefficient on the diagonal.
Similar calculations continue by generating the 8-point narrowed DsiHTs, , , by the kth column of each of the new matrices, until the matrix diagonalization is completed.
After diagonalization, from Equation (65), we obtain the decomposition of the matrix,
In each of the inverse transformations
,
rotations are performed in reverse order with angles of opposite signs. The total number of rotations in this QR decomposition is 28.
120 rotation gates are used in the QR decomposition of a real 4-qubit operation,
As shown in [
30], the matrix
is diagonal with coefficients
. Therefore, one phase shift gate
with the matrix
and
is needed, if the last coefficient is
, otherwise
. Therefore, we can write
It is the four 1-controlled shift gate.
The same is true for any
-qubit operation. For example, the QR decomposition of a 5-qubit operation by the DsiHTs,
requires 496 rotation gates plus one controlled phase shift gate
. The first half of the 5-qubit narrowed QsiHTs
can be calculated with fast paths, as shown in
Table 8. The roadmaps for these transformations are given in
Supplementary Materials S3.
The block diagrams of quantum circuits to calculate all 31 transformations
are given in
Figure 23. Four numbered control qubits, each in the diamond shape, in the first diagram (shown in part (a)) for the first sixteen DsiHTs,
are encoded by the numbers
in the binary representation. For instance, for
control qubits number 1, 2, 3, and 4 are the 0-, 1-, 0-, and 1-control qubits, respectively.
The circuit for calculating the 5-qubit QR decomposition of the matrix
by the DsiHTs,
is given in
Figure 24. The angle of the controlled phase gate is
or
Note that the transformation
is the identity transformation and can be removed from the above circuit. All matrices in this equation are real and unitary. Therefore, the matrix
can be written
The circuit for calculating the 5-qubit operation
is given in
Figure 25. Here,
denotes the transpose, or the inverse, matrix
The circuits for operations with a large number of qubits can be composed from the circuits with a small number of qubits in a similar way. For instance, all 63 narrowed QsiHTs, which are required for the QR decomposition of 6-qubit operations, are described by the circuits with the block diagrams shown in
Figure 26. Five numbered control qubits, each in the diamond shape, in the diagram
(shown in part (a)), are encoded by the number
in binary representation (with 5 bits), as for the case of the transformations
in
Figure 23. The total number of rotations in this QR decomposition is
. The circuit for calculating a 6-qubit operation can be described similarly to the circuit for a 5-qubit operation, which is shown in
Figure 25.
The main advantage of the proposed QsiHT-based QR decomposition of -qubit operations (with a real unitary matrix), when .
- •
An iterative, or recurrent, form of road mapping is used for all QsiHTs, including the narrowed QsiHTs;
- •
It requires only 2D elementary rotations and does not require any permutations, including controlled NOTs;
- •
This gives us a transparent quantum computational circuit;
- •
Maximum of () elementary rotations plus one controlled phase shift gate are the gates required for the circuit;
- •
Any multi-qubit operation can be generated by the encoding table of angles in the QsiHTs. For instance, 5-qubit operations can be generated using randomly selected angles of the 496 rotations in the encoding
Table 7 and
Table 8.