-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 420030e
Showing
213 changed files
with
22,464 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 105bb500e7279fa02026b9e76aa1f655 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+26.2 KB
.doctrees/generated/qlasskit.algorithms.deutschjozsa.DeutschJozsa.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+23.6 KB
.doctrees/generated/qlasskit.qcircuit.qcircuitwrapper.QCircuitWrapper.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file added
BIN
+13.6 KB
_images/134555be2b0ec8b6542fa4c9920ed78256557fd3823098fae0e5b794a7d039f7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.83 KB
_images/23765ce2dceda23c652d4690e559278bbbcbf48bed62ae08c66b1d06767614c4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.2 KB
_images/317b4a8fac0c5bc2bcd5ab20dd179c2a9240473def08b3ba93eb3b0d553781ea.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.6 KB
_images/38de6c110ed81ea81303c7d605b59843cce73ba51cc6f4e85a6ff5669271c5a2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.8 KB
_images/4502fb99b0b62a89285bf5856a32dbf7264a0322771aaf5ee33a084aaa9e9167.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+40.7 KB
_images/45432fc52cfef82701297322f1f2a4c9e1f401b5cce28af1b6fccf623bb39f57.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.8 KB
_images/47b6cd81bccaa913335a53e27b39ebaa13a3e237adc57d32abf8f74664f5531b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+44.3 KB
_images/5b50037dd2c0a981ffc361d45ac7e20ede9efca0e92c747457be1727c64ae36b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.6 KB
_images/5c37e1641175e805bd069b05b0507bee333663522ca9e04c1584a329607d7490.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.1 KB
_images/68ebd5e59484021eb207a14eb3a4a3219a6ecd8b1971abfe71fe0b3484f576f0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.4 KB
_images/816fddadcdd0ee15c32e424045ea5f4d76f6b0add32f18cce0949ecf40028a30.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.45 KB
_images/975f9c766c4ab546bee9118a765d044bdce43b9ce3694cef8b60e97c42ddb931.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.43 KB
_images/9ac701aaf0d8c9378deb40e6f6e1227621ca77e43af7118940ff005d10a3b4cc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.9 KB
_images/a056b3021724ac94b5d8671bfd9097e73add05704cfb48363ea95e2e450eadb5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+181 KB
_images/a1154c255c589e0e4d1936fc4b97b314aad8947cab4b38c090c94fd12164d179.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16 KB
_images/a8917ace04cb0420613da4cfd474deb06536a17cf19a713c5f187839fee6a0e4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+18 KB
_images/ad35bf91a8374681d3e8c22fb6a31f69e9e6518f1478a6054e776c29ee27b211.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+50 KB
_images/b3dbb3fff0ce1009d50d5e24935a30672c92435754f28ff636bbf1526ef4795b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.6 KB
_images/c7d04b10d56938794e94628eaa66357bee167db80983c3bb53291d7d04661f70.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+39.7 KB
_images/cf4aae3eb9d9826b4e5fe76c28059345d7d992a93d8d58ea268d206cb1d8f981.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+24.2 KB
_images/d104916566a99e2da51900e9162fefb55e749ecadff8c23ba5799ed5707897f0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11 KB
_images/da85ccdadfc65e79823ec5a7fc70b3b6b00b858a049aa91045f7704195a4891b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.11 KB
_images/e017f3e106e1cd0f02b1307f42b531383710dab1353d524ef5e4ddbf761ef27a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.26 KB
_images/e55818cf800a54a7925e4b1baed5679302c1ce0167ab0196e4a51a1b8b528332.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.3 KB
_images/e701c8c7d288b7c8b31d67bfd74640291b3169f82970a1c5a96fbc03e0bfef59.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+36.5 KB
_images/e74cc1e022296f53ce2cd1099f078f7715eebe81e2ffa3bbedb069c9a35398dd.png
Oops, something went wrong.
Binary file added
BIN
+9.7 KB
_images/eea1152a92a8945a7719dd6b12beb892cf9e185f4f75aadc434c540509580588.png
Oops, something went wrong.
Binary file added
BIN
+16.7 KB
_images/f136ea25a6a1c5e568142875d165f98fbe43f5c4323eadeafad237a185d8ca93.png
Oops, something went wrong.
Binary file added
BIN
+13.1 KB
_images/f3e9cd6f4bfc037a2c61c72684f180e5ae89c4a01198673478cc56fb746c1be7.png
Oops, something went wrong.
Binary file added
BIN
+18.3 KB
_images/fb5ffd2c19f4003e4c45d4b0d46226c60255334a56fc579013eeac5c4c9a29a8.png
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,247 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Algorithms" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"\n", | ||
"Qlasskit implements high level representation of quantum algorithms that relies on black boxes functions and oracles.\n", | ||
"\n", | ||
"- Grover search\n", | ||
"- Simon periodicity\n", | ||
"- Deutsch Jozsa\n", | ||
"- Bernstein Vazirani" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Abstraction tools\n", | ||
"\n", | ||
"All algorithms share the same base class `QAlgorithm` which inherits from `QCircuitWrapper`. The `QCircuitWrapper` is also father of `qlassf` functions, and offers useful methods to handle high level types.\n", | ||
"\n", | ||
"One of those tools is `decode_counts`, that translates the result dictionary from a quantum sampling in its binary form, to the high level representation of data types used in the qlasskit function; `decode_output` instead, translate a single bitstring." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"4" | ||
] | ||
}, | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"from typing import Tuple\n", | ||
"from qlasskit import qlassf, Qint, Qint4\n", | ||
"\n", | ||
"\n", | ||
"@qlassf\n", | ||
"def test_tools(a: Qint[4]) -> Qint[4]:\n", | ||
" return a + 1\n", | ||
"\n", | ||
"\n", | ||
"test_tools.decode_output(\"0100\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Another method called `encode_input` is able to do the reverse job, transforming high level types to binary form." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"'0100'" | ||
] | ||
}, | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"test_tools.encode_input(Qint4(4))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Grover search\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from qlasskit.algorithms import Grover\n", | ||
"\n", | ||
"\n", | ||
"@qlassf\n", | ||
"def g_orac(a: Tuple[bool, bool]) -> bool:\n", | ||
" return a[0] and not a[1]\n", | ||
"\n", | ||
"\n", | ||
"q_algo = Grover(g_orac, True)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"\n", | ||
"Further examples can be found on the following notebooks:\n", | ||
"\n", | ||
"- [example_grover.ipynb]()\n", | ||
"- [example_grover_subset.ipynb]()\n", | ||
"- [example_grover_hash.ipynb]()\n", | ||
"- [example_grover_sudoku.ipynb]()\n", | ||
"- [example_grover_factors.ipynb]()\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Simon periodicity" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from qlasskit.algorithms import Simon\n", | ||
"\n", | ||
"\n", | ||
"@qlassf\n", | ||
"def f(a: Qint[4]) -> Qint[4]:\n", | ||
" return (a >> 3) + 1\n", | ||
"\n", | ||
"\n", | ||
"q_algo = Simon(f)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"\n", | ||
"Further examples can be found on the following notebooks:\n", | ||
"\n", | ||
"- [example_simon.ipynb]()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Deutsch Jozsa" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from qlasskit.algorithms import DeutschJozsa\n", | ||
"\n", | ||
"\n", | ||
"@qlassf\n", | ||
"def f(b: Qint[4]) -> bool:\n", | ||
" return b < 16\n", | ||
"\n", | ||
"\n", | ||
"q_algo = DeutschJozsa(f)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"\n", | ||
"Further examples can be found on the following notebooks:\n", | ||
"\n", | ||
"- [example_deutsch_jozsa.ipynb]()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Bernstein Vazirani" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from qlasskit.algorithms import BernsteinVazirani, secret_oracle\n", | ||
"\n", | ||
"oracle = secret_oracle(4, 14)\n", | ||
"\n", | ||
"q_algo = BernsteinVazirani(oracle)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Further examples can be found on the following notebooks:\n", | ||
"\n", | ||
"- [example_bernstein_vazirani.ipynb]()" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "qlasskit_310-env", | ||
"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.10.13" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
API | ||
=== | ||
|
||
.. autosummary:: | ||
:toctree: generated | ||
:recursive: | ||
|
||
qlasskit.qlassfun.qlassf | ||
qlasskit.qlassfun.qlassfa | ||
qlasskit.qlassfun.QlassF | ||
qlasskit.algorithms.qalgorithm | ||
qlasskit.algorithms.grover.Grover | ||
qlasskit.algorithms.simon.Simon | ||
qlasskit.algorithms.deutschjozsa.DeutschJozsa | ||
qlasskit.qcircuit.qcircuit.QCircuit | ||
qlasskit.qcircuit.qcircuitwrapper.QCircuitWrapper | ||
qlasskit.qcircuit.gates | ||
qlasskit.bqm.decode_samples | ||
qlasskit.decompiler.Decompiler | ||
qlasskit.types | ||
|
||
.. qlasskit.decompiler.circuit_boolean_optimizer |
Oops, something went wrong.