-
-
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 85acdc6
Showing
246 changed files
with
23,274 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 records the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 80d2f74dcc8c78c844b8df8270d8fe12 | ||
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 not shown.
Binary file not shown.
Binary file added
BIN
+25.7 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.7 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
+41 KB
_images/019dac7469364f6658e919eb561555597962a6c6900b3cacdcb98cebed7935cf.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.83 KB
_images/1bb7952cf2d71ffee3d2c545a91949e394207a5f83dcf449dd8c2967e3955df7.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.4 KB
_images/276cc4540e79e06996194c30519e416ae22a670d8cd845f31ff6d81e8674a024.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/28d186c05d2bc51d40e3a2e11fef1e9e07e0f6a6ffc7eef96637bf4cf316a739.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/357488901319cf15bcfb2b813e7b5f5c3e5541b74a8f561f689d7941bf737bda.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
+11.6 KB
_images/3ef0e6983243e7322d09f19294f958ed83f9bce81aec887de5b6e3412346a366.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/42ee00ba8cdd404d3cb4a03bf5aace7b56fa408587cf560cc0ec05d2c2ae131e.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
+30.8 KB
_images/478d182c5ddda159d2e61dbfc2160d09db0db549e4aa8e5aeaf4fb75bbb371e2.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.3 KB
_images/4ce91db20dd6aa9f980bd2caa6ad0eb5d7084f0bd4ab6115a87146cde9f39fa7.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/66873d011e5fae3764918877d31d94cd3ed24898e7085402a2940cb5e81547cb.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
+181 KB
_images/80d77e67d7002fbb05aeb7f0366824e2628060ae4b9597b1e141d304da6ca8f8.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
+19 KB
_images/8aeb60e1cb69e3a1286bafb3e8b4c790686087c90803c5029a55ca1e4f295cdd.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
+15 KB
_images/8f0411346e3a6c8ef1433aa3e375a9ec1db74941d37f99c465c9dd6025915876.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/9082ebe54997d99ea07854c04bb29b58e7576e123fb3abe09982d2b09dfba75a.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/97ac16d3af5d645c58f6d55a55d406776888e130e87f81af31f70c506fcd2d77.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/981b936f883d850a86045c786629348dc03c30f84ac897452ba323c175347acc.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/9b6f26a93fcbeba5678d5efe1ec56ba4e04b7ddfe5f0a3fbaa1535aa4b8910fb.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.1 KB
_images/9e6305113b681dc6a27d89bcaf87e83da0d640ce0bf1b4962be9defdfbc97ba3.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
+15.8 KB
_images/a633dbbd9f9b7df16f2beca8569f6963a555b5dd37323f17fa127ff0b27cf167.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
+5.83 KB
_images/b211163ef807d483c21a42e982d6e7cc7a9e840405a6300666fcf33cb675de7d.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/b3f41f967d1cd70aaa5b8ca06d671fb93e619d3493b1c8bda8286363e730003e.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.6 KB
_images/c53597497be0f3d3a8fb6631a16df8bae06d10e0801a9af58d1105f38c9a33f2.png
Oops, something went wrong.
Binary file added
BIN
+10.6 KB
_images/c7d04b10d56938794e94628eaa66357bee167db80983c3bb53291d7d04661f70.png
Oops, something went wrong.
Binary file added
BIN
+44.3 KB
_images/c8554185f0e7b6ce7bbb3518bc1a3fcfee1df87647abed38732acb382dabebb0.png
Oops, something went wrong.
Binary file added
BIN
+17.8 KB
_images/cec4d0f73e99f39ee1d7a7cc3393d9f71f6eede08410d12fe4af4fbe9ba38f61.png
Oops, something went wrong.
Binary file added
BIN
+24.2 KB
_images/d104916566a99e2da51900e9162fefb55e749ecadff8c23ba5799ed5707897f0.png
Oops, something went wrong.
Binary file added
BIN
+9.11 KB
_images/e017f3e106e1cd0f02b1307f42b531383710dab1353d524ef5e4ddbf761ef27a.png
Oops, something went wrong.
Binary file added
BIN
+9.26 KB
_images/eb3f8eb52f00173826a185088a9d8e20930da2f903c93f870fe9702fbf4a08b6.png
Oops, something went wrong.
Binary file added
BIN
+13.1 KB
_images/f04d51830be29018b0043e84d8b0b6760021972297e13a62948c8faf2876b5d4.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.