Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Team Qubitrons #30

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1c33e28
Delete iQuHack-challenge-2023-task9.ipynb
Jan 29, 2023
fb824c5
Delete iQuHack-challenge-2023-task8.ipynb
Jan 29, 2023
d675947
Delete iQuHack-challenge-2023-task1.ipynb
Jan 29, 2023
79b64f5
Delete iQuHack-challenge-2023-task2.ipynb
Jan 29, 2023
2a7b195
Delete iQuHack-challenge-2023-task3.ipynb
Jan 29, 2023
6680c9b
Delete iQuHack-challenge-2023-task4.ipynb
Jan 29, 2023
08aa7a3
Delete iQuHack-challenge-2023-task5.ipynb
Jan 29, 2023
4527ebc
Delete iQuHack-challenge-2023-task6.ipynb
Jan 29, 2023
c46b3f1
Delete iQuHack-challenge-2023-task7.ipynb
Jan 29, 2023
423fb77
Add files via upload
Jan 29, 2023
abb44ca
Create sample.txt
Jan 29, 2023
887e0df
Add files via upload
Jan 29, 2023
f34f42c
Delete README.md
Jan 29, 2023
54db68d
Delete iQuHack-challenge-2023-task1.ipynb
Jan 29, 2023
f37c7c9
Delete iQuHack-challenge-2023-task2.ipynb
Jan 29, 2023
5749ab8
Delete iQuHack-challenge-2023-task3.ipynb
Jan 29, 2023
220b42e
Delete iQuHack-challenge-2023-task4.ipynb
Jan 29, 2023
ca949e4
Delete iQuHack-challenge-2023-task5.ipynb
Jan 29, 2023
afe3e0b
Delete iQuHack-challenge-2023-task6.ipynb
Jan 29, 2023
a14913f
Delete iQuHack-challenge-2023-task7.ipynb
Jan 29, 2023
4e1960f
Delete iQuHack-challenge-2023-task8.ipynb
Jan 29, 2023
a81d6cf
Delete iQuHack-challenge-2023-task9.ipynb
Jan 29, 2023
1e94635
Create README.md
Jan 29, 2023
08600ea
Update iQuHack-challenge-2023-task3.ipynb
Jan 29, 2023
7f1a97d
Update iQuHack-challenge-2023-task4.ipynb
Jan 29, 2023
9326848
Update iQuHack-challenge-2023-task9.ipynb
Jan 29, 2023
bc78c69
Delete sample.txt
Jan 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 3 additions & 77 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,78 +1,4 @@
# Welcome to the Microsoft Challenge @ MIT iQuHACK 2023!
# 2023_Microsoft
Microsoft iQuHACK 2023 Remote Challenge

## Challenge overview

In this challenge, you will explore optimizing quantum circuits, and more specficially - optimizing quantum oracles.
In each task, you'll be given a quantum oracle that implements a certain classical function (the classical function definition is not included in the task).
You'll need to rewrite the code so that it maintains its correctness, but requires as few resources as possible.

## Working on the challenge

* The challenge contains 9 independent tasks. Your team can work on each task independently; tasks are submitted and scored separately.
* You can work on the challenge using a local Quantum Development Kit setup, Azure Quantum hosted notebooks, or qBraid platform.
* You'll need to [create an Azure account and an Azure Quantum workspace](https://aka.ms/iQuHack2023/AQJobSubmit) to evaluate the resources used by your solution, regardless of the platform you're using.
* To work on each task, use the Jupyter notebooks iQuHack-challenge-2023-taskX.ipynb. Each notebook contains the step-by-step instructions for working on the task, including the code that helps you evaluate your solution.
* **You will submit the tasks for challenge using qBraid platform.**
Each task submission is evaluated automatically in two steps.
1. First, the task correctness is checked by verifying that your code acts the same as the original oracle implementation. If your solution doesn't compile, throws a runtime error, or acts differently from the original oracle implementation, this submission will be ignored.
2. Second, if the task is logically correct, its resource consumption is evaluated. For this, we submit a resource estimation job for your code, and calculate your score as **(logical algorithmic qubits) * (algorithmic depth)** (see [resource estimation documentation](https://learn.microsoft.com/en-us/azure/quantum/learn-how-the-resource-estimator-works#algorithmic-logical-estimation), [introductory workshop](https://www.twitch.tv/videos/1718264700) or resource estimation samples for the meaning of these parameters).
3. Your goal is to minimize your score for each task. Your aggregate score in the scoreboard is a sum of ratios (your score for the task) / (the score of the initial oracle implementation for the task) for all tasks.


### Tips and tricks for optimizing your quantum programs

**The score is defined as a product: (logical algorithmic qubits) * (algorithmic depth)**

* The number of logical qubits after mapping scales proportional to the number of qubits in the circuit. Therefore, reducing the qubits in the circuit always helps, unless it leads to an increase in operations.
* The number of logical cycles depend on the number of Toffoli gates (translated to CCZ), T gates, single-qubit measurements (which you will not be using in this challenge), and rotation gates. Clifford operations do not increase logical cycles.
* Rotation gates are the most expensive ones and should be avoided when possible! (For this challenge, you should be able to avoid them completely, using only reversible computation)
* Multiple-controlled X gates (multiple-controlled Toffoli gates) are decomposed by the resource estimator. The number of cycles is 3 * (n - 1), where n >= 1 is the number of control qubits.
* The concrete formulas to determine the logical qubits and logical cycles (after mapping) from the input program is provided in the paper https://arxiv.org/pdf/2211.07629.pdf
* Number of logical qubits in (D1, page 29)
* Number of logical cycles in (D3, page 30)


## Working on qBraid and submitting the tasks
[<img src="https://qbraid-static.s3.amazonaws.com/logos/Launch_on_qBraid_white.png" width="150">](https://account.qbraid.com?gitHubUrl=https://github.com/iQuHACK/2023_microsoft.git)
1. If you're working on qBraid, first fork this repository and click the above `Launch on qBraid` button. It will take you to your qBraid Lab with the repository cloned.
2. Once cloned, open terminal (first icon in the **Other** column in Launcher) and `cd` into this repo. Set the repo's remote origin using the git clone url you copied in Step 1, and then create a new branch for your team:
```bash
cd <microsoft_git_repo_name>
git remote set-url origin <url>
git branch <team_name>
git checkout <team_name>
```
3. Use the environment manager (**ENVS** tab in the right sidebar) to activate the "Microsoft Q#". click **Activate** to [add a new ipykernel](https://qbraid-qbraid.readthedocs-hosted.com/en/latest/lab/kernels.html#add-remove-kernels) for "Microsoft Q#".

<img width="287" alt="image" src="https://user-images.githubusercontent.com/32727721/214965872-f69be46b-64b3-47c0-883d-1ee87374f68b.png">


4. From the **FILES** tab in the left sidebar, double-click on the `2023_Microsoft_Challenge` directory.

5. You are now ready to begin hacking! Work with your team to complete the Microsoft Q# Challenge.


### qBraid Auto Grader Submission Process To Leaderboard:

**PLEASE MAKE SURE TO DO THE FOLLOWING BEFORE YOU SUBMIT**

- Your team name, task #, and a point person's slack name (just in case we need to reach out).
Once you have completed any of the tasks and have added the team name, task # and a point person's slack name, if you are confused). Please got to File (**File** on the top left of the topbar) and click on the `Share notebook` button.
<img width="319" alt="スクリーンショット 2023-01-26 午後4 42 50" src="https://user-images.githubusercontent.com/32727721/214967319-3d2f64ec-19f8-4a06-bf20-0690f8f0e29e.png">

- Enter `[email protected]` and share the file. If it shares successfully, the email should dissapear. Ricky will periodically run the autograder and the leaderboard will be updated accordingly.

- Then submit the remote project submission form that will show up on the iQuHACK website during the last 8 hours of hacking. The form will ask for a link to your repository and your team members (all of whom have to be remote iQuHACK participants to maintain elligibility).

## Prizes

Up to (3) teams with the highest team scores will be chosen as the winners of the Hackathon.
Each member of the winning teams will get a Surface 2 headset.

## Resources

* [Introduction to Azure Quantum workshop at MIT iQuHack](https://www.twitch.tv/videos/1718264700), Wednesday, January 25, 2023
* [The Quantum Katas](https://github.com/Microsoft/QuantumKatas/) - a collection of tutorials and practice problems (chapters "Quantum Oracles and Simple Oracle Algorithms" and "Grover's search algorithm" are a good place to practice your work with marking oracles)
* [Getting started with the resources estimator service](https://learn.microsoft.com/en-us/azure/quantum/quickstart-microsoft-resources-estimator)
* [A deep dive in resource estimation](https://arxiv.org/pdf/2211.07629.pdf)
* [Azure Quantum and Microsoft Quantum Development Kit documentation](https://learn.microsoft.com/azure/quantum/)
Team Qubitrons
Loading