-
-
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 01e4c73
Showing
213 changed files
with
22,430 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
+7.43 KB
_images/0455a0e3b72a0f81cd180b420ab880ea91ebb1ac03c88a921d9f88bfb1fe7133.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/0b90ad5eaf029881b3e3d964d5f785bdf1974db3d62c49500108bc276c03ad3e.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.2 KB
_images/37d794f36dbafcc8f4ac1dac9bc45f322bec9572b4c028bbc76b59cb852af575.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/4735099a8f92f1378da6b4d655cf27dd99e9e812320bbca93d5046bf74af40cc.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/5828532ea7d68f3c427cb49744855475f5710dd52f2dc92e74d59719e1141a19.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.9 KB
_images/69d427b22f3fb4036cf8b2676ea28eed0bf852bf386a1155e916f2a6558d6af7.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/7105fea0f8e0844cf3e1e089bc2550911b383b3c664a4561ec38603cc2e37548.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
+38.5 KB
_images/7d9f24445c34ed969151cb4cc35bba8c627bc9c7fe1ac1eb27741b4adb47c0fb.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/80262c634b47e6ffad3735bc2ba108161c6bd4e9dd2b0db204b9efb5ec9a09c5.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/8efdcd768b84aa2f8dc27673aa7fd80e5f7288c5c50dedd6b53eb156667049eb.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/93c64d54b544bebe79264f9e0935114d8b36ba9860832936a6d3139cc7fbdc4a.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
+13.2 KB
_images/9a3f9d9d24635c6558409728891aeae1ac138b70b28859cb19bcca5bcc93845e.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/9fde7e18e15864b5d144c45f23676b08e2318ab1e7a506fe992e0d0fbc799a42.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/a0953d3817dd6188f8d5d514b3a4aef2439c621bc9409053992169c0414ba187.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
+9.35 KB
_images/a89d8ac2559d266023a3dde26f398c328506b49d942f35c62c54bdf86e2a7d3a.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/b8c64cc0e18e54c9d7036d67f08ce1421369924971bfd35efd70b4fd119386c6.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
+6.3 KB
_images/cf729c01150569099fa21f946bf10127db2714b2bd973357f3e7efc24c0b661d.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
+39.2 KB
_images/da1ccacad203e2c0416e197bd7c2bf40a4c0d85e5d121e807d92d27635ada5db.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/de6c4350be6230ee59aaebeb5b7be91150d2fbe8a5409a58884b0266ecc7c50f.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
Oops, something went wrong.
Binary file added
BIN
+13.1 KB
_images/f064f84a494011dda3cc5c2a6bdb95e5e844aed903bcdf010faafe11648ac8db.png
Oops, something went wrong.
Binary file added
BIN
+17.8 KB
_images/f14a1d62e84e1d38d6e32182cc92a32239a4f55a7f03aaafe656cb3ef8b1afa0.png
Oops, something went wrong.
Binary file added
BIN
+11 KB
_images/f2c66eb892d320100836e07e520038a9f7bdc5f61952f63d6f635da496ce3f1f.png
Oops, something went wrong.
Binary file added
BIN
+44.3 KB
_images/fa726487bcd28f1ea2885e9bbfec2c56fd3d4843571dc4893dbe0f6537050c40.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,217 @@ | ||
{ | ||
"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" | ||
] | ||
}, | ||
{ | ||
"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_factorize.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]()" | ||
] | ||
} | ||
], | ||
"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.