The Quantum Traveler

As the final project for 6.S089 Introduction to Quantum Computing, I participated in the 2023 iQuHack and the description of my project is detailed in this blog post. The challenge we undertook was the IBM x Covalent challenge. I hope you enjoy reading! :)

IBM x Covalent Challenge

As detailed by the challenge description “This challenge aims to design and build a cloud-based, quantum-powered application that addresses a real-world problem and is accessible to end users. This includes applications of quantum algorithms that can have practical usage and, in theory, be exposed to businesses or individual users on the internet for consumption. Teams should identify a problem that can be solved (not necessarily more efficiently) with quantum computers.”

The required components of the project are as follows:

  • UI, API, CLI, or some accessible interface. Designing the user interface for their application, taking into account the needs and preferences of end users.
  • Covalent
  • Web Hosted (or internet-exposed proxy to the local computer)
  • Uses IBM Quantum Nairobi system (or Oslo as a backup)

Our project was designed to address the problem that travelers face when planning their next vacation. A practical application that millions of people can leverage.

Overview

Every traveler is different and with so many options, planning a vacation nowadays is a complex mathematical problem. Variables range from the quality of the hotel to the time of flights. In this project, we have explored the possible use of quantum computing in customizing the perfect vacation according to user input. Travelers now can spend that time relaxing instead of constantly Googling all the small details.

The user criteria we evaluated are displayed as follows. For flights, we looked at the time of the flight and the airline. For the hotels, we looked at the star rating. For the restaurants, we looked at cuisine. This largely depended on what APIs were available to us.

Over-Arching Idea

  • The main idea behind our design is to map values of properties of flights, hotels, and restaurants separately to different bit-strings
  • Create three bit-strings from the user's selected options: one for the flight choices, one for the hotel choices, and one for the restaurant choices
  • Use Grover’s search algorithm to filter features to return an option for the traveler from the criteria by matching such bit strings
  • The advantage is only computing the data once and then having a square root speed-up when searching

Example Using Hotel Values Mapped to Bit-Strings

We would map properties to different bit-strings. For example, if a hotel had a rating of 5, we would map it to 101. If it had a rating of 2, we would make it 10. While this case is a direct conversion to binary, in other cases, a 0 would represent it is the correct time and a 1 would represent it being the incorrect time. A bit-string would have all these different bits encoding information relating to the problem.

Workflow

The image below details our workflow on how we attempted to design the front end and backend to connect to one another.

Packages and Tools

We used the following packages and tools to implement our website/app:

  • Html + CSS (front end for user input and displaying results
  • Skyscanner API for python (for webscraping)
  • Covalent and IBM Qiskit for quantum computing backend
  • Flask to turn backend python code into a server to interact with front-end

Results — Frontend

We implemented the front-end using drop-down menus for the start location and destination. If we had more time, we had hoped to clean up the user interface more to create a cleaner look.

Results — Webscraping

We used a Skyscanner API to extract information on flights and saved it to a csv file. Additionally, if we had more time, we had hoped to find a better API that could provide us with more accurate and helpful information.

Results — Quantum Backend

We used Covalent to access the IBM Qasm simulators and Nairobi backends. We defined a Python function to accept an input bit string (could be related to flight data, hotel data, and restaurant data), and generate a quantum circuit corresponding to Grover’s search algorithm for this particular string. As a funny note, perhaps due to server issues or so many people registering for accounts, we had some of our accounts banned by IBM Quantum when we did nothing out of the ordinary.

We mainly relied on Qiskit’s tutorial on Grover’s algorithm to modify it heavily to our own conditions. Testing on Qiskit’s servers was also quite interesting as it provided models that helped visualize what we were trying to do.

Then we used Flask to try to run the backend python code as a server which accepts an input bit-string from the front-end HTML website, and return its results back to the website. The flask code also tries to load the web-scraped flight, hotel, and restaurant data to be filtered, and computes other useful parameters such as the cheapest item in each category.

Runtime Information

We used the two following backends:

  • “Ibmq_qasm_simulator”
  • Total jobs run: 55
  • Shots per job: 100
  • “Ibm_nairobi”
  • Total jobs run: 5
  • Shots per job: 100

Future Considerations

  • Expanding the destinations to all over the world utilizing better APIs or web-scraping the data ourselves
  • Adding additional criteria (ex: free-breakfast, wifi, prices, etc.) and additional features (ex: tourist destinations) and optimizing our searching algorithm through enhancing Grover’s in some way so that even with more options, it’s still fast.
  • Optimize based on distance as well so for example, hotels and restaurants are close to one another
  • Add a map so that users may have better visualizations

Challenges

The biggest challenge we faced is that by the end of the project, we were unable in managing to connect the quantum part of our project to our website. While each part worked successfully individually including our quantum part as it performed the search correctly, it was difficult to link them up together. If given more time, we had hoped to actually manage to run it on quantum.

We had spent probably half of our time during the hackathon attempting to get it to work, and unfortunately, could not manage to fully accomplish what we had set out to achieve.

Conclusion

While our project couldn’t reach its final completion, it was an enjoyable experience to be able to apply what I had learned in 6.S089 Introduction to Quantum Computing and try to leverage it to a useful application that explores the future of quantum computing. Nevertheless, it was a great learning experience as we had talks from qBraid, Quera, and so many other fascinating quantum companies.

Thank you to everyone who contributed to running this class as attending lecture was always fun and I really learned a lot during this IAP, and thanks for reading! :)

--

--