Despite its clear advantage, Grover’s algorithm requires the application of multi-controlled quantum gates [
19], which is an obstacle to implementing its 4-qubit and up versions in some quantum processors architectures presents in the popular IBM Quantum Experience [
28] platform, for example. Consequently, there is a barrier to the scalability that would be required to make some algorithms useful and marketable on a large scale [
8,
29]. On the other hand, the number of qubits that are accessible in the system can be increased to substantially benefit the Grover algorithm. This would result in an exponential rise in the amount of storage space available in the database, which is the location where the searches are carried out. In this context, we carried out an emulation of a genuine quantum processor by making use of myQLM as a means of simulating the interconnectivity amongst the necessary qubits in an effort to overcome this challenge of compatibility.
In addition, the existence of noise that affects the qubits during the implementation of quantum operations or even during idle time is the primary obstacle that prevents present quantum computers from reaching their full potential. In this scenario, Grover’s algorithm is one of the main hostages of noise since the quantum advantage of this algorithm can be better leveraged in quantum computers with a large number of qubits, which implies a large amount of noise and requires error correction protocols.
It is essential to note that all measurements conducted on a system are impacted by noise to varying degrees. This is anticipated by quantum physics, which postulates that quantum states collapse instantaneously at the point of measurement. This disturbance is inherent to the theory and cannot be prevented by any measuring technique [
30]. Therefore, in order to simulate the quantum noise interference of the quantum processor on Grover’s algorithm, we use the quantum computing simulator CIMATEC KUATOMU, an ATOS QLM simulator, located at SENAI CIMATEC’s HPC center in Brazil, to build a simulated quantum hardware topology, since the AQASM noisy section is restricted to QLM users.
3.1. Quantum Hardware Model Simulation
To simulate our quantum hardware model, we need to adjust our code to meet the technical requirement that our hardware supports a maximum arity port of 3, which means that a quantum gate can be applied to a maximum of three qubits simultaneously. For this purpose, we decomposed the CCCZ gate into a set formed by Hadamard and CCNOT gates, as illustrated below. Consequently, it is necessary to introduce an auxiliary qubit for the circuit implementation to decompose this gate.
Therefore, to implement this new circuit, we created a specific 5-qubit topology in order to support the 4-qubit Grover algorithm and the auxiliary qubit of the decomposed
gate. All qubits are linked for the sake of simplicity; as a result, all of them can be concurrently controlled or targeted by controlled quantum operations.
Figure 4 shows a sketch of the 5-qubit topology in which the 4-qubit Grover algorithm is implemented.
Similar to how we completed the noise-free simulation in Section II, we needed to import the logic gates we would use, as seen in Box 9.
In this scenario, the allocation of classical bits and quantum bits takes place in the exact same manner as it did in the previous simulation. The fact that we employ one of these qubits as an ancilla necessitates that we now assign 4 classical bits and 5 quantum bits in our system. (see Box 10).
In order to build the topology connections for the quantum hardware (as shown in
Figure 4), we must import the libraries
Topology and
HardwareSpecs. Box 11 contains the coding for the list items that represent the connections between the qubits in the idealized topology. The first member of each ordered pair is the control qubit, and the second element is the target one.
In Box 12, the initialization of the qubits occurs during the first step of Grover’s algorithm by putting them in a balanced superposition. Since qubit 2 is a supplementary qubit in this instance, it is unnecessary to start it in a superposition state.
The second and third phases of the quantum search algorithm, implemented on the simulated quantum hardware are shown in Box 13. Initially, we apply the oracle that explicitly looks for the state
by applying the
gate decomposed as illustrated in
Figure 5 (c). Next, we use amplitude amplification to enhance the probability that the marked object will be discovered while decreasing the probability that other items. These two procedures are repeated
times, in order to maximize the probability of finding the sought state, in the same way as performed in the noise-free simulation in section II.
After this, we will finish the last step of Grover’s algorithm, which consists of taking measurements in accordance with Box 14. It is worth noting that, the execution of the measurement on the auxiliary qubit is completely unnecessary.
3.2. Quantum Noise
In the following, we introduce the quantum noise model in the simulated quantum hardware. Generally, to quantify quantum noise in quantum hardware setups, the measurement of two constants is performed: qubit relaxation time
(i.e.,
longitudinal relaxation or
amplitude damping) and qubit dephasing time
(i.e.,
transverse relaxation) [
31,
32,
33]. There is also a third parameter called Pure dephasing time which is often the dominant contribution to
[
34,
35]. This parameter determines how long a system will be able to keep its coherence, whereas amplitude damping offers a model for the physical process of energy decay associated with the application of quantum noise [
36] and it is represented by the following equation:
In this regard, we introduce the Pure Dephasing channel in order to perform the noisy simulations on the quantum processor emulated with the topology described in
Figure 4.
In order to perform the noisy simulation, there are some properties that must be specified: the running time of the quantum gates used to build the quantum hardware topology and the operating time for the quantum gates used in building quantum hardware topology. The gate application and relaxation times are properties of each quantum computer, which can be altered once the calibrations are performed. Therefore, we selected these settings not with the objective of recreating the results of a particular system but rather with the only purpose of demonstrating the impact of these noises on the outcomes of the simulation. Consequently, it will be possible to make a comparison between the results of the noisy simulation and the results of the ideal noise-free simulation performed in the previous section.
Box 15 imports the library DefaultGatesSpecification and specifies the application timings of the gates used in Grover’s algorithm. Therefore, regarding the time needed to complete the procedures, we considered the following gate times in the code: X gate → 35.5 ns; Hadamard gate → 35.5 ns; CCNOT gate → 350 ns, Measurements → 35.5 ns.
Furthermore, in order to apply the Pure Dephasing channel in Box 16, we need to import the library known as
ParametricPureDephasing. In addition to the noise model, one can define the qubit relaxation times
and
, respectively as shown in the second code line of Box 16. Finally, in the last code line we use the equation
5 to define
.
Subsequently, after importing the HardwareModel and NoisyQProc libraries, we specify the model of the quantum processor that we will use, including the gate specifications and the noise model that will be applied (see Box 17). Note that these parameters were defined by us in Boxes 15 and 16.
The last step of our code is to simulate Grover’s algorithm in the emulated quantum hardware under the Pure Dephasing noise model, as presented in Box 18. First, we need to create a and link it to the quantum circuit created in Box 14 from Grover’s program developed in the previous steps, as in the first code line of the following box. The parameter indicates the amount of repetitions used in the circuit, as will be explained later. Finally, these instructions were applied only to qubits 0, 1, 3 and 4 because, as explained before, qubit 2 is an auxiliary one.
The simulations were conducted out using the stochastic technique, which requires that the density matrix be interpreted using a probability distribution based on pure states [
24]. Using this method, the error scales with
. Thus, we perform the simulation with
shots to get proper results.
Figure 6 shows the probability distributions of Grover’s algorithm performed in quantum hardware simulated under the Pure Dephasing noise model. Based on the results obtained from this analysis, we can gradually observe the effects of noise in the application of the algorithm by decreasing the dephasing time (
). It is worth noting that, although the most probable state is still the searched item
, the other states arose with significant probabilities even after the
repetitions of the Oracle and Amplitude Amplification subroutines, different from the noise-free simulation presented in
Figure 3. As expected, the situation becomes worse when we gradually decrease the dephasing time. The effect of the noise is to reduce the algorithm’s accuracy, approximating the probability of the sought state to the other items of the unstructured list.
In order to obtain a landscape of the effect of the Pure Dephasing channel on the sought state, we plot the probability of the sought state as a function of the Pure Dephasing times (
) in
Figure 7. As can be seen, as
increases, the probability of the sought state approximates to a probability limit 95.86%, obtained for the noise-free simulation presented in
Figure 3, highlighted in the dashed blue line. On the other hand, the performance of the search algorithm is negatively impacted by decreasing the dephasing time, rapidly decreasing the probability sought state. Therefore, we are convinced that these findings demonstrate that the existence of quantum noise in quantum processors reduces the efficiency of the algorithm, which can lead to inaccurate outcomes when simulating quantum circuits.