Skip to content

Commit

Permalink
ast2ast 2
Browse files Browse the repository at this point in the history
  • Loading branch information
dakk committed Oct 18, 2023
1 parent 3a9ba01 commit c15c234
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/source/howitworks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ How it works
============

In order to translate python code to quantum circuit, qlasskit performs several transformations;
it starts from the python *AST* (abstract synthax tree) creating *boolean expressions* as intermediate
it starts from the python *AST* (abstract synthax tree) rewriting it to a simplified version.
Then the simplified *AST* is translated to *boolean expressions* as intermediate
form. Then these boolean expressions are compiled into a *quantum circuit*.

While other existing libraries translate individual operations into quantum circuits and then
Expand Down
11 changes: 11 additions & 0 deletions docs/source/supported.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ Comparators
a > b or b <= c
Function call
^^^^^^^^^^^^^

Bultin functions:
- `print()`: debug function, ignore by conversion
- `len(Tuple)`: returns the length of a tuple
- `max(a, b, ...)`, `max(Tuple)`: returns the max of a tuple
- `min(a, b, ...)`, `min(Tuple)`: returns the min of a tuple
.. - `sum(Tuple)`: returns the sum of the elemnts of a tuple
.. - `all(a, b, ...)`, `all(Tuple)`:
Statements
Expand Down
1 change: 1 addition & 0 deletions qlasskit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from .qcircuit import QCircuit # noqa: F401
from .qlassf import QlassF, qlassf # noqa: F401
from .ast2ast import ast2ast # noqa: F401
from .ast2logic import exceptions # noqa: F401
from .types import ( # noqa: F401, F403
const_to_qtype,
Expand Down

0 comments on commit c15c234

Please sign in to comment.