## CALA- : A Quantum Library for Realizing Cost-Effective 2-, 3-, 4-, and 5-bit Gates on n IBM Quantum Computers using Bloch Sphere Approach, Clifford+T Gates, and Layouts

Ali Al-Bayaty Electrical and Computer Eng. Dept. Portland State University Oregon, USA albayaty@pdx.edu

Xiaoyu Song Electrical and Computer Eng. Dept. Portland State University Oregon, USA songx@pdx.edu

Marek Perkowski Electrical and Computer Eng. Dept. Portland State University Oregon, USA h8mp@pdx.edu

Abstract -We introduce a new quantum layout-aware approach to realize cost-effective n -bit gates using the Bloch sphere, for 2 ≤ n ≤ 5 qubits. These n -bit gates are entirely constructed from the Clifford+T gates, in the approach  of  selecting  sequences  of  rotations  visualized  on  the  Bloch  sphere.  This  Bloch  sphere  approach ensures to match the quantum layout for synthesizing (transpiling) these n -bit gates into an IBM quantum computer. Various standard n -bit gates (Toffoli, Fredkin, etc.) and their operational equivalent of our proposed n -bit  gates  are  examined  and  evaluated,  in  the  context  of  the  final  quantum  costs,  as  the  final  counts  of generated IBM native gates. In this paper, we demonstrate that all our n -bit gates always have lower quantum costs than those of standard n -bit gates after transpilation. Hence, our Bloch sphere approach can be used to build a quantum library of various cost-effective n -bit gates for different layouts of IBM quantum computers.

Keywords : Bloch sphere, CALA-n, Clifford+T gates, IBM quantum computers, quantum layouts, transpilation

## 1 INTRODUCTION

A quantum gate, in general, is classified into a single-qubit, double-qubit, or multiple-qubit gate. A single-qubit gate directly performs its quantum operation on a single qubit. For a double-qubit gate, one of its two qubits operates the quantum operation, while the other qubit represents the output of this quantum operation. Whileas for a multiple-qubit gate, n -1  qubits  operate  the  quantum  operation,  and  the  remaining  qubit  represents  the  output  of  this  quantum operation, where n ≥ 3. For that, the operating qubits are termed the 'control qubits', and the output qubit is termed the 'target qubit'. To perform the quantum operation of a multiple-qubit (or a double-qubit) gate on its target qubit, all control qubits should be set to the |1  state, except for the following two quantum gates: ⟩

- · The SWAP (as a double-qubit) gate has two target qubits with no control qubits specified. This gate always switches the indices of its two input qubits as swapped target qubits.
- · The  controlled-SWAP  (as  a  multiple-qubit)  gate  has  one  control  qubit  and  two  target  qubits.  This  gate performs the same switching operation as the SWAP gate, when its control qubit sets to the |1  state. The ⟩ controlled-SWAP gate is the so-called 'Fredkin gate'.

In addition, the quantum operations of single-qubit gates are categorized based on their rotations around the three axes (X-axis, Y-axis, and Z-axis) of the Bloch sphere [1-3]. Hence, the names of single-qubit gates are derived from their rotational operations around these three axes, e.g., the Pauli-X (X), Pauli-Y (Y), and Pauli-Z (Z) single-qubit gates rotate around the X-axis, Y-axis, and Z-axis of the Bloch sphere, respectively, in π radians. However, fractions of π are allowed to rotate single-qubit gates around their corresponding axes of the Bloch sphere, and accordingly such gates are termed the rotational-X (as RX( α )), rotational-Y (as RY( β )), and rotational-Z (as RZ( γ )) gates, where α β , , and γ are the rotational angles range between [0, ± 2π]. Note that the RX(+ π/2), RX(- π/2), RZ(+ π/2), RZ(- π/2), RZ(+ π/4), and RZ(- π/4) single-qubit gates are also called the √ X (or V), √ X  (or V † † ), √ Z (or S), √ Z  (or S ), † † √ Z (or 4 T),  and √ Z   (or  T )  gates,  respectively  [1-4].  Note  that  (i)  the  +  and  -  signs  indicate  the  counterclockwise  and 4 † † clockwise rotations around an axis of the Bloch sphere, respectively, (ii) the identity (I) gate is a single-qubit gate that does not perform any quantum operation, i.e., I does not rotate around any axis of the Bloch sphere, and (iii) the Hadamard (H) gate is a single-qubit gate that performs three quantum operations in the sequence of three single-qubit gates {S √ X S}, i.e., H half-rotates once around the X-axis and half-rotates twice around the Z-axis of the Bloch sphere.

When a number of control qubits are applied to a single-qubit X gate, the double-qubit or multiple-qubit gate is then constructed, e.g., the controlled-X (CX), controlled-controlled-X (CCX), or ( n -1)-controlled-X (C n -1 X) gate, where n ≥ 3 qubits. In quantum computing, the CX, CCX, and C n -1 X gates are the so-called 'Feynman', 'Toffoli (or 3-bit Toffoli)', and ' n -bit Toffoli' gates, respectively. Note that, in this paper, we used the term 'bit' to represent a qubit, as proposed by Barenco et al. [4]. Similarly, the double-qubit and multiple-qubit gates from single-qubit Y and Z gates can be constructed as well, e.g., the controlled-Y (CY), controlled-Z (CZ), ( n -1)-controlled-Y (C n -1 Y), and ( n -1)-controlled-Z (C n -1 Z) gates, where the C n -1 Y and C n -1 Z gates are also called the 'multiple-controlled-Y (MCY)' and 'multiple-controlled-Z (MCZ)' gates, respectively.

The quantum operations of all above-mentioned single-qubit, double-qubit, and multiple-qubit gates can be either (i)  expressed  mathematically  using  the  unitary  matrices  [1-4],  as  the  numerical  representation  of  their  quantum rotational operations, or (ii) represented geometrically using the Bloch sphere [1-3], as the visual representation of transitions for the states of a qubit after a gate (or a sequence of gates) applies on it.

A  specific  group  of  single-qubit  and  double-qubit  gates  form  the  so-called  'Clifford+T  gates'  [5-7],  which consists of: I, X, Y, Z, H, √ X, √ X , S, S † † , T, T , CX, CY, CZ, and SWAP. The Clifford+T gates are an important † aspect of quantum computing, since they (i) invert the phase of a Pauli gate, e.g., {Z X Z} = - X, and (ii) construct Pauli gates that a quantum processing unit (QPU) does not support them, e.g., a QPU only supports the X, S, and S † gates, but it does not support the Y gate, then {S X S } = Y. A QPU can support a limited set of single-qubit and † double-qubit gates, which are the so-called 'native gates' or 'basis gates'. For instance, the ibm\_brisbane QPU [8, 9] of 127 qubits only supports the native gates of I, X, √ X, RZ, and ECR (echoed cross-resonance). Since this QPU does not support all Clifford+T gates, then certain transformations for these native gates are required to construct other Clifford+T gates, e.g., the H gate is constructed using the transformation of {RZ(π/2) √ X RZ(π/2)} = {S √ X S}.

Note that the ECR gate is the only double-qubit native gate for most IBM QPUs of 127 qubits, since the IBM quantum system replaces its native CX gate with the ECR gate to: (i) minimize drift in error rates of recalibrations and coherent errors, and (ii) maximize the stability and extend the duration of measurements [10-12].

To realize a practical quantum application, a quantum circuit constructed from a set of single-qubit, double-qubit, and/or multiple-qubit gates is synthesized into a QPU. In IBM terminologies, this synthesis process is termed the 'transpilation' [3, 13]. The transpilation is the decomposition of a quantum circuit into a set of native gates. These native gates with their qubits are then routed, translated, and appropriately mapped into the architecture (the layout) of a QPU. The layout of a QPU defines how its physical qubits are arranged and connected together as neighboring and  non-neighboring  qubits.  The  neighboring  qubits  are  directly  communicated  using  double-qubit  native  gates; however, the non-neighboring qubits require a set of SWAP gates to switch their positions (indices) with other qubits for direct communications. The layout of ibm\_brisbane QPU has a maximum set of four neighboring physical qubits; such that, there is one physical qubit in the middle connected to three physical qubits.

In this paper, as a proof of concept for our work, the ibm\_brisbane QPU was utilized to transpile different quantum circuits consisting of a set of non-native gates, such gates are decomposed to their equivalent set of native gates, and the qubits of these native gates are then routed (if required) and mapped to match the physical qubits in the layout of ibm\_brisbane QPU. We noticed that the ibm\_brisbane QPU transpiles a quantum circuit of a few non-native gates into a cost-expensive quantum circuit of many native gates! Such a cost expense comes from: (i) the inefficient decomposition of non-native gates to native gates, and (ii) the limited layout connectivity of this QPU.

For instance, to decompose a non-native Toffoli gate, a number of SWAP gates are added to connect two controls with one target together, and adding more SWAP gates dramatically increases the quantum cost and depth of the final transpiled quantum circuit. A number of SWAP gates are added due to the inefficient decomposition of this Toffoli gate, i.e., the target qubit is inefficiently mapped between the two control qubits for the layout of this QPU. In this paper, for a final transpiled quantum circuit, the quantum cost is the total number of native gates, and the depth is the longest critical path through all native gates. When the depth is increased, the decoherence time (T2) [14-16] of the utilized physical qubits increases as well, which results in incorrect measurements.

The goal of this paper is to introduce a new quantum library for realizing cost-effective n -bit native gates, by efficiently transpiling n -bit non-native gates into IBM QPUs. These cost-effective n -bit gates are: (i) geometrically designed using the Bloch sphere, (ii) entirely built from the Clifford+T gates, and (iii) efficiently mapped into the layout of an IBM QPU. For that, we term this quantum library the 'Clifford+T-based Architecture of Layout-Aware n -bit gates (CALAn )', as well as to distinguish this CALAn from our previous work entitled 'Generic Architecture of Layout-Aware n -bit gates (GALAn )' [3], which is totally built from generic gates (as the Clifford+T gates and non-Clifford+T gates).

After transpiling with ibm\_brisbane QPU, the n -bit gates of CALAn always have lower quantum costs and fewer depths than that of their equivalent transpiled non-native n -bit gates, due to the fact that SWAP gates are never added to the final transpiled quantum circuits when using CALAn . In other words, for CALAn , the target qubit of an n -bit gate is always mapped in the middle between the control qubits.

Due to the limited layout connectivity of IBM QPUs, CALAn has a set of efficiently designed n -bit gates, where 2 ≤ n ≤  5 qubits. These n -bit  gates are: AND, NAND, OR, NOR, implication, inhibition [17, 18], controlled-√ X, controlled-√ X , SWAP, and Fredkin. However, when the number of physical neighboring qubits of IBM QPUs is † increased, the n in CALA-  increases as well. In other words, when the limited layout connectivity is decreased, the n n increases for greater than 5 qubits.

To  comply  with  the  limited  layout  connectivity  of  an  IBM  QPU,  our  3-bit  AND  gate  is  mainly  utilized  to efficiently construct  other n -bit  gates  of CALAn ,  since  we  proved that this 3-bit  AND  gate is  the  cost-effective counterpart of the cost-expensive Toffoli gate. The Toffoli gate is mostly associated with building different quantum gates, e.g., n -bit controlled-√ X, n -bit controlled-√ X , † n -bit Fredkin, and n -bit Toffoli gates, where n &gt; 3 qubits, for that  various  decompositions  were  discussed  and  proposed  in  [4,  19-23].  However,  after  transpiling  different decompositions of the Toffoli gate, we observed that they always have higher quantum costs and deeper depths than that  of  our  3-bit  AND  gate  of  CALAn .  Concluding  that  our  proposed  CALAn can  be  efficiently  utilized  as  a transpilation  software  package  for  IBM  QPUs,  to  cost-effectively  transpile n -bit non-native  (controlled-√ X, controlled-√ X , SWAP, Fredkin, and Toffoli) gates, in the context of lower quantum costs and fewer depths. †

## 2 METHODOLOGY

The Clifford gates (or Clifford group) are a special group of single-qubit and double-qubit gates consisting of: I, X, Y, Z, H, √ X, √ X , S, S † † ,  CX, CY, CZ, and SWAP gates. These Clifford gates play a significant role in quantum computing, since they (i) invert the phase of a Pauli gate, and (ii) construct Pauli gates  from other Pauli gates, as expressed in Eq. (1) below and stated in Table 1, where C is a Clifford gate, Pσ is a Pauli gate, PΣ is the resultant Pauli gate, the symbol (†) is the conjugate transpose of a gate, and the symbol ( ) is the matrix multiplication operator [4]. ⋅

$$C \cdot P _ { \sigma } \cdot C ^ { \dagger } = P _ { \Sigma }$$

Table 1. Transformations of Clifford gates for inverting the phases of Pauli gates and constructing other Pauli gates.

| C   | ⋅   | P σ   | ⋅   | C †   | =   | P Σ   |
|-----|-----|-------|-----|-------|-----|-------|
| H   | ⋅   | Z     | ⋅   | H     | =   | X     |
| S   | ⋅   | X     | ⋅   | S †   | =   | Y     |
| H   | ⋅   | X     | ⋅   | H     | =   | Z     |
| Z   | ⋅   | X     | ⋅   | Z     | =   | - X   |
| Z   | ⋅   | Y     | ⋅   | Z     | =   | - Y   |
| X   | ⋅   | Z     | ⋅   | X     | =   | - Z   |

Due to the importance of single-qubit T and T  gates and supporting them in most quantum systems [24-27], these † gates are added to the Clifford gates to form the Clifford+T gates, for gaining more error-mitigation and fault-tolerant quantum  computations  on  recent  Noisy  Intermediate-Scale  Quantum  (NISQ)  devices  [11,  16,  28].  In  quantum computing, the Clifford+T gates can be either (i) expressed mathematically using the unitary matrices, as the numerical representation of their quantum operations, or (ii) represented geometrically using the Bloch sphere, as the visual representation of transitions for the states of a qubit after a gate (or gates) applies on it.

The Bloch sphere is a three-dimensional geometry of three axes (X-axis, Y-axis, and Z-axis), which visualizes the quantum operation (as an axial-rotated operation in Hilbert space ℌ) of a gate (or gates) applied on a qubit [1, 2]. Since the quantum operations of all IBM native gates are mainly rotating around the X-axis and Z-axis of the Bloch sphere, we propose the XY-plane (as the top-view of the Bloch sphere) to design the cost-effective n -bit gates of CALA- , where 2 ≤ n n ≤ 5 qubits. In this XY-plane, an IBM (single-qubit or double-qubit) native gate rotates the state of a qubit by a counterclockwise rotational angle (+ θ) or a clockwise rotational angle (- θ), in radians. Figure 1(a) demonstrates the Bloch sphere with its three axes and their corresponding angular rotations, and Figure 1(b) illustrates the XY-plane of the Bloch sphere, where no quantum operation is applied on a qubit yet.

Figure 1. Schematics of the Bloch sphere consisting of: (a) the three axes (X-axis in blue, Y-axis in red, and Z-axis in green) with their corresponding counterclockwise rotational angles (+θx, +θy, and +θz), and (b) the XY-plane (as the top-view) for visualizing the quantum operations of IBM (single-qubit and double-qubit) native gates around the X-axis and Z-axis of the Bloch sphere.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01025v1-figure-c9414644-552d-4b38-8af8-a255aad865f7.jpg)

In general, please observe that:

- 1. The Dirac notation [1, 2] is employed in this paper to represent a set of qubits for: (i) the transitions of states in the XY-plane of the Bloch sphere, and (ii) designing the n -bit gates of CALAn , where the least significant qubit (LSQ) and the most significant qubit (MSQ) are on the right-side and the left-side of Dirac notation, respectively, e.g., |MSQ … LSQ . ⟩

- 2. All IBM single-qubit and double-qubit native gates are unitary gates [1, 2], and note that a few of them are non-Hermitian gates [1, 2], i.e., their quantum operations are not their own inverses. For instance, the √ X  is † the inverse gate of the √ X gate.
- 3. Some rotational gates alter the phase of a qubit, and the choice of rotational gates is a critical factor in designing a quantum circuit. For instance, the Z gate (as the π rotation around the Z-axis of the Bloch sphere)
- is not the same as the RZ(π) gate, due to the global phase difference, e.g., RZ(π) = [ e -i π 2 0 0 e i π 2 ] = -  Z and i the global phase is equal to '-  '. i

In our work, we introduce the approach of using the Bloch sphere as a 'geometrical design tool' to construct the n -bit gates of CALAn , where 2 ≤ n ≤ 5 physical qubits of an IBM QPU. To illustrate our Bloch sphere approach with ease, the XY-plane (as a circle) is divided into segments to represent the quantum rotations of Clifford+T gates as follows.

- 1. The 'semicircle' segment is half of the XY-plane that represents the quantum rotations of Z gates. Such that, the XY-plane has two semicircles.
- 2. The 'quadrant' segment is one-fourth of the XY-plane that represents the quantum rotations of S and S † gates. Such that, the XY-plane has four quadrants.
- 3. The 'octant' segment is one-eighth of the XY-plane that represents the quantum rotations of T and T  gates. † Such that, the XY-plane has eight octants.

For instance, Figure 2 illustrates these segments of the XY-plane, when a Clifford+T gate (Z, S, S , T, or T ) is † † applied on the qubit of a gate, which is initially set to the |+  state. ⟩

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01025v1-figure-7ca1f6b3-ef87-4d00-8abe-44c4531914d6.jpg)

Figure 2. The segments of the XY-plane (as the top-view of the Bloch sphere) consisting of: (i) two semicircles for the quantum rotations of Z gates, (ii) four quadrants for the quantum rotations of S and S  gates, and (iii) eight octants for the quantum rotations † of T and T † gates. The Z, S, S , T, and T  are a subset of the Clifford+T gates, which are applied on the qubit of a gate by rotating † † it around the center of this plane. Note that this qubit is initially set to the |+ ⟩ state.

Our proposed Bloch sphere approach mainly depends on the state transitions of a qubit in the XY-plane, which consists  of  the  above-mentioned  segments.  To  design  a  cost-effective  gate  of  CALAn using  the  Bloch  sphere approach, please observe our proposed 'geometrical design steps' as follows.

- Step 1: The qubit of a gate (as the target qubit) should be first placed on the XY-plane using the Clifford+T (H, √ X, or √ X ) gate, as a superposition gate. †
- Step 2: The Clifford+T (Z, S, S , T, and T ) gates rotate the target qubit around the Z-axis of the Bloch sphere, i.e., † † they rotate a qubit around the center of the XY-plane.
- Step 3: The Clifford+T (X) gate flips the position of the target qubit on the XY-plane around the X-axis of the Bloch sphere, i.e., the X gate flips a qubit on the opposite perimeter of the XY-plane in π radians.
- Step 4: The Clifford+T (CX) gate similarly acts as the X gate on the target qubit. However, the CX gate only operates when the other qubits (as the control qubits) of a gate are set to the |1  states. Note that the control ⟩ qubits are not placed on the XY-plane, and they remain on the Z-axis of the Bloch sphere in |0  or |1  state. ⟩ ⟩ Step 5: Based on the states of control qubits for a gate, the target qubit rotates around and/or flips in the XY-plane to reach its final state.
- Step 6: Finally, another Clifford+T (H, √ X, or √ X ) gate re-places the final reached state of the target qubit from † the XY-plane to the Z-axis of the Bloch sphere. Such a replacement is considered the final output of a gate, for either the |1  state (as a solution) or the |0  state (as a non-solution). ⟩ ⟩

From the geometrical design steps, when the target qubit of a gate initially sets to the |0  state, the choice of a ⟩ Clifford+T  (H, √ X,  or √ X )  gate  (in  Step  1)  plays  a  crucial  role  in  the  Bloch  sphere  approach,  since  such  a † superposition gate determines where the target qubit should be placed in the XY-plane. Hence, the subsequent steps (from Step 2 to Step 6) should be carefully taken into account depending on the chosen superposition gate as follows.

- 1. The H gate places the target qubit on the XY-plane at the |+  state. ⟩
- 2. The √ X gate places the target qubit on the XY-plane at the |i ⟩ state.
- 3. The √ X  gate places the target qubit on the XY-plane at the |+ † i ⟩ state.

In this paper, we design various cost-effective n -bit gates of CALAn for IBM QPUs, and these n -bit gates of CALA-  are: visually designed using our proposed Bloch sphere approach, entirely constructed using Clifford+T n gates only, and efficiently mapped to well-suit the layout of an IBM QPU. Table 2 states these cost-effective n -bit gates of CALAn ,  based on their quantum purposes as the square-rooting, switching, Boolean, and distance gates, where 2 ≤ n ≤ 5 qubits.

Table 2. Summary of cost-effective n -bit gates of CALAn based on their quantum purposes (square-rooting, switching, Boolean, and distance), where 2 ≤ n ≤ 5 qubits.

n -bit gates of CALAn

|   n qubits | Square-rooting gates                  | Switching gates   | Boolean gates                                   | Distance gates   |
|------------|---------------------------------------|-------------------|-------------------------------------------------|------------------|
|          2 | controlled- √ X and controlled- √ X † | SWAP              | -                                               | -                |
|          3 |                                       | Fredkin           | AND, NAND, OR, NOR, implication, and inhibition | Miller [29-31]   |
|          4 | -                                     | Fredkin           | AND, NAND, OR, NOR, implication, and inhibition | -                |
|          5 | -                                     | -                 | AND, NAND, OR, NOR, implication, and inhibition | -                |

## 2.1 The 2-bit gates of CALAn

The 2-bit gates of controlled-√ X, controlled-√ X , and SWAP play important roles in quantum computing, since they † are mainly used to build Peres gate [31, 32], inverse Peres gate [32], arbitrary gates for the majority of three variables in a function [29, 30, 32-35], just to name a few. These three 2-bit gates are IBM non-native double-qubit gates. Therefore, when these three 2-bit gates are transpiled with an IBM QPU, their final transpiled quantum circuits will have higher quantum costs and deeper depths, as shown in Figure 3. For these reasons, we re-design these three 2-bit gates using the Bloch sphere approach, to form a new set of cost-effective 2-bit gates for IBM QPUs with lower quantum costs and fewer depths, as shown in Figure 4 and stated in Table 3.

From the Bloch sphere approach, the 2-bit gates of controlled-√ X and controlled-√ X  are simply re-designed † using only one CX gate, with a fewer number of single-qubit gates. However, the SWAP gate is directly re-designed based on the iSWAP gate proposed by the IBM quantum platform [36].

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01025v1-figure-548d1864-371d-48eb-9aa6-6a93249775c4.jpg)

Figure 3. An IBM QPU standard transpilation from non-native gates to native gates for the 2-bit gates of: (a) controlled-√ X gate,

(b) controlled-√ X  gate, and † (c) SWAP gate, where a and b are the indices of two qubits, c is a control qubit, and t is a target qubit.

Figure 4. Re-designing IBM non-native gates to IBM native gates using the Bloch sphere approach for the 2-bit gates of: (a)

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01025v1-figure-6a40a634-f213-43d2-9bf4-d75305710d9e.jpg)

controlled-√ X gate, (b) controlled-√ X  gate, and † (c) SWAP gate, where a and b are the indices of two qubits, c is a control qubit, and t is a target qubit. Note that (i) the Bloch sphere approach only utilizes Clifford+T gates, (ii) the SWAP gate is re-designed based on the iSWAP gate proposed by the IBM quantum platform [36], and (iii) the H gate is an IBM non-native gate, so further decomposition is required to the sequence of three IBM native gates {S √ X S}   {RZ(π/2) √ X RZ(π/2)}.

Table 3. Comparison of the quantum costs and depths between the IBM standard transpilation and the Bloch sphere approach for the 2-bit gates (controlled-√ X, controlled-√ X , and SWAP), based on the final counts of IBM single-qubit ( † √ X, X, and RZ) and double-qubit (CX) native gates for the final transpiled quantum circuits of these 2-bit gates.

Counts of IBM native gates and depths for the final transpiled quantum circuits

|                 | Using IBM standard transpilation   | Using IBM standard transpilation   | Using IBM standard transpilation   | Using IBM standard transpilation   | Using IBM standard transpilation   | Using the Bloch sphere approach   | Using the Bloch sphere approach   | Using the Bloch sphere approach   | Using the Bloch sphere approach   | Using the Bloch sphere approach   |
|-----------------|------------------------------------|------------------------------------|------------------------------------|------------------------------------|------------------------------------|-----------------------------------|-----------------------------------|-----------------------------------|-----------------------------------|-----------------------------------|
| 2-bit gates     | √                                  | X                                  | CX                                 | RZ                                 | Depth                              | √                                 | X                                 | CX                                | RZ                                | Depth                             |
| controlled- √   | 2                                  | -                                  | 2                                  | 5                                  | 9                                  | 2                                 | -                                 | 1                                 | 4                                 | 7                                 |
| controlled- √ † | 2                                  | -                                  | 2                                  | 5                                  | 9                                  | 2                                 | -                                 | 1                                 | 4                                 | 7                                 |
| SWAP            | -                                  | -                                  | 3                                  | -                                  | 3                                  | 2                                 | -                                 | 2                                 | 4                                 | 3                                 |

## 2.2 The 3-bit AND gate of CALAn

In this paper, we geometrically prove that the quantum operation of the 3-bit AND gate is the cost-effective counterpart of the Toffoli gate. Therefore, the 3-bit AND gate can be utilized to construct various n -bit gates of CALAn , where 3 ≤ n ≤ 5 qubits. The 3-bit AND gate consists of three qubits: two control qubits and one target qubit. By using the Bloch sphere approach, the 3-bit AND gate is designed using the geometrical design steps, based on the following quantum design constraints.

- 1. The XY-plane of the Bloch sphere : Two H gates are utilized here, the first H gate places the target qubit (initially set to the |0  state) to the XY-plane, while the second H gate returns this qubit to the Z-axis of the ⟩ Bloch sphere, as a |1  state (solution) or a |0  state (non-solution). ⟩ ⟩
- 2. The Clifford+T gates : The two controls flip the target qubit (in the XY-plane) based on their states, using a set of CX gates. The T and T  gates rotate the target qubit around the center of the XY-plane. †
- 3. The  limited  layout  connectivity  of  an  IBM  QPU :  The  target  qubit  is  efficiently  mapped  into  the  middle between the two control qubits, so SWAP gates are never added to the final transpiled quantum circuit.

The 3-bit AND gate is designed as a quantum circuit with a symmetrical structure, as originally introduced by Barenco et al. [4]  for decomposing the Toffoli gate as shown in Figure 5(a). Note that Barenco et  al. utilized  the unitary matrices and RY gates for such a decomposition. The RY gates do not belong to the Clifford+T gates, as well as they are IBM non-native gates, so further decompositions are required. However, we generalize such a symmetrical structure using the Bloch sphere approach to: (i) select the appropriate set of Clifford+T gates for the 3-bit AND gate, and (ii) develop various n -bit gates of CALAn based on this 3-bit AND gate. Table 4 states the differences between the work of Barenco et al. and our work in this paper.

For the symmetrical structure of the 3-bit AND gate, the identical neighboring Clifford+T gates will cancel each other, when any of the controls is in the |0  state (as a false Boolean value), and then the target qubit remains at its ⟩ initial  |0 ⟩ state  (as  the  indication  of  a  non-solution).  For  this  reason,  we  are  interested  here  in  decomposing  and generalizing the quantum gates with symmetrical structures, and not with the non-symmetrical structures, which are difficult to be generalized using the Bloch sphere approach based on the layout of an IBM QPU, i.e., by directly connecting all control qubits to the target qubit and without any connection between the control qubits. For instance, Figure 5(b) demonstrates how the IBM quantum system transpiles a Toffoli gate (two controls and one target) into a quantum circuit with a non-symmetrical structure, where all control and target qubits are connected to each other. Note that the connection between one qubit to another qubit means that these two qubits utilize one CX gate; thus, one qubit represents a control while another qubit represents the target.

Table 4. Decomposition questionnaires and differences between the work of Barenco et al. and our work.

| Questions                                             | Barenco et al. [4] (Toffoli gate)                             | Our work (3-bit AND gate of CALA- n )                                          |
|-------------------------------------------------------|---------------------------------------------------------------|--------------------------------------------------------------------------------|
| Has a symmetrical structure?                          | Yes                                                           | Yes                                                                            |
| How are the gates chosen?                             | Unitary matrices and mathematical calculations                | Bloch sphere approach and Clifford+T gates                                     |
| If the Bloch sphere is used, which plane is utilized? | The Bloch sphere is not used                                  | The Bloch sphere is used: The XY-plane                                         |
| Which Boolean operations can be derived?              | AND                                                           | AND, NAND, OR, NOR, and implication, inhibition                                |
| Suitable for IBMQPUs?                                 | No, RYand CZ gates need to be decomposed (expensive circuits) | Yes, decompositions are not required (cheap circuits based on quantum layouts) |

Figure 5. Decompositions of a Toffoli gate into the quantum circuits with: (a) a symmetrical structure [4] for all control qubits connected to  the target  qubit  without any  connection  between  the  controls,  and (b) a  non-symmetrical structure for all  qubits (controls and target) connected to each other, which is the outcome of IBM QPU transpilation. Note that the RY gates do not belong to the Clifford+T gates, and they are IBM non-native gates.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01025v1-figure-6088a7f6-f430-414a-80d1-440910f143ad.jpg)

Figure 6 illustrates our generalized symmetrical structure for the quantum circuit of 3-bit AND gate of CALAn , which is composed of three Clifford+T double-qubit gates (as CX) and the following Clifford+T single-qubit gates.

- 1. The SP1 and SP2 are the superposition (H, √ X, and/or √ X ) gates. †
- 2. The AX1 and AX2 are the auxiliary gates. Both AX1 and AX2 will be utilized later for constructing various n -bit gates of CALAn , and AX1 = AX2 = I for the 3-bit AND gate.
- 3. θ (as θ1, θ2, θ , and θ4) denotes four Clifford+T gates. Due to the symmetrical structure of the 3-bit AND gate, 3 we assume that θ1   θ3 and θ2   θ4.

Figure 6. Our generalized symmetrical structure for the quantum circuit of 3-bit AND gate of CALAn , where θ (θ1, θ2, θ3, θ4) corresponds to four Clifford+T gates (θ1   θ3 and θ2   θ4), SP1 and SP2 are the superposition gates, AX1 and AX2 are the auxiliary gates for constructing various n -bit gates of CALAn (3 ≤ n ≤ 5), and the target qubit is initially set to the |0  state. ⟩

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01025v1-figure-e9623d40-1b51-4e34-b265-51f557dec6b1.jpg)

In  Figure  6,  all  control  qubits  are  directly  connected  to  the  target  qubit  using  three  CX  gates,  without  any connection between the controls. Such unidirectional connections guarantee two advantages: (i) the target qubit can be switched with any of the control qubits, to match the quantum layout of an IBM QPU, i.e., the target qubit is placed in the middle between the two control qubits, and (ii) the SWAP gates will not be added to the final transpiled quantum circuit of this generalized symmetrical structure, i.e., this yields to have a lower quantum cost and a fewer depth.

The superposition gates (SP1 and SP2) are defined here as H gates, to place the target qubit from/to the Z-axis and the XY-plane of the Bloch sphere. To provide our proposed CALAn as an open and generic quantum library, other superposition  gates  can  be  utilized  for  SP1  and  SP2.  For  instance,  the √ X and √ X   gates  can  be  utilized  as  the † superposition gates for SP1 and SP2 gates in different permutations. However, different geometrical analyses should be taken into account when choosing these √ X and √ X  gates for the 3-bit AND gate. Note that the † √ X gate is an IBM native gate, while the H and √ X  gates are IBM non-native gates, for that further decompositions are required. †

From Figure 2 and Figure 6, the Clifford+T gates (as θ1, θ2, θ3, and θ4) of the 3-bit AND gate are accurately chosen  based  on:  (i)  the  symmetrical  structure  of  this  gate,  (ii)  the  segmental  analyses  of  two  semicircles,  four quadrants, and eight  octants,  and  (iii)  the  flipping  functionalities  of  three  CX  gates.  Subsequently,  based  on  this symmetrical structure and the XY-plane of the Bloch sphere, the following 'geometrical design rules' for the 3-bit AND gate choose the accurate Clifford+T gates (θ1, θ2, θ3, and θ4), and these rules are step-by-step restricting possible choices of segments and Clifford+T gates.

- Rule 1: Define all Clifford+T gates as a set: CTG0 = {I, X, Y, Z, H, √ X, √ X , S, S , T, T , CX, CY, CZ, SWAP}. † † †
- Rule 2: Define all segments of the XY-plane as a set: SEG0 = {semicircles, quadrants, octants}.
- Rule 3: Since the target qubit is not controlling other qubits, then CTG0 is limited to a set of single-qubit Clifford+T gates: CTG1 = {I, X, Y, Z, H, √ X, √ X , S, S , T, T }. † † †
- Rule 4: Since SEG0 only identifies Clifford+T gates rotating by the Z-axis of the Bloch sphere, then CTG1 is limited to a set of single-qubit Z-based gates: CTG2 = {Z, S, S , T, T }. † †
- Rule 5: Since there are four θ (as Clifford+T gates in Figure 6) for θ1 = θ3 and θ2 = θ4, then the semicircles (as Z gates)  are  excluded  to  prevent  similar  repetitive  circular  rotations  in  the  XY-plane;  such  that,  SEG1  is restrictive of SEG0 and CTG3 is restrictive of CTG2: SEG1 = {quadrants, octants} and CTG3 = {S, S , T, T }. † †
- Rule 6: Based on Rule 5, the four Clifford+T gates are reduced to two gates, and the quadrants are excluded to prevent similar repetitive circular rotations in the XY-plane: SEG2 = {octants} and CTG4 = {T, T }. †
- Rule 7: Apply CTG4 (for all permutations of T and T ) with three CX gates (for all states of control qubits) on SEG2 † (octants)  of  the  XY-plane,  then  the  correct  permutations  of  T  and  T   that  implement  the  Boolean  AND † function are plugged into the four Clifford+T gates (as θ1, θ2, θ3, and θ4) of 3-bit AND gate.

For SP1=SP2=H and AX1=AX2=I, after applying the above-mentioned geometrical design rules to construct the 3-bit AND gate, i.e., to implement the Boolean AND function, the suitable values for the four Clifford+T gates in the sequence of {θ1, θ2, θ3, θ4} are generated in the sequence of {T , T, T , T} (or {T, T , T, T }), respectively. Table 5 † † † † analytically verifies these geometrical design rules for all states of control qubits, and Figure 7 visually illustrates these verifications. Hence, the 3-bit AND gate is geometrically designed and proven as the functional counterpart of the Toffoli gate. Figure 8 shows the complete quantum circuit of the 3-bit AND gate of CALAn , which is completely constructed using a restricted set of Clifford+T gates (I, H, T, T , and CX). †

Table 5. Analytical verifications for the accurate four Clifford+T gates (θ1, θ2, θ3, and θ4) of the 3-bit AND gate, when the target qubit is initially set to the |0  state and AX1=AX2=I. Note that ⟩ α π β √ 2 (| 0  + e ⟩ i α π β ⟩) , α and β are numerical values, and e ± ix is the Euler's formula of cos( x ) ±   sin( i x ).

Applying quantum gates on the target qubit

| |control 2 control 1 ⟩   | SP 1 (H)   | θ 1 (T † )   | CX of control 2   | θ 2 (T)   | CX of control 1   | θ 3 (T † )   | CX of control 2   | θ 4 (T)   | SP 2 (H)   | As Boolean values   |
|--------------------------|------------|--------------|-------------------|-----------|-------------------|--------------|-------------------|-----------|------------|---------------------|
| |0 0 ⟩                   | |+ ⟩       | 7π 4         | -                 | |+ ⟩      | -                 | 7π 4         | -                 | |+ ⟩      | |0 ⟩       | False               |
| |0 1 ⟩                   | |+ ⟩       | 7π 4         | -                 | |+ ⟩      | |+ ⟩              | 7π 4         | -                 | |+ ⟩      | |0 ⟩       | False               |
| |1 0 ⟩                   | |+ ⟩       | 7π 4         | π 4               | |+ i ⟩    | -                 | π 4          | 7π 4              | |+ ⟩      | |0 ⟩       | False               |
| |1 1 ⟩                   | |+ ⟩       | 7π 4         | π 4               | |+ i ⟩    | |- i ⟩            | 5π 4         | 3π 4              | |- ⟩      | |1 ⟩       | True                |

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01025v1-figure-b129fcc7-bb3d-4b85-8bbb-e347f940773b.jpg)

Figure 7. Schematics of the XY-plane of the Bloch sphere for verifying the accurate four Clifford+T gates (θ1=T † , θ2 T, θ3=T † , and θ4=T) for the 3-bit AND gate of CALAn , for all states of control qubits (control1 and control2): (a) both controls = |0 , ⟩ (b) control1 = |1  and control2 = |0 , ⟩ ⟩ (c) control1 = |0  and control2 = |1 , and ⟩ ⟩ (d) both controls = |1 , where the target qubit initially sets ⟩ to the |0  state, the arrows in orange indicate the octant-based rotations around the Z-axis of the Bloch sphere, and the arrows in ⟩ blue indicate the rotations around the X-axis of the Bloch sphere.

Figure 8. The generalized symmetrical structure for the quantum circuit of 3-bit AND gate of CALAn with the accurately verified four Clifford+T gates (θ1 θ3=T †  and θ2 θ4=T), when SP1=SP2=H and AX1=AX2=I and. Note that the AX1 and AX2 gates can be removed from this structure (as indicated in red areas), to further reduce the quantum cost and the depth as well.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01025v1-figure-1d2fd9ac-d2d5-4419-8c4a-005e20581322.jpg)

## 2.3 The 3-bit Boolean gates of CALAn

From Figure 6 and Figure 8, when the four Clifford+T gates (θ1, θ2, θ3, and θ4) are not symmetrical anymore, various 3-bit  gates  of  CALAn can  be  constructed  using  the  Bloch  sphere  approach.  By  repeating  the  above-mentioned geometrical design rules for these four non-symmetrical Clifford+T gates, the restrictive sets of CTG4 = {S, S , T, T } † † and SEG2 = {quadrants, octants} are then obtained, and the minimum number of for such 3-bit gates of CALAn is 256 gates, by assuming that SP1=SP2=H and AX1=AX2=I, as stated in Eq. (2), where ||.|| indicates the total number of gates and θ = {θ1, θ2, θ3, θ4}.

$$\text{Number of $3$-bit gates in CALA$-n} = \| SP _ { 1 } \| \times \| AX _ { 1 } \| \times \| \, C T G _ { 4 } \, \| ^ { \dagger 0 \dagger } \times \| AX _ { 2 } \| \times \| SP _ { 2 } \| \, & ( 2 )$$

From Eq. (2), when the superposition and auxiliary gates have all permutative sets for their respective Clifford+T single-qubit gates, i.e., SP1=SP2={H, √ X, √ X } and AX1=AX2={I, X, † √ X, √ X , Z, S, S , T, T }, the maximum number † † † of all 3-bit gates of CALAn is equal to 186624 gates! Hence, such gates can implement massive numbers of quantum operations, including Boolean gates synthesizing, quantum gates synthesizing, phase inversion, just to name a few.

However, in this paper, we are interested in constructing quantum Boolean-based gates, such as AND, NAND, OR, NOR, implication, and inhibition. These quantum Boolean-based gates can be used to effectively build Boolean oracles [37, 38], especially for the problems structured in Product-of-Sums (POS) [39], Sum-of-Products (SOP) [40], Exclusive-or Sum-of-Products (ESOP) [41-43], constraints satisfiable problems-satisfiability (CSP-SAT) [44], and in designing XOR functions of two product gates of different Hamming distances [43, 45], just to name a few.

This paper is an introductory research for building the fundamental cost-effective n -bit gates of CALAn ,  and further geometrical analyses of the Bloch sphere can be utilized to construct various n -bit specific-task gates, such as AND-XOR SAT, OR-XOR SAT, majority, implication-inhibition, Phase-based gates for Phase oracles [37, 38], just to name a few. Hence, CALAn is an open and generic quantum library for prospective quantum computing research, to develop interesting and cost-effective n -bit quantum gates, which can be easily adapted with different layouts of physical neighboring qubits for superconducting quantum systems, e.g., the QPUs of IBM, Google, and Rigetti.

Table 6 states six 3-bit Boolean gates of CALAn that we are interested in our research, which are: AND, NAND, OR, NOR, implication, and inhibition, where the target qubit is initially set to the |0  state, SP1=SP2=H, and AX1 = I. ⟩ Note that, in Table 6, (i) all 3-bit Boolean gates of CALAn are completely constructed using Clifford+T gates (I, H, Z, T, T , and CX), (ii) the AX2 of a 3-bit Boolean-inverted gate is added as a Z (or - Z) gate, to invert the solutions of † its 3-bit Boolean gate, e.g., NAND and AND gates, (iii) the - Z gate can be easily constructed using the Clifford transformations as stated in Table 1, and (iv) the Z and - Z gates are accurately chosen to mitigate the phase differences in solutions, as illustrated in Figure 9 using the q-spheres [46]. In contrast to the Bloch sphere visualizing the states of one qubit, the q-sphere visualizes the states of multiple qubits, where (i) the size of a circle denotes the amplitude probability of a qubit, (ii) the color of a circle represents the global phase of a qubit, and (iii) the Dirac notations of all qubits are in the form of |target  control2  control1 ⟩ .

Table 6. Configurations of SP1, SP2, AX1, AX2, and θ (four Clifford+T gates) for six 3-bit Boolean gates of CALAn , where the target qubit is initially set to |0 ⟩ state, a is the first control (control1), and b is the second control (control2).

|                         | Configurations of Clifford+T gates applied on the target qubit   | Configurations of Clifford+T gates applied on the target qubit   | Configurations of Clifford+T gates applied on the target qubit   | Configurations of Clifford+T gates applied on the target qubit   | Configurations of Clifford+T gates applied on the target qubit   | Configurations of Clifford+T gates applied on the target qubit   | Configurations of Clifford+T gates applied on the target qubit   | Configurations of Clifford+T gates applied on the target qubit   |
|-------------------------|------------------------------------------------------------------|------------------------------------------------------------------|------------------------------------------------------------------|------------------------------------------------------------------|------------------------------------------------------------------|------------------------------------------------------------------|------------------------------------------------------------------|------------------------------------------------------------------|
| 3-bit Boolean gates     | SP 1                                                             | AX 1                                                             | θ 1                                                              | θ 2                                                              | θ 3                                                              | θ 4                                                              | AX 2                                                             | SP 2                                                             |
| AND ( a ∧ b )           | H                                                                | I                                                                | T †                                                              | T                                                                | T †                                                              | T                                                                | I                                                                | H                                                                |
| NAND ¬ ( a ∧ b )        | H                                                                | I                                                                | T †                                                              | T                                                                | T †                                                              | T                                                                | - Z                                                              | H                                                                |
| OR ( a ∨ b )            | H                                                                | I                                                                | T                                                                | T                                                                | T                                                                | T                                                                | Z                                                                | H                                                                |
| NOR ¬ ( a ∨ b )         | H                                                                | I                                                                | T                                                                | T                                                                | T                                                                | T                                                                | I                                                                | H                                                                |
| Implication (¬ a ∨ b )  | H                                                                | I                                                                | T †                                                              | T †                                                              | T                                                                | T                                                                | - Z                                                              | H                                                                |
| Inhibition ¬ (¬ a ∨ b ) | H                                                                | I                                                                | T †                                                              | T †                                                              | T                                                                | T                                                                | I                                                                | H                                                                |

From Table 6, all 3-bit Boolean gates of CALAn have identical quantum circuits with symmetrical structures as previously shown in Figure 6, except for θ (θ1, θ2, θ3, θ4) and AX2 gates. Hence, this gives an intuition to investigate various Boolean gates and operators, as they will be discussed in the next subsection.

Figure 9. Q-spheres [46] for the outcomes of 3-bit Boolean gates of CALAn (see Table 6): (a) AND, (b) NAND, (c) OR, (d) NOR, (e) implication, and (f) inhibition. The Dirac notations for all qubits are in the form of |target  control2  control1 ⟩ , where all target qubits are initially set to the |0  state. For the global phases, the blue indicates the 0 radians, the pink indicates the π/2 radians, ⟩ and the yellow indicates the 3π/2 radians.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01025v1-figure-3c35a8a8-3008-461c-a8df-52e45f16bff6.jpg)

## 2.4 The n -bit gates of CALAn

The 3-bit AND gate is mainly used to hierarchically construct various n -bit gates of CALAn , where n is restricted to the  range  (3,  4,  5)  of  qubits.  This  range  restriction  is  related  to  the  limited  layout  connectivity  for  the  physical neighboring qubits of IBM QPUs. In this paper, we choose the ibm\_brisbane QPU as an example of such a limited layout connectivity. Note that the n -bit gates of CALAn consist of n -1 control qubits and one target qubit. In contrast, the n -bit Fredkin gates always have n -2 control qubits and two target qubits. In this paper, the constructed n -bit gates of CALA-  are categorized as follows (see Table 2). n

- 1. n-bit Boolean gates : AND, NAND, OR, NOR, implication, and inhibition gates, where 3 ≤ n ≤ 5 qubits.
- 2. n-bit switching gates : Fredkin gates, where 3 ≤ n ≤ 4 qubits.
- 3. 3-bit square-rooting gates : controlled-√ X and controlled-√ X  gates, and these gates are built using the 2-bit † gates of controlled-√ X and controlled-√ X , as shown in Figure 4(a) and Figure 4(b), respectively. †
- 4. 3-bit distance gate : Miller gate.

Please observe that to overcome the limited layout connectivity of an IBM QPU, an m number of ancilla qubits is utilized when constructing the above-mentioned n -bit gates of CALAn , and the m number of ancilla qubits is not counted with the number of n qubits in CALAn , where m ≥ 0 qubits.

The powers of CALA-  as a generic quantum library are unlimited for constructing various configurable gates, n operators, and structures. Such that, all 3-bit Boolean gates of CALAn are  capable of constructing different n -bit gates in various configurations. For instance, a 5-bit OR-AND-OR gate (as a POS structure), a 5-bit AND-OR-AND gate (as a SOP structure), a 5-bit implication-NAND-inhibition gate (as a customized Boolean structure), and so on. Figure  10  illustrates  different n -bit  gates  and  structures  of  CALAn ,  where  3  ≤ n ≤  5.  These  different  gates  and structures are then cost-effectively mapped into the layout of ibm\_brisbane QPU without utilizing any SWAP gates, even when utilizing m ancilla qubits as discussed in the next subsection.

## 2.5 Native Gates and Layouts of IBM QPUs

At the time of writing this paper, for all IBM QPUs of 127 qubits (including ibm\_brisbane ),  the IBM quantum system replaces its native Feynman (CX) gate with the ECR (echoed cross-resonance) gate  [10-12] to: (i) minimize the drift in error rates of recalibrations and coherent errors, and (ii) extend the duration of measurements. Based on this, all three CX gates for the 3-bit Boolean gates of CALAn need to be replaced by three ECR gates.

It is noteworthy that: (i) if IBM quantum system decided to replace the CX or ECR gate with other double-qubit gates, e.g., the controlled-Z (CZ) gate, or (ii) if CALAn utilized on other quantum systems, e.g., Google and Rigetti, then the three CX gates for all 3-bit Boolean gates need to match the double-qubit native gates of that quantum systems. Table 7 shows how the IBM quantum system transpiles the single-qubit Clifford+T gates to its supported single-qubit native gates {I, X, √ X, RZ}, and Figure 11 illustrates a transpilation from the double-qubit Clifford gates to the IBMsupported double-qubit native gate {ECR} with the ibm\_brisbane QPU.

Figure 10. Schematics of n -bit gates and structures of CALAn , where 3 ≤ n ≤ 5 qubits: (a) 4-bit AND gate with m = 1, (b) 5-bit AND gate with m =  2, (c) 5-bit  OR-AND-OR gate (as a POS structure) with m =  2, (d) 5-bit  AND-OR-AND gate (as a SOP structure) with m = 2, (e) 3-bit Fredkin gate with m = 0, (f) 4-bit Fredkin gate with m = 1, (g) 3-bit controlled-√ X gate with m = 1, which is constructed from the 2-bit controlled-√ X gate shown in Figure 4(a), and (h) 3-bit Miller gate with m = 0. Note that (i) other 3-bit and 4-bit Boolean gates can be similarly constructed as in (a) and (b), (ii) different n -bit structures can be similarly constructed as in (c) and (d), (iii) 3-bit controlled-√ X  gate can be similarly constructed as in (g) by replacing † √ X with √ X , which † is constructed from the 2-bit controlled-√ X  gate shown in Figure 4(b), (iv) all ancilla (anc) qubits are initially set to the |0  state, † ⟩ and (v) m is the total number of utilized anc for a gate.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01025v1-figure-a1355dd2-4b9f-4a75-8a33-f1e1ca809ead.jpg)

Table 7. Transpilation of single-qubit Clifford+T gates to the single-qubit native gates {I, X, √ X, RZ} supported by IBM QPUs of 127 qubits.

➔

Figure 11. Transpilation of double-qubit Clifford gates to the native gates {I, X, √ X, RZ, ECR} supported by IBM QPUs of 127 qubits: (a) the transpiled CX Clifford gate, (b) the transpiled CY Clifford gate, (c) the transpiled CZ Clifford gate, and (d) the transpiled  SWAP  Clifford  gate.  After transpilation  with ibm\_brisbane QPU, the two qubits  ( q 0  and q 1)  of  a  double-qubit Clifford gate are routed to two neighboring physical qubits of indices 91 and 79, respectively. Note that different IBM QPUs of 127 qubits may generate different numbers and arrangements of √ X, X, and RZ gates.

| Single-qubit Clifford+T gates   | IBM single-qubit native gates   |
|---------------------------------|---------------------------------|
| I                               | I                               |
| X                               | X                               |
| Y                               | {RZ(π) X}                       |
| Z                               | RZ(π)                           |
| H                               | {RZ(π/2) √ X RZ(π/2)}           |
| √ X                             | √ X                             |
| √ X †                           | { √ X X}                        |
| S                               | RZ(π/2)                         |
| S †                             | RZ(- π/2)                       |
| T                               | RZ(π/4)                         |
| T †                             | RZ(- π/4)                       |

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01025v1-figure-c21f82e6-d27e-4e3c-b060-73e4ed9ed550.jpg)

The 127 physical qubits of all IBM QPUs are arranged onto heavy-hex layouts (as hexagonal dense-connected lattices), with a limited n physical qubits connectivity (2 ≤ n ≤ 4), as two-dimensionally illustrated in Figure 12 [8, 9]. To design cost-effective n -bit gates of CALAn (2 ≤ n ≤ 5), an I-shape of neighboring physical qubits arrangement is chosen to fulfill our research demands, as indicated by the red block in Figure 12. This I-shape represents the union of three linear arrangements, and each linear arrangement consists of three physical qubits. Hence, the I-shape can hold up to three 3-bit gates of CALAn , i.e., each linear arrangement holds one 3-bit gate.

As discussed in the previous subsection, because the 3-bit gates are the fundamental gates of CALAn , then three 3-bit  gates  (in  an  I-shape)  can  straightforwardly  construct  various n -bit  gates  of  CALAn . Therefore,  such  a straightforward construction fulfills our research demands by not requiring any SWAP gate among the physical qubits of an IBM QPU, through mapping the target qubit in the middle between the two control qubits. However, additional m ancilla qubits may be required for a 5-bit gate of CALAn , as shown in Figure 13(a)

On the  one  hand,  CALAn overcomes  the  limited  layout  connectivity  of  an  IBM  QPU  for  greater  than  four neighboring physical qubits. On the other hand, if the IBM quantum system provided quantum layouts in the formation of square lattices, as in Google QPUs [23, 47], then a 9-bit gate of CALAn can be straightforwardly constructed, as demonstrated in Figure 13(b). Subsequently, the previously constructed n -bit gates and structures of CALAn (shown in Figure 10) can cost-effectively be mapped to the I-shape layout of an IBM QPU, as illustrated in Figure 14.

Figure  12. The layout map  for  all  IBM  QPUs  of 127  qubits (including ibm\_brisbane )  [8,  9]:  the  green  blocks  are  linear arrangements of any two neighboring physical qubits, the blue blocks are linear (or curved) arrangements of any three neighboring physical qubits, the orange blocks are joint linear-curved arrangements of any four neighboring physical qubits, and the red block is the I-shape of three linear arrangements (each has three qubits). The I-shape indicates the desired physical qubits arrangement that fulfills our research demands in designing cost-effective n -bit gates of CALAn , where 3 ≤ n ≤ 5 qubits.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01025v1-figure-b0d9b1c6-a5f1-41f4-a271-430941c7d59e.jpg)

Figure 13. Schematics of implementing cost-effective n -bit gates of CALAn , without adding SWAP gates to their final transpiled quantum circuits: (a) a 5-bit gate (four inputs, one output, and m = 2) utilizes three 3-bit gates using the I-shape layout of an IBM QPU, and (b) a 9-bit gate (eight inputs, one output, and m = 6) utilizes seven 3-bit gates using the square-lattice layout of a Google QPU [23, 47], where m is the total number of ancilla (anc) qubits. Note that CALAn is a quantum library built from Clifford+T gates and mainly depends on the geometrical layout of a QPU.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01025v1-figure-5c1f00bb-366d-40e2-b1af-5dea4bd8688c.jpg)

Figure 14. Schematics of n -bit gates and structures of CALAn for cost-effectively mapping into the I-shape layout of an IBM QPU without utilizing any SWAP gate, where 3 ≤ n ≤ 5 qubits: (a) 4-bit AND gate with m = 1, (b) 5-bit AND gate with m = 2, (c) 5-bit OR-AND-OR gate (as a POS structure) with m = 2, (d) 5-bit AND-OR-AND gate (as a SOP structure) with m = 2, (e) 3-bit Fredkin gate with m = 0, (f) 4-bit Fredkin gate with m = 1, (g) 3-bit controlled-√ X gate with m = 1, which is constructed from the 2-bit controlled-√ X gate shown in Figure 4(a), and (h) 3-bit Miller gate with m = 0. Note that (i) all CX gates in green are performed before their inbounded 3-bit AND gates, (ii) all controlled-√ X and CX gates in red are performed after their inbounded 3-bit AND gates, (iii) all ancilla (anc) qubits are initially set to the |0  state, and (iv) ⟩ m is the total number of utilized anc.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01025v1-figure-05dc69b0-45f0-4693-a728-3eb142f8a156.jpg)

## 3 RESULTS

As a proof of concept for building cost-effective n -bit gates of CALAn for IBM QPUs, different n -bit gates are built and then transpiled with the ibm\_brisbane QPU, where 3 ≤ n ≤ 5 qubits. The quantum circuits of these n -bit gates are constructed using two approaches:

- 1. The standard approach : by using the standard quantum gates, e.g., n -bit Toffoli, Feynman (CX), Fredkin (controlled-SWAP), and controlled-√ X (controlled-V) gates. Most of these gates are non-Clifford+T gates as well as non-native gates in many IBM QPUs. For that, further decompositions are required for their final transpiled quantum circuits.
- 2. The Bloch sphere approach : by using the n -bit gates of CALAn , as discussed in the previous section and shown in Figure 10. All n -bit gates of CALAn are entirely constructed from Clifford+T gates, which are mostly native gates in many IBM QPUs. For that, no decomposition is required for their final transpiled quantum circuits.

After transpilation with ibm\_brisbane QPU, the final transpiled quantum circuits of these n -bit gates (for the two approaches) are evaluated based on the total number of generated native gates. In this paper, the total number of generated native gates is considered as the quantum cost. Such that, a transpiled quantum circuit with a higher quantum cost is considered as a cost-expensive gate, while a transpiled quantum circuit with a lower quantum cost is considered as a cost-effective gate. Thereby, we concluded that all n -bit gates constructed from the standard approach are always cost-expensive gates, while all n -bit gates constructed from the Bloch sphere approach are always cost-effective gates, which are the n -bit gates of CALAn .

The  IBM  Quantum  Platform  was  used  to  design and evaluate  the n -bit  gates  (for  the  two  approaches)  with ibm\_brisbane QPU, for 1024 resampling times, which are the so-called 'shots' [48]. However, the technical specifications of T1, T2, frequency, anharmonicity, median errors of native gates, speed of transpilation, number of pulses, and the usage load of this QPU are not considered for the purpose of our research and experiments.

For the standard approach, the transpilation automatically maps the qubits of an n -bit gate to the physical qubits of ibm\_brisbane QPU. If these mapped physical qubits are not directly connected to each other, then a number of SWAP gates are added. In contrast, for the Bloch sphere approach, we manually indicate which qubits of an n -bit gate should be mapped to a list of physical qubits in the I-shape layout of this QPU; hence, SWAP gates are not required. In such a way, we ensure to have transpiled cost-effective quantum circuits for all n -bit gates of CALAn . Note that all n -bit gates of CALAn utilize the I-shape layout for the physical qubits of the indices {61, 62, 63, 72, 80, 81, 82}, as indicated by the red box shown in Figure 12. Table 8 states the resultant quantum costs for the n -bit gates after the transpilation, for both approaches (the standard and the Bloch sphere).

Table 8. The resultant quantum cost (QC) of different n -bit gates after transpiling to the native gates (X, √ X, RZ, and ECR) of ibm\_brisbane QPU, using the standard approach and our proposed Bloch sphere approach, where 3 ≤ n ≤ 5 qubits.

|                                    | The standard approach (using standard quantum gates)   | The standard approach (using standard quantum gates)   | The standard approach (using standard quantum gates)   | The standard approach (using standard quantum gates)   | The standard approach (using standard quantum gates)   | The Bloch sphere approach (using Clifford+T gates)   | The Bloch sphere approach (using Clifford+T gates)   | The Bloch sphere approach (using Clifford+T gates)   | The Bloch sphere approach (using Clifford+T gates)   | The Bloch sphere approach (using Clifford+T gates)   |
|------------------------------------|--------------------------------------------------------|--------------------------------------------------------|--------------------------------------------------------|--------------------------------------------------------|--------------------------------------------------------|------------------------------------------------------|------------------------------------------------------|------------------------------------------------------|------------------------------------------------------|------------------------------------------------------|
| n -bit gates                       | X                                                      | √                                                      | RZ                                                     | ECR                                                    | QC                                                     | X                                                    | √                                                    | RZ                                                   | ECR                                                  | QC                                                   |
| 3-bit Toffoli (AND)                | 2                                                      | 18                                                     | 28                                                     | 7                                                      | 55                                                     | 0                                                    | 14                                                   | 20                                                   | 3                                                    | 37                                                   |
| 4-bit Toffoli (AND)                | 3                                                      | 39                                                     | 60                                                     | 16                                                     | 118                                                    | 3                                                    | 19                                                   | 29                                                   | 6                                                    | 57                                                   |
| 5-bit Toffoli (AND)                | 18                                                     | 149                                                    | 220                                                    | 65                                                     | 452                                                    | 4                                                    | 31                                                   | 46                                                   | 9                                                    | 90                                                   |
| 5-bit OR-AND-OR (POS)              | 6                                                      | 66                                                     | 98                                                     | 26                                                     | 196                                                    | 4                                                    | 31                                                   | 46                                                   | 9                                                    | 90                                                   |
| 5-bit AND-OR-AND (SOP)             | 13                                                     | 59                                                     | 97                                                     | 27                                                     | 196                                                    | 4                                                    | 31                                                   | 46                                                   | 9                                                    | 90                                                   |
| 3-bit Fredkin (controlled-SWAP)    | 3                                                      | 26                                                     | 38                                                     | 10                                                     | 77                                                     | 0                                                    | 12                                                   | 23                                                   | 5                                                    | 40                                                   |
| 4-bit Fredkin (controlled-SWAP)    | 7                                                      | 56                                                     | 80                                                     | 20                                                     | 163                                                    | 0                                                    | 28                                                   | 44                                                   | 8                                                    | 80                                                   |
| 3-bit controlled- √ (controlled-V) | 5                                                      | 30                                                     | 45                                                     | 11                                                     | 91                                                     | 0                                                    | 19                                                   | 31                                                   | 4                                                    | 54                                                   |
| 3-bit Miller (distance)            | 3                                                      | 36                                                     | 50                                                     | 13                                                     | 102                                                    | 2                                                    | 16                                                   | 25                                                   | 7                                                    | 50                                                   |

From Table 8, the following key points were observed between the standard approach and the Bloch sphere approach after transpiling all n -bit gates:

- 1. The number of ECR gates from the standard approach is (at minimum) twice the number of ECR gates from the  Bloch  sphere  approach,  due  to  the  reason  that  SWAP  gates  are  never  utilized  in  the  Bloch  sphere approach, i.e., in all n -bit gates of CALAn .
- 2. From the Bloch sphere approach, all 5-bit gates of CALAn have the same quantum costs, due to the reason that they share the same quantum layout mapping (see Figure 14) as well as the same symmetrical quantum circuit (see Figure 6) of permutative four Clifford+T (θ) gates and customized AX2 gates (see Table 6). For instance, the quantum cost of the 5-bit AND gate is equal to that of the 5-bit OR gate, since the OR's θ4 gate (as T) is merged with the AX2 gate (as Z) to form one RZ(5π/4) gate after the transpilation.
- 3. The quantum costs from the standard approach are always higher than that of the Bloch sphere approach. For instance, approximately, (i) the quantum cost of the 3-bit Miller gate from the standard approach is twice as high as that of the Bloch sphere approach, and (ii) the quantum cost of the 5-bit Toffoli gate from the standard approach is five times higher than that of the Bloch sphere approach!

Accordingly, our proposed Bloch sphere approach as the geometrical design tool successfully generates various cost-effective n -bit gates built from Clifford+T gates, collectively as CALAn quantum library. For the IBM quantum system,  CALAn can  provide  a  broad  range  of  various  cost-effective  quantum  gates  and  Boolean  operators  for practical applications in the fields of Boolean oracular algorithms, digital logic circuits, robotics, machine learning, just to name a few. Our future work will concentrate on cost-effectively re-building CALAn based on various native gates and layouts of other superconducting quantum systems, such as Google and Rigetti.

## 4 CONCLUSION

The standard 3-bit Toffoli gate  is  mainly  used  to construct  different  standard  gates,  such  as  Peres,  inverse  Peres, Fredkin,  and n -bit  Toffoli  gates,  where n &gt;  3  qubits.  These  standard  gates  are  entirely  constructed  from  the mathematical calculations  of  unitary  matrices.  However,  these  standard  gates  are  non-native  gates  in  many  IBM quantum computers. Native gates are operationally supported by a quantum computer.  For that, a standard gate is decomposed into a set of native gates, as well as its qubits are routed to be mapped into the physical qubits in the architecture (layout) of a quantum computer. However, the routing process inserts a number of SWAP gates to connect the  non-neighboring  physical  qubits  together.  In  IBM  terminologies,  the  decomposition,  routing,  and  mapping processes are termed 'transpilation'. After transpilation, we noticed that different standard gates have higher quantum costs, i.e., they are cost-expensive gates. The quantum cost, in this paper, denotes the total number of generated native gates for the transpiled quantum circuit of a standard gate. In our research, we mainly focus on constructing various sets of cost-effective gates, which have similar quantum operations to their equivalent cost-expensive standard gates. The cost-effectiveness of our gates comes from the utilization of Clifford+T gates (before transpilation) as well as the non-utilization of SWAP gates (after transpilation), since a set of Clifford+T gates is mainly utilized by many IBM quantum computers as native gates, e.g., T, T , and Feynman (CX) gates. †

In  this  paper,  we  introduce  a  new  methodology  for  constructing  cost-effective  gates  using  the  Bloch  sphere approach as the geometrical design tool, instead of using the mathematical calculations of unitary matrices. Based on this Bloch sphere approach and the Clifford+T gates, these cost-effective gates have one generalized architecture, which mainly depends on the limited layout connectivity of IBM quantum computers, for up to five physical qubits. Various cost-effective n -bit gates are constructed to perform Boolean operations, switching functionalities, and square rooting. We termed these cost-effective n -bit gates as the 'Clifford+T-based Architecture of Layout-Aware n -bit gates (CALA- )',  where  2  ≤ n n ≤  5  qubits.  In  our  work,  the ibm\_brisbane quantum  computer  of  limited  layout connectivity is chosen as a proof of concept for CALAn . Different standard n -bit gates and their equivalent gates of CALA-  were examined and evaluated with this quantum computer, and it was concluded that all gates of CALAn n always have lower quantum costs than those of standard n -bit gates after transpilation. In conclusion, CALAn as a quantum library of cost-effective n -bit gates can be employed to build Boolean oracles, implement quantum oracular algorithms, and enhance efficient transpilation based on the layouts of IBM quantum computers. Moreover, CALAn can provide a broad range of practical applications in the fields of digital logic synthesizers, computer vision, machine learning, just to name a few, in the quantum domain.

## REFERENCES

| [1]     | M.A. Nielsen and I.L. Chuang, Quantum Computation and Quantum Information . 10th ed. Cambridge, UK: Cambridge University Press, 2010, ISBN 978-1107002173.                                                                                                                                                                       |
|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [2]     | R. LaPierre, Introduction to Quantum Computing . 1st ed. Cham, Switzerland: Springer, 2021, ISBN 978-3030693176.                                                                                                                                                                                                                 |
| [3]     | A. Al-Bayaty and M. erkowski, 'GALA-n: Generic architecture of layout-aware n-bit quantum operators for cost-effective realization on BMquantum computers,' 2023, arXiv:2311.06760 .                                                                                                                                             |
| [4]     | A. Barenco, C.H. Bennett, R. Cleve, D.P DiVincenzo, N. Margolus, P. Shor, T. Sleator, J.A. Smolin, and H. Weinfurter, 'Elementary gates for quantum computation,' Physical Review A , vol. 52, no. 5, p. 3457, 1995.                                                                                                             |
| [5]     | S. Bravyi and A. Kitaev, 'Universal quantum computation with ideal Clifford gates and noisy ancillas,' Physical Review A- Atomic, Molecular, and Optical Physics , vol. 71, no. 2, p. 022316, 2005.                                                                                                                              |
| [6]     | V. Kliuchnikov, D. Maslov, and M. Mosca, 'Fast and efficient exact synthesis of single qubit unitaries generated by Clifford and T gates,' 2012, arXiv:1206.5236 .                                                                                                                                                               |
| [7]     | S. Bravyi and D. Gosset, 'Improved classical simulation of quantum circuits dominated by Clifford gates,' Physical Review                                                                                                                                                                                                        |
|         | Letters , vol. 116, no. 25, p. 250501, 2016.                                                                                                                                                                                                                                                                                     |
| [8] [9] | R.C. Farrell, M. Illa, A.N. Ciavarella, and M.J. Savage, 'Scalable circuits for preparing ground states on digital quantum computers: The Schwinger model vacuum on 100 qubits,' PRX Quantum , vol. 5, no. 2, p. 020315, 2024. IBM Quantum Platform. 'Compute resources.' IBM.com. Accessed: Jul. 26, 2024. [Online]. Available: |
| [10]    | P. Jurcevic, A. Javadi-Abhari, L.S. Bishop, I. Lauer, D.F. Bogorin, M. Brink, L. Capelluto, O. Günlük, T. Itoko, N. Kanazawa, and A. Kandala, 'Demonstration of quantum volume 64 on a superconducting quantum computing system,'                                                                                                |
| [11]    | E. Pelofske, A. Bärtschi, and S. Eidenbenz, 'Quantum volume in practice: What users can expect from NISQ devices,' IEEE Trans. on Quantum Engineering , vol. 3, pp. 1-19, 2022.                                                                                                                                                  |
| [12]    | Y. Ji, K.F. Koenig, and I. Polian, 'Optimizing quantum algorithms on bipotent architectures,' Physical Review A , vol. 108, no. 2, p. 022610, 2023.                                                                                                                                                                              |
| [13]    | E. Wilson, S. Singh, and F. Mueller, 'Just-in-time quantum circuit transpilation reduces noise,' in 2020 IEEE Int. Conf. on Quantum Computing and Engineering ( QCE ), Oct. 2020, pp. 345-355.                                                                                                                                   |
| [14]    | A. Mi, S. Deng, and J. Szefer, 'Securing Reset Operations in NISQQuantum Computers,' in Proc. of the 2022 ACMSIGSAC Conf. on Computer and Communications Security , Nov. 2022, pp. 2279-2293.                                                                                                                                    |
| [15]    | P. Murali, J.M. Baker, A. Javadi-Abhari, F.T. Chong, and M. Martonosi, 'Noise-adaptive compiler mappings for noisy intermediate-scale quantum computers,' in Proc. of the 24th Int. Conf. on Architectural Support for Programming Languages and Operating Systems , Apr. 2019, pp. 1015-1029.                                   |
| [16]    | D. Koch, B. Martin, S. Patel, L. Wessing, and P.M. Alsing, 'Demonstrating NISQ era challenges in algorithm design on IBM's 20 qubit quantum computer,' AIP Advances , vol. 10, no. 9, 2020.                                                                                                                                      |
| [17]    | M. Perkowski, M. Chrzanowska-Jeske, A. Sarabi, and I. Schäfer, 'Multi-level logic synthesis based on Kronecker decision diagrams and Boolean ternary decision diagrams for incompletely specified functions,' VLSI Design , vol. 3, no. 3-4, pp. 301- 313, 1995.                                                                 |
| [18]    | P.J. Hurley, A Concise Introduction to Logic , 12th ed. Cengage Learning, 2015.                                                                                                                                                                                                                                                  |
| [19]    | B. Schmitt and G. DeMicheli, 'tweedledum: Acompiler companion for quantum computing,' in Design, Automation &Test in Europe Conf. &Exhibition ( DATE ), Mar. 2022, pp. 7-12. IEEE.                                                                                                                                               |
| [20]    | V.V. Shende and I.L. Markov, 'On the CNOT-cost of Toffoli gates,' 2008, arXiv:0803.2316 . T.C. Ralph, K.J. Resch, and A. Gilchrist, 'Efficient Toffoli gates using qudits,' Physical Review A ,                                                                                                                                  |
| [21]    | vol. 75, no. 2, p. 022313, 2007.                                                                                                                                                                                                                                                                                                 |
| [22]    | M. Lukac, S. Nursultan, G Krylov, and O. Keszöcze, 'Geometric refactoring of quantum and reversible circuits: Quantum layout,' in 2020 23rd Euromicro Conf. on Digital System Design ( DSD ), Aug. 2020, pp. 428-435. IEEE.                                                                                                      |
| [23]    | B. Tan and J. Cong, 'Optimal layout synthesis for quantum computing,' in Proc. of the 39th Int. Conf. on Computer-Aided Design , Nov. 2020, pp. 1-9.                                                                                                                                                                             |
| [24]    | G.W. Dueck, A. Pathak, N.M. Rahman, A. Shukla, and A. Banerjee, 'Optimization of circuits for IBM's five-qubit quantum computers,' in 2018 21st Euromicro Conf. on Digital System Design ( DSD ), 2018, pp. 680-684. IEEE.                                                                                                       |
| [25]    | W.L. Chang and A.V. Vasilakos, Fundamentals of Quantum Programming in IBM's Quantum Computers . Heidelberg, Germany: Springer, 2021, ISBN 978-3030635824.                                                                                                                                                                        |
| [26]    | C. Piveteau, D. Sutter, S. Bravyi, J.M. Gambetta, and K. Temme, 'Error mitigation for universal gates on encoded qubits,' Physical Review Letters , vol. 127, no. 20, p. 200505, 2021.                                                                                                                                           |

| [27]   | F. Orts, E. Filatovas, G. Ortega, J.F. SanJuan-Estrada, and E.M. Garzón, 'Improving the number of T gates and their spread in integer multipliers on quantum computing,' Physical Review A , vol. 107, no. 4, p. 042621, 2023.                                                                  |
|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [28]   | J. Preskill, 'Quantum computing in the NISQ era and beyond,' Quantum , vol. 2, p. 79, 2018.                                                                                                                                                                                                     |
| [29]   | S. Lee, S.J. Lee, T. Kim, J.S. Lee, J. Biamonte, and M. Perkowski, 'The cost of quantum gate primitives,' Journal of Multiple-Valued Logic &Soft Computing , vol. 12, 2006.                                                                                                                     |
| [30]   | G. Yang, W.N. Hung, X. Song, and M. Perkowski, 'Majority-based reversible logic gates,' Theoretical Computer Science vol. 334, no. 1-3, pp. 259-274, 2005.                                                                                                                                      |
| [31]   | W.N. Hung, X. Song, G. Yang, J. Yang, and M. Perkowski, 'Optimal synthesis of multiple output Boolean functions using a set of quantum gates by symbolic reachability analysis,' IEEE Trans. on Computer-Aided Design of Integrated Circuits and Systems , vol. 25, no. 9, pp. 1652-1663, 2006. |
| [32]   | M. Szyprowski and P. Kerntopf, 'Low quantum cost realization of generalized Peres and Toffoli gates with multiple-control signals,' in 2013 13th IEEE Int. Conf. on Nanotechnology ( IEEE-NANO 2013 ), Aug. 2013, pp. 802-807.                                                                  |
| [33]   | M. Lukac, M. Perkowski, and M. Kameyama, 'Evolutionary quantum logic synthesis of Boolean reversible logic circuits embedded in ternary quantum space using structural restrictions,' in IEEE Congress on Evolutionary Computation , Jul. 2010, pp. 1-8.                                        |
| [34]   | D. Maslov and D.M. Miller, 'Comparison of the cost metrics through investigation of the relation between optimal NCVand optimal NCT three-qubit reversible circuits,' IET Computers &Digital Techniques , vol. 1, no. 2, pp. 98-104, 2007.                                                      |
| [35]   | T. Satoh, S. Oomura, M. Sugawara, and N. Yamamoto, 'Pulse-engineered controlled-V gate and its applications on superconducting quantum device,' IEEE Trans. on Quantum Engineering , vol. 3, pp. 1-10, 2022.                                                                                    |
| [36]   | IBM Quantum Documentation. 'iSwapGate.' IBM.com. Accessed: Jul. 26, 2024. [Online]. Available: https://docs.quantum.ibm.com/api/qiskit/qiskit.circuit.library.iSwapGate                                                                                                                         |
| [37]   | A. A-Bayaty and M. Perkowski, 'A concept of controlling Grover diffusion operator: A new approach to solve arbitrary Boolean-based problems,' 2023. [Online]. Available: https://doi.org/10.21203/rs.3.rs-2997276/v1                                                                            |
| [38]   | C. Figgatt, D. Maslov, K.A. Landsman, N.M. Linke, S. Debnath, and C. Monroe, 'Complete 3-qubit Grover search on a programmable quantum computer,' Nature Communications , vol. 8, no. 1, p. 1918, 2017.                                                                                         |
| [39]   | L.X. Zhang and W. Huang, 'A note on the invariance principle of the product of sums of random variables,' Electronic Communications in Probability , vol. 12, pp. 59-64, 2007.                                                                                                                  |
| [40]   | R. Zimmermann and D.Q. Tran, 'Optimized synthesis of sum-of-products,' in IEEE 37th Asilomar Conf. on Signals, Systems & Computers , 2003, vol. 1, pp. 867-872.                                                                                                                                 |
| [41]   | T. Sasao, 'EXMIN2: A simplification algorithm for exclusive-or-sum-of-products expressions for multiple-valued-input two-valued-output functions,' IEEE Trans. on Computer-Aided Design of Integrated Circuits and Systems , vol. 12, no. 5, pp. 621-632, 1993.                                 |
| [42]   | N. Song and M. Perkowski, 'Minimization of exclusive sum-of-products expressions for multiple-valued input, incompletely specified functions,' IEEE Trans. on Computer-Aided Design of Integrated Circuits and Systems , vol. 15, no. 4, pp. 385- 395, 1996.                                    |
| [43]   | B. Schaeffer, L. Tran, A. Gronquist, M. Perkowski, and P. Kerntopf, 'Synthesis of reversible circuits based on products of exclusive or sums,' in 2013 IEEE 43rd Int. Symp. on Multiple-Valued Logic ( ISMVL ), 2013, pp. 35-40.                                                                |
| [44]   | M. Perkowski, 'Inverse problems, constraint satisfaction, reversible logic, invertible logic and Grover quantum oracles for practical problems,' Science of Computer Programming , vol. 218, p. 02775, 2022.                                                                                    |
| [45]   | M. Helliwell and M. Perkowski, 'A fast algorithm to minimize multi-output mixed-polarity generalized Reed-Muller forms,' in Proc. of 25th ACM/IEEE Design Automation Conf. , Jun. 1988, pp. 427-432.                                                                                            |
| [46]   | IBM Quantum Documentation. 'Q-sphere.' IBM.com. Accessed: Jul. 26, 2024. [Online]. Available: https://qiskit.org/documentation/stubs/qiskit.visualization.plot_state_qsphere.html                                                                                                               |
| [47]   | M. Pedram and A. Shafaei, 'Layout optimization for quantum circuits with linear nearest neighbor architectures,' IEEE Circuits and Systems Magazine , vol. 16, no. 2, pp. 62-74, 2016.                                                                                                          |
| [48]   | P. Rao, K. Yu, H. Lim, D. Jin, and D. Choi, 'Quantum amplitude estimation algorithms on IBM quantum devices,' in Quantum Communications and Quantum Imaging XVIII , Aug. 2020, vol. 11507, pp. 49-60. SPIE.                                                                                     |
Ali Al-Bayaty Xiaoyu Song Marek Perkowski
CALA-$n$: A Quantum Library for Realizing Cost-Effective 2-, 3-, 4-, and 5-bit Gates on IBM Quantum Computers using Bloch Sphere Approach, Clifford+T Gates, and Layouts
We introduce a new quantum layout-aware approach to realize cost-effective
$n$-bit gates using the Bloch sphere, for $2 \le n \le 5$ qubits. These $n$-bit
gates are entirely constructed from the Clifford+T gates, in the approach of
selecting sequences of rotations visualized on the Bloch sphere. This Bloch
sphere approach ensures to match the quantum layout for synthesizing
(transpiling) these $n$-bit gates into an IBM quantum computer. Various
standard $n$-bit gates (Toffoli, Fredkin, etc.) and their operational
equivalent of our proposed $n$-bit gates are examined and evaluated, in the
context of the final quantum costs, as the final counts of generated IBM native
gates. In this paper, we demonstrate that all our $n$-bit gates always have
lower quantum costs than those of standard $n$-bit gates after transpilation.
Hence, our Bloch sphere approach can be used to build a quantum library of
various cost-effective $n$-bit gates for different layouts of IBM quantum
computers.