Quantum-Accelerated Flight Selection: Probing Grover's Algorithm and Quantum Device Efficiency
Quantum-Accelerated Flight Selection: Probing Grover's Algorithm and Quantum Device Efficiency
Abstract:- Current flight search platforms primarily considerably increased the speed of matrix inversion in many
consider four essential factors when planning a trip: machine learning techniques. Another notable example is
departure/arrival dates, as well as the origin and Shor's factoring algorithm, which has demonstrated the ability
destination locations. However, when additional to factor large numbers exponentially faster than the best
parameters are added to this search, the problem shifts conventional methods [5]. This development is crucial for
from a simple to a complex search, as the engine must sift security because Rivest-Shamir-Adleman (RSA) encryption is
through a massive dataset of flights, including widely used and relies on the difficulty of factoring large
information on airlines, flight routes, fees, and more. To numbers [6].
address this challenge and improve flight search
efficiency amidst data-intensive and resource-demanding The process of selecting an optimal flight from a vast
environments, this paper proposes the use of Grover's data-set is often a time-consuming and daunting task,
search algorithm. This algorithm is demonstrated as the compounded by a myriad of considerations such as departure
optimal solution for searches with increased constraints. and arrival dates, ticket prices, preferred airlines, and the
The paper highlights the practical application of Grover's convenience of halts during the journey. In an era marked by
search algorithm across three datasets of assorted sizes, rapid technological advancements, quantum computing has
as well as various quantum hardware and simulators emerged as a transformative force offering the potential for
available in the NISQ era. Furthermore, this paper exponential acceleration in solving complex problems.
provides an in-depth understanding of the complexity of Specifically, Grover's search algorithm, conceived by Lov
quantum circuit design, including the key phases of state Grover in 1996 [7], promises to revolutionize the process of
encoding and amplitude amplification. The effectiveness sifting through extensive data-sets. This algorithm is uniquely
of these approaches is evaluated through analysis of equipped to search an unsorted database in quadratically
execution times and quantum measurement results. The fewer iterations than the most efficient classical algorithms.
aim is to showcase the potential of quantum computing in
revolutionizing real-world search tasks, particularly in This study focuses on obtaining flights that match
the realm of flight selection. specific criteria from a large dataset, improving the customer
experience, saving processing time, server resources, and cost;
Keywords:- Quantum Computing, Quantum Search, and enabling travelers to quickly identify flights that precisely
Quantum Algorithm, Grovers Algorithm, Quantum align with their personalized criteria.
Application.
It's important to recognize that Grover's search is not just
I. INTRODUCTION a hypothetical concept, but a tangible technology that has the
potential to revolutionize the approach to complex search
As compared to traditional techniques, quantum problems.
computing has been shown to considerably speed up
computations, making it a rapidly developing subject [1]. In the field of quantum computing, the knowledge
This acceleration is especially important since more time- landscape is rapidly evolving, driven by the groundbreaking
effective data processing methods are required as data work of researchers worldwide. Quantum computing has the
volume continues to grow quickly, frequently exceeding the potential to disrupt various industries by resolving challenges
Petabyte scale [2]. As a result, there is a rising desire among that were previously considered intractable. Grover's
computer scientist to apply quantum algorithms on a larger algorithm is particularly noteworthy for its ability to
scale [3]. accelerate search tasks, an essential function in an
increasingly data-driven world.
The matrix inversion method Harrow-Hassidim-Lloyd
(HHL) is a notable example of a quantum algorithm in the
field of machine learning [4]. By using logN quantum bits, or
qubits, to represent N-bit classical data, the HHL technique
can exponentially speed up matrix inversion when compared
to classical solutions [4]. The use of this innovation has
In the upcoming sections, the intricacies of Grover's For a comprehensive understanding of quantum
algorithm, the methodology of encoding flight data, the computing, consider referring to the book titled "Quantum
principles of amplitude amplification, and the nuances of computation and quantum information" [9].
quantum circuit design will be explored. Through tangible
examples and results, the ability of this quantum approach to Grover's Algorithm
expedite and streamline the process of selecting flights that Grover's algorithm, proposed by Lov Grover in 1996, is
cater to the traveler's unique preferences will be showcased. a quantum algorithm designed to excel at unstructured search
Ultimately, this research not only underscores the potential of problems [7]. Locating a specific item in a database without
quantum computing but also highlights its transformative any built-in structure or organization is known as unstructured
impact on decision-making in an increasingly complex world. search. Grover's algorithm stands out by its ability to search a
database of N items in only O(√𝑁) iterations, which provides
II. BACKGROUND a quadratic speedup compared to classical algorithms, which
typically require O(N) iterations [10].
This section aims to provide readers with a concise
background to familiarize themselves with key concepts. The The problem is to find the index of the target flight in a
discussion begins with a succinct introduction to quantum list with N = 2n elements (flights), where N is the list size and
computing, followed by a focused examination of Grover's n are the number of qubits.
algorithm. Finally, the pivotal role of quantum simulators,
specifically employed in this paper, in the practical execution The key components of Grover's algorithm include:
of the quantum algorithm is introduced.
Oracle:
Quantum Computing In Grover's algorithm, the target item to be found is
Quantum computing offers a revolutionary change in the represented by a "marked" state. The oracle's role is to mark
field of computation by utilizing quantum physics unusual or identify this state within the superposition of states created
behavior. It's quite distinct from traditional computing, owing by the quantum algorithm. It does so through a series of
to the fundamental unit of information known as a quantum quantum gates that conditionally modify the quantum state to
bit or qubit [8]. In comparison to classical bits, which can single out the marked item.
only be in a 0 or 1 state, qubits can exist in a superposition of
states. This implies that a qubit can at the same time represent Amplitude Amplification:
0 and 1, allowing it to carry out many computations in After marking the target state, Grover's algorithm applies
parallel. The real capability of Quantum computing appears in amplitude amplification, a process that boosts the probability
quantum entanglement phenomena, where qubits show of measuring the marked state while reducing the probability
correlation with each other unlike classical bits. of measuring other states. This amplification phase makes
Grover's algorithm remarkably efficient.
Key principles of quantum computing include:
Measurement:
Superposition: The final step involves measuring the quantum state to
Qubits can exist in a linear combination of states, which determine the marked item's location. The algorithm is
enables computation in parallel. A 3-qubit quantum register, executed repeatedly to increase the likelihood of getting the
for example, can correspond to and manage all eight possible right answer.
3-bit binary strings at the same time.
The Grover algorithm's schematic circuit is displayed in
Entanglement: 𝜋
Fig. 1. Approximately 4 √𝑁 Oracle and Amplitude
Quantum entanglement appears when two or more
qubits become paired in such a way that the state of one can Amplification iterations later, the target element is expected
not be defined independently of the state of the others. This to be found with a high probability [11].
feature allows qubits to work together coherently, opening up
new computational possibilities.
It's important to note that the datasets provided for this Following the conditional flipping, a quantum operation
research are synthetic. They have been generated to known as a controlled-MCT (Multicontrol Toffoli) gate is
demonstrate the functionality and efficiency of Grover's deployed. This gate amplifies the probability of measuring the
search algorithm in a controlled environment. While the data desired state, specifically the state that corresponds to the
accurately represents the structure of flight information, it target flight [9]. This controlled amplification is indispensable
does not correspond to real-world flight data. in the subsequent stages of the quantum search algorithm.
The pivotal index of the target flight in the dataset is Fig. 2 showcases the oracle circuit for a specific example
then calculated and translated into binary representation. In state within a 4-qubit system, namely {"0101"}. This example
this representation, each binary digit corresponds to whether state has been chosen to demonstrate the working principle of
the related condition aligns with the criteria for the target the oracle as defined above.
flight. For instance, an index of 7 corresponds to the binary
'111,' signifying the fulfillment of all criteria. Remember here, indexing is from left to right, which
means q0, q1, q2, and q3 correspond to the qubits from the
The quantum state comprises qubits, which undergo most significant bit (left) to the least significant bit (right).
manipulation according to this binary representation. Each
digit in the binary string determines whether an X gate, a
quantum gate that flips qubits, is applied to the corresponding
qubit. This strategic flipping of qubits aligns them with the
specified criteria. A flipped qubit corresponds to an
unfulfilled condition, while an unflipped qubit signifies the
fulfillment of that condition. (seen in fig. 2)
V. RESULT AND DISCUSSION on Jan 1 and Aug 28 yielding results within 5.54 and 6.74
seconds, respectively. Despite a larger dataset size, the
A comprehensive analysis of the results obtained from algorithm efficiently retrieved matching flights.
implementing Grover's search algorithm on flight data of
varying sizes: small (15Q), medium (17Q), and large (19Q) is In the large (19Q) dataset, Grover's algorithm navigated
presented in this section (Table 2). The section discusses the efficiently, requiring 25.78 seconds to locate a flight departing
execution times, correlated flight details, and effectiveness of and arriving on Jan 5, operated by Air India. Similarly, finding
the algorithm, along with the performance of the algorithm on a flight departing and arriving on Aug 29, operated by Delta
different quantum simulators. Details regarding the computer Airlines, took 41.73 seconds. These results highlight the
resources used in this procedure are provided in APPENDIX algorithm's resilience and precision across a range of dataset
sizes.
Using Grover's algorithm, the small (15Q) dataset was
searched for specific flights, yielding accurate results. For Table 2 provides a detailed summary of the performance
example, a flight departing on Jan 10, priced at 394, operated of the quantum algorithm across different qubit datasets, further
by Qatar Airways, and with a halt status of 1, was in just 2.03 supporting the results discussed above. Each dataset's
seconds. Similarly, a flight on Aug 6, priced at 250, operated characteristics, search details, and corresponding execution
by Delta Airlines, and with a halt status of 1, took 1.54 seconds times are presented, offering valuable insights into the
to find. The effectiveness of Grover's algorithm continued in algorithm's efficiency and effectiveness.
the medium (17Q) dataset, with searches for flights departing
The histogram plot visually Represents the algorithm’s A study on performance was carried out by executing the
performance within the Qiskit framework across various search circuit on different simulators, as illustrated in Fig. 5. Each line
scenarios, showcasing execution times for each query and on the graph represents a specific simulator, and markers
highlighting Grover’s algorithm efficiency in handling different highlight specific qubit counts, offering valuable insights.
flight selection criteria within the 15Q, 17Q, and 19Q datasets Notably, it was observed that the processing time for
(16Q and 18Q datasets also included) PENNYLANE (lightning.qubit) and Qiskit is quite similar
compared to other simulators. This discovery indicates that other simulators across all qubit Counts-with PENNYLANE
both PENNYLANE (lightning.qubit) and Qiskit demonstrate (default.qubit) registering the lengthiest time at 19 qubits.
comparable performance in terms of execution time across
varying qubit numbers. The results also provide significant Table 3 presents the data utilized to create Fig 5. For
observations; specifically, CIRQ, ProjectQ, and PENNYLANE further information about this dataset, please refer to the
(default.qubit) exhibit longer execution times compared to GitHub link provided in Appendix.
Table 3 Exection Times for Grover’s Algorithm using Different Quantum Frameworks and Datasets in Seconds
A brief comparison was also carried out between the factoring in noise. From these measurements, the correct
results from a simulator and those from a quantum device. In response is obtained 1016 times, with the '1111111' state
this analysis, the '7Q' flight data containing 128 elements were representing the accurate flight information.
used along with the IBM Quantum computer 'ibm_lagos' [12].
Furthermore, when running the same circuit on a quantum
The IBM Quantum Simulator runs the circuit 1020 times device, no input shows a noticeably high probability, as
to simulate state vectors on a classical computer without depicted in Fig. 7 and 8.
Fig 7 Results from the Ibm _Lagos and the Results become Inconsistent [17]. While Trying to Find a Particular Flight, Utilizing
Multiple Control X Gates Extensively Deepens the Circuit and Distorts the Result.
VI. SUMMARY AND CONCLUSION Grover's search algorithm efficiently located flights that
matched user-defined criteria within the flight datasets.
In this paper, the effectiveness and adaptability of The algorithm demonstrated consistent performance
Grover’s search algorithm in practical scenarios were assessed across different sizes of datasets (small, medium, large)
using flight data of different sizes: small (15Q), medium Despite the increase in dataset dimensions, Grover's
(17Q), and large (19Q). The resulting discoveries and algorithm maintained its effectiveness, indicating its
perspectives can be succinctly outlined: potential to handle larger and more complex databases.
The time taken for execution is found to increase in [10]. Adedoyin, A., Ambrosiano, J., Anisimov, P., et al.
proportion to the dataset size and is significantly impacted (2022). Quantum Algorithm Implementations for
by the construction of an oracle to identify the target item Beginners. ACM Trans. Quantum Comput., 3(4),
or data entry. Developing a highly effective oracle can be Article 18. https://doi.org/10.1145/3517340
challenging and resource-intensive in certain instances, [11]. Szabłowski, P. J., Paweł, B., Szabłowski, J., &
potentially diminishing the practical benefits obtained Szabłowski, P. J. (2021). Understanding mathematics
from the algorithm. of Grover’s algorithm. Quantum Information
Processing, 20, 191. https://doi.org/10.1007/s11128-
Additionally, this study offers important perspectives on 021-03125-w
the potential for quantum computing to revolutionize [12]. IBM, Ibm quantum experience, 2023. Available:
conventional computational procedures. The reliable capacity https: //quantum-computing.ibm.com/
of Grover's algorithm to pinpoint data points across different [13]. Google, Cirq, 2023. Available: https://quantumai.
qubit capacities highlights its practicality and effectiveness. google/cirq.
With advancements in quantum technologies, it is expected [14]. Bergholm, V., Izaac, J., Schuld, M., et al. (2022).
that further enhancements and optimizations will boost its PennyLane: Automatic differentiation of hybrid
capabilities. quantum-classical computations. PennyLaneAI.
https://github.com/PennyLaneAI/pennylane/
In conclusion, this research underscores the importance [15]. Steiger, D. S., Häner, T., & Troyer, M. (2018).
of quantum computing as a revolutionary solution for ProjectQ: An Open Source Software Framework for
addressing challenges related to data search and optimization. Quantum Computing. https://doi.org/10.22331/q-
The effective implementation of Grover’s algorithm in 2018-01-31-49
conducting searches for flight data illustrates the potency and [16]. Mandviwalla, A., Ohshiro, K., & Ji, B. (2018).
adaptability of quantum computing, which has the potential to Implementing Grover’s Algorithm on the IBM
be extended to various scenarios requiring efficient data Quantum Computers.
search and retrieval. This makes it a highly appealing choice [17]. Johnstun, S., & van Huele, J.-F. (2021).
for industries. Understanding and compensating for noise on IBM
quantum computers. American Journal of Physics,
The findings of this study encourage further exploration 89(10), 935–942. https://doi.org/10.1119/10.0006204
of quantum computing's potential, and they set the stage for
the continued evolution of quantum algorithms and their real- APPENDIX
world applications.
Computer System :
REFERENCES The quantum circuit described in this paper was
implemented on a computational platform, the specifications
[1]. Ladd, T. D., Jelezko, F., Laflamme, R., Nakamura, Y., of which are outlined subsequently.
Monroe, C., & O’Brien, J. L. (2010). Quantum
computers. Nature 2010 464:7285, 464(7285), 45–53. Computer Model: Acer Aspire A515-52G
https://doi.org/10.1038/nature08812 Processor: Intel® Core™ i5-8265U CPU @1.60GHz × 8
[2]. Szalay, A. S., Gray, J., & Vandenberg, J. (n.d.). RAM: 8 GB
Petabyte Scale Data Mining: Dream or Reality? Operating System: Ubuntu 22.04.2 LTS
[3]. de Wolf, R. (2017). The Potential Impact of Quantum Python Environment: Python 3.10, Qiskit 0.44.1
Computers on Society.
[4]. Harrow, A. W., Hassidim, A., & Lloyd, S. (2009). This information provides transparency regarding the
Quantum Algorithm for Linear Systems of Equations. computing resources used and can help readers understand
Physical Review Letters, 103(15), 150502. the computational context of the work. It's especially
https://doi.org/10.1103/PhysRevLett.103.150502 important when working with quantum computing, as
[5]. Shor, P. W. (2006). Polynomial-Time Algorithms for hardware and software environments can significantly impact
Prime Factorization and Discrete Logarithms on a the results and execution times of quantum algorithms.
Quantum Computer. 41(2), 303–332.
https://doi.org/10.1137/S0036144598347011 Supplementary Materials:
[6]. Rivest, R. L., Shamir, A., & Adleman, L. (1978). A For additional insights and access to the raw data used
method for obtaining digital signatures and public-key for plotting Fig. 6, refer to the GitHub repository link:
cryptosystems. Communications of the ACM, 21(2), [https://github.com/Jayesh1211/Result-analysis-]
120–126. https://doi.org/10.1145/359340.359342
[7]. Grover, L. K. (1996). A fast quantum mechanical Additional Outputs :
algorithm for database search.
[8]. Yanofsky, N. S. (2007). AN INTRODUCTION TO For 15 Qubits:
QUANTUM COMPUTING.
[9]. Nielsen, M. A. ., & Chuang, I. L. . (2023). Quantum Target Departure Date: Dec 17
computation and quantum information. Cambridge Target Arrival Date: Dec 17
University Press.
Result: 111001011001110
Measured Index: 14759
For 17 Qubits:
Result: 00111010001000001
Measured Index: 66652
For 19 Qubits:
Result: 0101100111110011110
Measured Index: 249754