Skip to content

Apples-17/Quantum-Computing-PS2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Quantum-Computing-PS2

Deutsch–Jozsa Algorithm

This project implements the Deutsch–Jozsa quantum algorithm using Qiskit.
It demonstrates how a quantum computer can determine whether a black-box function is constant or balanced in just one query, while a classical computer may require multiple queries.

Project Overview 📘

An interstellar probe has returned with a mysterious crystalline artifact — a "quantum box" that takes a 3-bit input and returns either 0 or 1.

Two scientific theories exist:

  1. Beacon Theory: The box is constant — always outputs the same value for all inputs.
  2. Library Theory: The box is balanced — outputs 0 for half of the inputs and 1 for the other half.

The goal is to determine which theory is correct using as few queries as possible.


Algorithm Logic ⚙️

The Deutsch–Jozsa algorithm is used:

  • It initializes the qubits in a superposition.
  • Calls the oracle (the “black-box” function) only once.
  • Then measures the result.

Interpretation of Results:

  • If the measured output is 000 → Function is constant (Beacon Theory)
  • If the measured output is anything else → Function is balanced (Library Theory)

Circuit Summary 🧩

  1. Prepare 3 input qubits and 1 ancilla qubit.
  2. Initialize the ancilla in the |1⟩ state.
  3. Apply Hadamard gates to create superposition.
  4. Apply the oracle (the box).
  5. Apply Hadamard gates again on input qubits.
  6. Measure input qubits.

My Thoughts 🙂

This was my first quantum computing project, and I learned a lot while implementing the Deutsch–Jozsa algorithm. I explored concepts like quantum gates, oracles and their functions, and also learned how to install and set up Qiskit.

To be completely honest, I tried my best to write the code on my own, but some parts were still confusing. I used ChatGPT to understand and complete certain sections. I hope you’ll understand — I’m still learning and will keep practicing to get better.

Thank you for reading!

-Anushri Maheshwari

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages