Skip to content

Commit

Permalink
deploy: 525a878
Browse files Browse the repository at this point in the history
  • Loading branch information
dakk committed Jul 11, 2024
0 parents commit d8da65e
Show file tree
Hide file tree
Showing 223 changed files with 23,355 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
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 added .doctrees/algorithms.doctree
Binary file not shown.
Binary file added .doctrees/api.doctree
Binary file not shown.
Binary file added .doctrees/bqm.doctree
Binary file not shown.
Binary file added .doctrees/cli_tools.doctree
Binary file not shown.
Binary file added .doctrees/decompiler_and_optimizer.doctree
Binary file not shown.
Binary file added .doctrees/environment.pickle
Binary file not shown.
Binary file added .doctrees/example_bernstein_vazirani.doctree
Binary file not shown.
Binary file added .doctrees/example_big_circuit.doctree
Binary file not shown.
Binary file added .doctrees/example_bqm_polynomial.doctree
Binary file not shown.
Binary file added .doctrees/example_bqm_tsp.doctree
Binary file not shown.
Binary file added .doctrees/example_deutsch_jozsa.doctree
Binary file not shown.
Binary file added .doctrees/example_ecdsa.doctree
Binary file not shown.
Binary file added .doctrees/example_grover.doctree
Binary file not shown.
Binary file added .doctrees/example_grover_factors.doctree
Binary file not shown.
Binary file added .doctrees/example_grover_hash.doctree
Binary file not shown.
Binary file added .doctrees/example_grover_sat.doctree
Binary file not shown.
Binary file added .doctrees/example_grover_subset.doctree
Binary file not shown.
Binary file added .doctrees/example_grover_sudoku.doctree
Binary file not shown.
Binary file added .doctrees/example_simon.doctree
Binary file not shown.
Binary file added .doctrees/example_unitary_of_f.doctree
Binary file not shown.
Binary file added .doctrees/exporter.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 added .doctrees/generated/qlasskit.types.doctree
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/generated/qlasskit.types.qbool.doctree
Binary file not shown.
Binary file added .doctrees/generated/qlasskit.types.qchar.doctree
Binary file not shown.
Binary file added .doctrees/generated/qlasskit.types.qfixed.doctree
Binary file not shown.
Binary file added .doctrees/generated/qlasskit.types.qint.doctree
Binary file not shown.
Binary file added .doctrees/generated/qlasskit.types.qlist.doctree
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/generated/qlasskit.types.qtype.doctree
Binary file not shown.
Binary file added .doctrees/how_it_works.doctree
Binary file not shown.
Binary file added .doctrees/index.doctree
Binary file not shown.
Binary file added .doctrees/parameters.doctree
Binary file not shown.
Binary file added .doctrees/quickstart.doctree
Binary file not shown.
Binary file added .doctrees/supported.doctree
Binary file not shown.
Empty file added .nojekyll
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 _images/qlasskit_transformations.png
247 changes: 247 additions & 0 deletions _sources/algorithms.ipynb.txt
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
}
22 changes: 22 additions & 0 deletions _sources/api.rst.txt
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
Loading

0 comments on commit d8da65e

Please sign in to comment.