Skip to content

Commit

Permalink
July 2021 Challenge (#42)
Browse files Browse the repository at this point in the history
* challenge-09 (#41)

* Batch rename folders / files to new monthly naming scheme; Update latest challenge

* Fix broken link

Co-authored-by: Diego Emilio Serrano <[email protected]>
  • Loading branch information
amirebrahimi and diemilio authored Jul 22, 2021
1 parent d27d0a3 commit de3dd32
Show file tree
Hide file tree
Showing 39 changed files with 97 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contributions are welcome in the form of future challenges or challenge submissi

## Challenge contributions

One of our previous [challenges](challenge-07/qosf-monthly-challenge-07.ipynb) is actually a manifestation of this doc, but we will copy the salient points here for completeness (the more of these the better):
One of our previous [challenges](challenge-2021.05-may/challenge-2021.05-may.ipynb) is actually a manifestation of this doc, but we will copy the salient points here for completeness (the more of these the better):
- Preferably a topic that isn't something we've already covered in past challenges
- Can be completed in a reasonable amount of time for at least the first task (< 4 hours)
- Doesn't require too much prior knowledge since the point is to educate through the challenge
Expand Down
28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Repository containing monthly challenges in quantum computing.

## Current Challenge

**Link to Problem Notebook**: [Challenge 08](challenge-08/qosf-monthly-challenge-08.ipynb) - k-Nearest Neighbors
**Link to Problem Notebook**: [July 2021 Challenge](challenge-2021.07-jul/challenge-2021.07-jul.ipynb) - Quantum State Tomography

**Release date**: June 19th, 2021
**Release date**: July 21st, 2021

**Submission deadline (optional):** July 17th, 2021
**Submission deadline (optional):** August 18th, 2021

## How it Works

Expand Down Expand Up @@ -75,42 +75,48 @@ Any other questions? Try the [GitHub documentation](https://docs.github.com/en)
## Previous Challenges

<!-- use two spaces after each line to have line breaks -->
[Challenge 01](challenge-01/qosf-monthly-challenge-01.pdf): Diagonal Unitaries
[November 2020 Challenge](challenge-2020.11-nov/challenge-2020.11-nov.pdf): Diagonal Unitaries
Release date: November 2nd, 2020
Submission deadline (optional): November 23rd, 2020

---

[Challenge 02](challenge-02/qosf-monthly-challenge-02.ipynb): Minimum Hamming Distance
[December 2020 Challenge](challenge-2020.12-dec/challenge-2020.12-dec.ipynb): Minimum Hamming Distance
Release date: December 10th, 2020
Submission deadline (optional): January 9th, 2021

---

[Challenge 03](challenge-03/qosf-monthly-challenge-03.ipynb): Minimum Makespan
[January 2021 Challenge](challenge-2021.01-jan/challenge-2021.01-jan.ipynb): Minimum Makespan
Release date: January 10th, 2020
Submission deadline (optional): February 9th, 2021

---

[Challenge 04](challenge-04/qosf-monthly-challenge-04.ipynb): QOSF Mentorship Screening Tasks
[February 2021 Challenge](challenge-2021.02-feb/challenge-2021.02-feb.ipynb): QOSF Mentorship Screening Tasks
Release date: February 18th, 2021
Submission deadline (optional): March 17th, 2021

---

[Challenge 05](challenge-05/qosf-monthly-challenge-05.ipynb): Quantum Autoencoders (QML)
[March 2021 Challenge](challenge-2021.03-mar/challenge-2021.03-mar.ipynb): Quantum Autoencoders (QML)
Release date: March 19th, 2021
Submission deadline (optional): April 18th, 2021

---

[Challenge 06](challenge-06/qosf-monthly-challenge-06.ipynb): Mermin-Peres Magic Square Game
[April 2021 Challenge](challenge-2021.04-apr/challenge-2021.04-apr.ipynb): Mermin-Peres Magic Square Game
Release date: April 22nd, 2021
Submission deadline (optional): May 21st, 2021

---

[Challenge 07](challenge-07/qosf-monthly-challenge-07.ipynb): unitaryHACK!
[May 2021 Challenge](challenge-2021.05-may/challenge-2021.05-may.ipynb): unitaryHACK!
Release date: May 14th, 2021
Submission deadline (optional): May 30th, 2021
Submission deadline (optional): May 30th, 2021

---

[June 2021 Challenge](challenge-2021.06-jun/challenge-2021.06-jun.ipynb): k-Nearest Neighbors
Release date: June 19th, 2021
Submission deadline (optional): July 17th, 2021
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,33 @@
"cells": [
{
"cell_type": "markdown",
"id": "a0ea7123",
"metadata": {},
"source": [
"## Challenge 05: Quantum Machine Learning and Quantum Autoencoders"
]
},
{
"cell_type": "markdown",
"id": "ecdda234",
"metadata": {},
"source": [
"**_This challenge is brought to you by [@Shiro-Raven](https://github.com/Shiro-Raven) as a community contribution. Thank you!_**\n",
"\n",
"In [Challenge 03](../challenge-03/qosf-monthly-challenge-03.ipynb), QAOA was one of the proposed algorithms to solve the problem statement. This algorithm, along with many others known as **variational algorithms**, makes use of a classical controller to optimise the parameters of the different parametric operators that can be found in the circuit. Variational algorithms have many uses in the area of quantum computing, one of which we will take a look at today: Quantum Machine Learning (QML). "
"In [Challenge 03](https://github.com/qosf/monthly-challenges/tree/main/challenge-2021.01-jan/challenge-2021.01-jan.ipynb), QAOA was one of the proposed algorithms to solve the problem statement. This algorithm, along with many others known as **variational algorithms**, makes use of a classical controller to optimise the parameters of the different parametric operators that can be found in the circuit. Variational algorithms have many uses in the area of quantum computing, one of which we will take a look at today: Quantum Machine Learning (QML). "
]
},
{
"cell_type": "markdown",
"id": "0fff4723",
"metadata": {},
"source": [
"### Introduction"
]
},
{
"cell_type": "markdown",
"id": "2aec18d6",
"metadata": {},
"source": [
"#### A Quick ML Intro\n",
Expand All @@ -37,6 +41,7 @@
},
{
"cell_type": "markdown",
"id": "d8662b99",
"metadata": {},
"source": [
"#### Why QML though?\n",
Expand All @@ -48,13 +53,15 @@
},
{
"cell_type": "markdown",
"id": "bf2e8898",
"metadata": {},
"source": [
"### Problem"
]
},
{
"cell_type": "markdown",
"id": "fb8b68fe",
"metadata": {},
"source": [
"The goal of this challenge to experiment around with simple QML models, using them for several simplistic classification tasks on classical data. Typically, a QML circuit would consist of three main stages, shown in the image below resource [B]:\n",
Expand All @@ -74,13 +81,15 @@
},
{
"cell_type": "markdown",
"id": "69be7998",
"metadata": {},
"source": [
"### Resources"
]
},
{
"cell_type": "markdown",
"id": "6d706508",
"metadata": {},
"source": [
"[A] [Machine Learning Tutorial for Beginners: What is, Basics of ML](https://www.guru99.com/machine-learning-tutorial.html)\n",
Expand All @@ -92,13 +101,15 @@
},
{
"cell_type": "markdown",
"id": "9815cced",
"metadata": {},
"source": [
"### References"
]
},
{
"cell_type": "markdown",
"id": "d9ba7135",
"metadata": {},
"source": [
"[1] [An introduction to quantum machine learning](https://arxiv.org/abs/1409.3097)\n",
Expand All @@ -113,6 +124,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "06408c2a",
"metadata": {},
"outputs": [],
"source": []
Expand All @@ -134,7 +146,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
"version": "3.9.2"
}
},
"nbformat": 4,
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
"version": "3.9.2"
}
},
"nbformat": 4,
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"\n",
"**Task 1**\n",
"\n",
"The goal in writing a challenge is to pick a topic that will appeal to the community -- primarily those who are wanting to improve their skills in quantum computing. That topic may be something that is drawing attention as of late (e.g. VQA), but could also be something that is well known, but without many concrete implementations, such as the [Mermin-Peres Magic Squares](../qosf-monthly-challenge-06/qosf-monthly-challenge-06.ipynb) game. So, find a topic that isn't something we've already covered in past challenges [A] and also has as many of the following attributes:\n",
"The goal in writing a challenge is to pick a topic that will appeal to the community -- primarily those who are wanting to improve their skills in quantum computing. That topic may be something that is drawing attention as of late (e.g. VQA), but could also be something that is well known, but without many concrete implementations, such as the [Mermin-Peres Magic Squares](https://github.com/qosf/monthly-challenges/tree/main/challenge-2021.04-apr/challenge-2021.04-apr.ipynb) game. So, find a topic that isn't something we've already covered in past challenges [A] and also has as many of the following attributes:\n",
"- Can be completed in a reasonable amount of time for at least the first task (< 4 hours)\n",
"- Doesn't require too much prior knowledge since the point is to educate through the challenge\n",
"- Has good references that can be included in the challenge for those who get stuck\n",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"https://csc.lsu.edu/~saikat/n-mnist/\n",
"\n",
"\n",
"Considerations to solve the problem is to decrease the number of qubits that can hold the image information (using a classical [[3]](https://arxiv.org/pdf/1908.02626.pdf),[[4]](https://arxiv.org/pdf/1404.1100.pdf),[[5]](https://www.mdpi.com/2504-3900/54/1/40/pdf) preprocessing) or use the idea of [Challenge-05](https://github.com/qosf/monthly-challenges/tree/main/challenge-05). \n",
"Considerations to solve the problem is to decrease the number of qubits that can hold the image information (using a classical [[3]](https://arxiv.org/pdf/1908.02626.pdf),[[4]](https://arxiv.org/pdf/1404.1100.pdf),[[5]](https://www.mdpi.com/2504-3900/54/1/40/pdf) preprocessing) or use the idea of [challenge-2021.03-mar](https://github.com/qosf/monthly-challenges/tree/main/challenge-2021.03-mar). \n",
"\n",
"\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"https://csc.lsu.edu/~saikat/n-mnist/ \n",
"\n",
"**Task 2** \n",
"Try solving the problem with a decreased number of qubits for holding the image information (using a classical [[3]](https://arxiv.org/pdf/1908.02626.pdf),[[4]](https://arxiv.org/pdf/1404.1100.pdf),[[5]](https://www.mdpi.com/2504-3900/54/1/40/pdf) preprocessing step) or using the idea of [Challenge-05](https://github.com/qosf/monthly-challenges/tree/main/challenge-05). \n",
"Try solving the problem with a decreased number of qubits for holding the image information (using a classical [[3]](https://arxiv.org/pdf/1908.02626.pdf),[[4]](https://arxiv.org/pdf/1404.1100.pdf),[[5]](https://www.mdpi.com/2504-3900/54/1/40/pdf) preprocessing step) or using the idea of the [March 2021 Challenge](https://github.com/qosf/monthly-challenges/tree/main/challenge-2021.03-mar/challenge-2021.03-mar.ipynb). \n",
"\n",
"**Task 3 (Bonus)** \n",
"Increase the challenge to include a third class, such as using classes \"0\", \"7\" and \"8\" with an accuracy of at least 85%. Having more than two classes I considered this [post](https://towardsdatascience.com/a-simple-introduction-to-k-nearest-neighbors-algorithm-b3519ed98e) to identify the value of k that would be the best for the classification. What about a fourth class? How high can you go?"
Expand Down
File renamed without changes
File renamed without changes
61 changes: 61 additions & 0 deletions challenge-2021.07-jul/challenge-2021.07-jul.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# July 2021 Challenge: Quantum State Tomography\n",
"\n",
"[Quantum state tomography](https://en.wikipedia.org/wiki/Quantum_tomography) is the process of reconstructing an unknown quantum state by taking measurements in different bases, and using the result outcomes to estimate its probability amplitides. This is done under the assumption that the same state can be prepared or given to us repeatedly so the process can be performed enough times to build statistical significance. Resource [A] may be helpful as an introduction.\n",
"\n",
"For this challenge, your job is to write a program that performs state tomography for an input state, and also returns the [fidelity](https://en.wikipedia.org/wiki/Fidelity_of_quantum_states) of the predicted outcome with respect to the input quantum state. Resource [B] may be helpful to check your work against.\n",
"\n",
"**Level 1:** Implement a program to perform quantum state tomography for a 1-qubit state. Report the fidelity of the predicted state as function of the number of samples/shots [2].\n",
"\n",
"**Level 2:** Generalize the program to perform quantum state tomography on an n-qubit state. Report the fidelity of the predicted state as function of the number of samples/shots. Keep in mind that you might want to try this for a relatively small number of qubits when you decide to simulate your program. \n",
"\n",
"**Level 3:** Instead of trying to reconstructing the state through simple repeated measurements, consider implementing a program that uses variational approach to adjust the parameters of a quantum circuit to reconstruct the unknown state. **Hint**: Consider how using the [SWAP test](https://en.wikipedia.org/wiki/Swap_test) in different measurement bases can help acomplish this [1].\n",
"\n",
"**Resources**\n",
"\n",
"[A] Quantum state tomography as a numerical optimization problem. \n",
"Niklas Rohling. https://www.youtube.com/watch?v=Wk6h6NyXkAg \n",
"[B] Qiskit Quantum Tomography Tutorial. https://qiskit.org/documentation/tutorials/noise/8_tomography.html \n",
"\n",
"**References**\n",
"\n",
"[1] Variational Quantum Circuits for Quantum State Tomograph. Yong Liu, et. al. https://arxiv.org/pdf/1912.07286.pdf \n",
"[2] Quantum State Tomography of a Single Qubit: Comparison of Methods. Roman Schmied. https://arxiv.org/pdf/1407.4759.pdf \n",
"[3] Quantum State Tomography. J. B. Altepeter, et. al. http://research.physics.illinois.edu/QI/Photonics/tomography-files/tomo_chapter_2004.pdf "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.2"
}
},
"nbformat": 4,
"nbformat_minor": 4
}

0 comments on commit de3dd32

Please sign in to comment.