Navigation Menu

Skip to content

Commit

Permalink
Oct challenge QOSF Mentorship Screening Tasks (#55)
Browse files Browse the repository at this point in the history
* add challenge feb 2022

* add challenge feb 2022

* add challenge mar 2022

* add challenge mar 2022

* Update README.md

* Apr 2022 Challenge

* Apr 2022 Challenge

* July  2022 Challenge

* Oct challenge QOSF Mentorship Screening Tasks

Co-authored-by: Amir Ebrahimi <github@aebrahimi.com>
  • Loading branch information
MaldoAlberto and amirebrahimi committed Oct 16, 2022
1 parent b32a802 commit af7e07d
Show file tree
Hide file tree
Showing 3 changed files with 203 additions and 5 deletions.
11 changes: 7 additions & 4 deletions README.md
Expand Up @@ -4,10 +4,10 @@ A repository containing monthly challenges in the field of quantum computing.

## Current Challenge

**[July 2022 Challenge](challenge-2022.07-jul/challenge-2022.07-jul.ipynb)** - Palindrome Integer
**[October 2022 Challenge](challenge-2022.10-oct/challenge-2022.10-oct.ipynb)** - Palindrome Integer

**Release date**: July 1, 2022
**Submission deadline (optional):** August 1, 2022
**Release date**: October 15, 2022
**Submission deadline (optional):** November 15, 2022

You can see previous challenges [here](#previous-challenges).

Expand Down Expand Up @@ -152,4 +152,7 @@ Release date: March 2th, 2022
---

[April 2022 Challenge](challenge-2022.04-apr/challenge-2022.04-apr.ipynb): Finding the way out of the maze
Release date: April 18th, 2022

---

[July 2022 Challenge](challenge-2022.07-jul/challenge-2022.07-jul.ipynb): Palindrome Integer
2 changes: 1 addition & 1 deletion challenge-2022.07-jul/challenge-2022.07-jul.ipynb
Expand Up @@ -446,7 +446,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.5"
}
},
"nbformat": 4,
Expand Down
195 changes: 195 additions & 0 deletions challenge-2022.10-oct/challenge-2022.10-oct.ipynb
@@ -0,0 +1,195 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "f4f59ee5",
"metadata": {},
"source": [
"# Oct 2022 Challenge: Mentorship Program Screening Tasks\n",
"\n",
"Since this month coincides with the application window for the QOSF mentorship program, we have decided to make the corresponding screening tasks the challenge for this month. So, even if you aren't applying to the mentorship program you can still have a look at the screening tasks.\n",
"\n",
"There are four separate tasks, so you're welcome to try your hand at as many of them as you like!\n",
"\n",
"**_NOTE: The application deadline is October 4th, so don't submit any PRs until after that date since you would be making potential solutions public.**\n",
"\n",
"## Task 1 Multiplier\n",
"To make a multiplier, for this we design the input of two positive integers to a function and this function will process a quantum algorithm that makes the multiplier (see Draper adder) and returns the result in an integer.\n",
"\n",
"you cannot use any implementation already designed by the framework\n",
"\n",
"\n",
"def multiplier(int:number_1, int ,number_2):\n",
" “””\n",
" number_1 : integer positive value that is the first parameter to the multiplier function,\n",
"number_2 : integer positive value that is the second parameter to the multiplier function.\n",
"Return the positive integer value of the multiplication between number_1 and number_2\n",
" “””\n",
"\n",
" # use a framework that works with quantum circuits, qiskit, cirq, pennylane, etc. \n",
"\n",
"\n",
" # define a quantum circuit to convert the integer values in qubits, example bases encoding \n",
" # basis encoding: n bits are equals to a state of n qubits, example \n",
" # The integer value 3 convert to a binary string that is 11, the basis encoding is |11⟩\n",
" \n",
" # use the state of the art to check the possibles ways to design a multiplier\n",
"\n",
" Return # the result of the quantum circuit into an integer value\n",
"\n",
"### consider print your quantum circuit,\n",
"\n",
"\n",
"Example:\n",
"\n",
"A = multiplier(5,6)\n",
"print(A)\n",
"\n",
"30\n",
"\n",
"Bonus: \n",
"\n",
"Use your proposal to design different inputs, and check the limitations of your simulator and framework, consider number of qubits, time of execution, the depth of the quantum circuit and number of the gates.\n",
"\n",
"\n",
"References:\n",
"\n",
"[1] Addition on a Quantum Computer\n",
"https://arxiv.org/pdf/quant-ph/0008033.pdf \n",
"\n",
"[2] T-count Optimized Design of Quantum Integer Multiplication \n",
"https://arxiv.org/pdf/1706.05113.pdf \n",
"\n",
"[3] Quantum arithmetic with the Quantum Fourier Transform \n",
"https://arxiv.org/pdf/1411.5949.pdf\n",
"\n",
"\n",
"\n",
"## Task 2 Missing Number\n",
"From a function that has as a parameter a vector of positive integers of size 2^n -1, which is missing a number, this vector can be disordered, to search for the missing number from a quantum circuit.\n",
"\n",
"\n",
"def missing_number(Optional[list,array, str]: input_vector):\n",
" “””\n",
" input_vector: List, array or string that contain integer values of size 2^n -1, where are missing a number to obtain all the number 2^n \n",
"\n",
"Return the positive integer value that is missing in the input.\n",
" “””\n",
"\n",
"1\n",
" # use a framework that works with quantum circuits, qiskit, cirq, pennylane, etc. \n",
"\n",
" # define a quantum circuit to convert the vector in a quantum circuit\n",
" # define an oracle to find the missing value\n",
" # encoding the output value in an integer value\n",
"\n",
"### consider print your quantum circuit,\n",
"\n",
"\n",
"Example:\n",
"\n",
"A = missing_number([3,0,1])\n",
"print(A)\n",
"\n",
"2\n",
"\n",
"Bonus: \n",
"\n",
"Which is the largest list that can be implemented? Identify it and describe the result\n",
"\n",
"References:\n",
"\n",
"[1] Deutsch, David, and Richard Jozsa. \"Rapid solution of problems by quantum computation.\" Proceedings of the Royal Society of London. Series A: Mathematical and Physical Sciences 439.1907 (1992): 553-558.\n",
"[2] Bernstein, Ethan, and Umesh Vazirani. \"Quantum complexity theory.\" SIAM Journal on computing 26.5 (1997): 1411-1473.\n",
"[3] Grover, Lov K. , \"A fast quantum mechanical algorithm for database search\", Proceedings of the 28th Annual ACM Symposium on the Theory of Computing (1996), arXiv:quant-ph/9605043\n",
"\n",
"\n",
"## Task 3 Mottonen state preparation\n",
"Implement the Mottonen state preparation of any dataset you have for at most one 8-element vector.\n",
"\n",
"you cannot use any implementation already designed by the framework\n",
"\n",
"\n",
"def state_prep(Optional[list,array]: input_vector):\n",
" “””\n",
" input_vector: List, array that contain float values of size 2^n\n",
"Return the mottomen state preparation of the input_vector\n",
" “””\n",
"\n",
" # use a framework that works with quantum circuits, qiskit, cirq, pennylane, etc. \n",
"\n",
" # define a quantum circuit to convert the vector in a quantum circuit\n",
" # define the Mottonen state\n",
"\n",
"\n",
"### consider print your quantum circuit\n",
"\n",
"\n",
"Bonus: \n",
"Consider a state vector of size 5,7,10 how you can implement a vector of size different to 2^n.\n",
"\n",
"References: \n",
"\n",
"[1] Transformation of quantum states using uniformly controlled rotations \n",
"https://arxiv.org/pdf/quant-ph/0407010.pdf \n",
"\n",
"## Task 4 sending files\n",
"It uses the BB84 protocol to generate a key with which you are going to send a multimedia file (image) or video and this can be transferred from the quantum teleportation and deciphered with the same key. send the QOSF logo from folder mentee to folder mentor\n",
"\n",
"\n",
"you cannot use any implementation already designed by the framework\n",
"\n",
"\n",
"\n",
"Download the QOSF logo, create a folder mentee and a folder mentor, in the mentee folder save the image of the QOSF logo(grey scale). Design a function called send_file where you send the QOSF logo to the folder mentor. \n",
"\n",
"\n",
"def send_file(str: path, str:name,str:path_destionation):\n",
" “””\n",
" path: String value where is the local folder (mentee folder)\n",
" name: String for the file to send to the mentor folder, (the name of the QOSF logo)\n",
" Path_destionation: String value where is the destination folder (mentor folder)\n",
"Return is success or not\n",
"\n",
" “””\n",
" # use a framework that works with quantum circuits, qiskit, cirq, pennylane, etc. \n",
" # define a quantum circuit to convert the image in a quantum circuit, you can convert in a gray scale the logo.\n",
" # define the protocol BB84 and the quantum teleportation\n",
" # save the result in the destination folder.\n",
"\n",
"### consider show the result in a folder and explain the process\n",
"\n",
"Describe the process and explain the limitations, advantages of this process for security.\n",
"\n",
"Bonus: \n",
"Try to use it on 2 different computers.\n",
"\n",
"\n",
"References\n",
"[1] Simple Proof of Security of the BB84 Quantum Key Distribution Protocol\n",
"https://arxiv.org/pdf/quant-ph/0003004.pdf"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

0 comments on commit af7e07d

Please sign in to comment.