Skip to content

Commit

Permalink
docs: new tutorial for advanced alias sampling examples and aggregati…
Browse files Browse the repository at this point in the history
…on function

Co-authored-by: mstechly <[email protected]>
  • Loading branch information
sitong1011 and mstechly authored Aug 23, 2024
1 parent 37acec8 commit 4a3d789
Show file tree
Hide file tree
Showing 6 changed files with 2,044 additions and 4 deletions.
Binary file added docs/images/usp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/tutorials/02_alias_sampling_basic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
" {\n",
" \"name\": \"T_gates\",\n",
" \"type\": \"additive\",\n",
" \"value\": \"8*(ceil(log_2(L/(2 ** multiplicity(2,L))))-1)\",\n",
" \"value\": \"8*(ceiling(log_2(L/(2 ** multiplicity(2,L))))-1)\",\n",
" },\n",
" {\"name\": \"rotations\", \"type\": \"additive\", \"value\": \"2\"},\n",
" ],\n",
Expand Down Expand Up @@ -246,7 +246,7 @@
"id": "3eb5233e-d6da-43dd-b716-4315fc1a7b79",
"metadata": {},
"source": [
"We follow the same naming convention in all the subroutines to make things easier to follow. But in swap, we decided to use `X` instead of `R=ceil(log_2(L))`. Why? \n",
"We follow the same naming convention in all the subroutines to make things easier to follow. But in swap, we decided to use `X` instead of `R=ceiling(log_2(L))`. Why? \n",
"\n",
"It shows, that we can use whatever naming we want for any particular subroutine – we don't need to stick to one convention in all the subroutines. This is what you would often want to do in practice. If you would like to reuse this controlled swap in some other algorithm, a generic `X` is a much better choice than a very specific `R`."
]
Expand Down
1,567 changes: 1,567 additions & 0 deletions docs/tutorials/03_advanced_examples.ipynb

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion docs/tutorials/index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Introduction

We currently have two tutorials for `bartiq`:
We currently have three tutorials for `bartiq`:

- [Basic example](01_basic_example.ipynb)
- [Alias Sampling basic](02_alias_sampling_basic.ipynb)
- [Advanced examples](03_advanced_examples.ipynb)

They have been designed to gradually introduce you to the concepts we use in `bartiq`, so we recommend to go through them in order.
Loading

0 comments on commit 4a3d789

Please sign in to comment.