\n",
+ "# NOTE\n",
"\n",
- "This tutorial, as well as all the other tutorials, has been written as a jupyter notebook.\n",
- "If you're reading it online, you can either keep reading, or go to `docs/tutorials` to explore them in a more interactive way!\n",
+ "# This tutorial is a a jupyter notebook.\n",
+ "# Click the \"Open in Collab\" button to view an interactive version of the tutorial.\n",
"\n",
- "
"
+ "# Install dependencies for this notebook . Run once per session.\n",
+ "%pip install -q \"bartiq[optimization,interactive,jupyter]\" qref graphviz\n"
]
},
{
diff --git a/docs/tutorials/02_alias_sampling_basic.ipynb b/docs/tutorials/02_alias_sampling_basic.ipynb
index f11bee76..0a79707e 100644
--- a/docs/tutorials/02_alias_sampling_basic.ipynb
+++ b/docs/tutorials/02_alias_sampling_basic.ipynb
@@ -8,19 +8,6 @@
"# Alias Sampling"
]
},
- {
- "cell_type": "markdown",
- "id": "8d4d79ad-b0e7-4ae9-8b6c-706fa5760612",
- "metadata": {},
- "source": [
- "
NOTE:
\n",
- "\n",
- "This tutorial, as well as all the other tutorials, has been written as a jupyter notebook.\n",
- "If you're reading it online, you can either keep reading, or clone the repository and go to `docs/tutorials` to explore them in a more interactive way!\n",
- "\n",
- "
"
- ]
- },
{
"cell_type": "markdown",
"id": "4200cc8f-ecea-42a1-8eab-556aa97cbe25",
@@ -38,6 +25,22 @@
"This circuit is an important subroutine in the paper's larger algorithm because it is responsible for preparing arbitrary quantum states, which can be thought of as \"loading\" data into the quantum computer."
]
},
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "f7543e68-33b5-4216-96d0-b2819196b3d9",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# NOTE\n",
+ "\n",
+ "# This tutorial is a a jupyter notebook.\n",
+ "# Click the \"Open in Collab\" button to view an interactive version of the tutorial.\n",
+ "\n",
+ "# Install dependencies for this notebook . Run once per session.\n",
+ "%pip install -q \"bartiq[optimization,interactive,jupyter]\" qref graphviz\n"
+ ]
+ },
{
"cell_type": "markdown",
"id": "8ec5bd3c-d8ed-4261-8f22-d7db04d65fa8",
diff --git a/docs/tutorials/03_advanced_examples.ipynb b/docs/tutorials/03_advanced_examples.ipynb
index ff7275fa..df7168f3 100644
--- a/docs/tutorials/03_advanced_examples.ipynb
+++ b/docs/tutorials/03_advanced_examples.ipynb
@@ -8,25 +8,12 @@
"# Using Bartiq for Resource Analysis"
]
},
- {
- "cell_type": "markdown",
- "id": "edb1edfd47920714",
- "metadata": {},
- "source": [
- "
NOTE:
\n",
- "\n",
- "This tutorial, as well as all the other tutorials, has been written as a jupyter notebook.\n",
- "If you're reading it online, you can either keep reading, or clone the repository and go to `docs/tutorials` to explore them in a more interactive way!\n",
- "\n",
- "
"
- ]
- },
{
"cell_type": "markdown",
"id": "f8123bc58c173ac5",
"metadata": {},
"source": [
- "It is time to explore how to use `bartiq`'s resource estimation capabilities in practical quantum algorithm analysis. In this tutorial, we will:\n",
+ "In this tutorial, we will explore how to use `bartiq`'s resource estimation capabilities in practical quantum algorithm analysis. In this tutorial, we will:\n",
"\n",
"- Compare resources of different implementations of the same operation/unitary using `bartiq`.\n",
"- Transform your estimate to obtain more useful information about the problem.\n",
@@ -43,6 +30,22 @@
"In this tutorial we will see if we can make alias sampling use less resources by using a different implementation of USP. "
]
},
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "a589e2c2-dd54-4c84-bc75-4efccb624c07",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# NOTE\n",
+ "\n",
+ "# This tutorial is a a jupyter notebook.\n",
+ "# Click the \"Open in Collab\" button to view an interactive version of the tutorial.\n",
+ "\n",
+ "# Install dependencies for this notebook . Run once per session.\n",
+ "%pip install -q \"bartiq[optimization,interactive,jupyter]\" qref graphviz matplotlib sympy\n"
+ ]
+ },
{
"cell_type": "markdown",
"id": "ce7328a61a38dd67",
diff --git a/docs/tutorials/04_rewriters.ipynb b/docs/tutorials/04_rewriters.ipynb
index 1ef2eb2d..c1d05f91 100644
--- a/docs/tutorials/04_rewriters.ipynb
+++ b/docs/tutorials/04_rewriters.ipynb
@@ -14,25 +14,28 @@
},
{
"cell_type": "code",
- "execution_count": 1,
- "id": "5db5109d",
+ "execution_count": null,
+ "id": "a9a062d6-53a5-407a-8d75-e8e19fcdde67",
"metadata": {},
"outputs": [],
"source": [
- "from bartiq.analysis import sympy_rewriter"
+ "# NOTE\n",
+ "\n",
+ "# This tutorial is a a jupyter notebook.\n",
+ "# Click the \"Open in Collab\" button to view an interactive version of the tutorial.\n",
+ "\n",
+ "# Install dependencies for this notebook . Run once per session.\n",
+ "%pip install -q \"bartiq[optimization]\" pyyaml\n"
]
},
{
- "cell_type": "markdown",
- "id": "8a723024",
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "5db5109d",
"metadata": {},
+ "outputs": [],
"source": [
- "
NOTE:
\n",
- "\n",
- "This tutorial, as well as all the other tutorials, has been written as a jupyter notebook.\n",
- "If you're reading it online, you can either keep reading, or go to `docs/tutorials` to explore them in a more interactive way!\n",
- "\n",
- "
"
+ "from bartiq.analysis import sympy_rewriter"
]
},
{
diff --git a/docs/tutorials/2025_ieee_qw/01_intro_to_bartiq.ipynb b/docs/tutorials/2025_ieee_qw/01_intro_to_bartiq.ipynb
index af610089..263ba7a7 100644
--- a/docs/tutorials/2025_ieee_qw/01_intro_to_bartiq.ipynb
+++ b/docs/tutorials/2025_ieee_qw/01_intro_to_bartiq.ipynb
@@ -23,6 +23,22 @@
"- Brendan Reid"
]
},
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "03734fc5-dc18-471a-8183-7cc8836f271e",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# NOTE\n",
+ "\n",
+ "# This tutorial is a a jupyter notebook.\n",
+ "# Click the \"Open in Collab\" button to view an interactive version of the tutorial.\n",
+ "\n",
+ "# Install dependencies for this notebook . Run once per session.\n",
+ "%pip install -q \"bartiq[optimization,interactive,jupyter]\" qref pyyaml graphviz\n"
+ ]
+ },
{
"cell_type": "markdown",
"id": "2bb1306a",
diff --git a/docs/tutorials/2025_ieee_qw/02_algorithmic_intro.ipynb b/docs/tutorials/2025_ieee_qw/02_algorithmic_intro.ipynb
index f81ee2d6..682d14ae 100644
--- a/docs/tutorials/2025_ieee_qw/02_algorithmic_intro.ipynb
+++ b/docs/tutorials/2025_ieee_qw/02_algorithmic_intro.ipynb
@@ -10,6 +10,22 @@
"In this set of tutorials we'll be using some concepts you might not be familiar with. Understanding them is not crucial for following the rest of the tutorial, but having a high-level overview might be helfpul."
]
},
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "e2c5c5d4-77a0-458e-84fd-7a7eddcca869",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# NOTE\n",
+ "\n",
+ "# This tutorial is a a jupyter notebook.\n",
+ "# Click the \"Open in Collab\" button to view an interactive version of the tutorial.\n",
+ "\n",
+ "# Install dependencies for this notebook . Run once per session.\n",
+ "%pip install -q \"bartiq[optimization,interactive,jupyter]\" qref pyyaml graphviz\n"
+ ]
+ },
{
"cell_type": "markdown",
"id": "cbe0bf1e",
diff --git a/docs/tutorials/2025_ieee_qw/03_bottleneck_analysis.ipynb b/docs/tutorials/2025_ieee_qw/03_bottleneck_analysis.ipynb
index b42290f9..bff022ac 100644
--- a/docs/tutorials/2025_ieee_qw/03_bottleneck_analysis.ipynb
+++ b/docs/tutorials/2025_ieee_qw/03_bottleneck_analysis.ipynb
@@ -14,6 +14,22 @@
"Bottleneck analysis is easiest with numeric routines, as comparing symbolic expressions can be tricky. Here, we load in the Double Factorization routine and evaluate it for a given physical system."
]
},
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "cf10c94f-8496-4e09-b1d3-fc3392b5ddc5",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# NOTE\n",
+ "\n",
+ "# This tutorial is a a jupyter notebook.\n",
+ "# Click the \"Open in Collab\" button to view an interactive version of the tutorial.\n",
+ "\n",
+ "# Install dependencies for this notebook . Run once per session.\n",
+ "%pip install -q \"bartiq[optimization]\" pyyaml\n"
+ ]
+ },
{
"cell_type": "code",
"execution_count": 1,
diff --git a/docs/tutorials/2025_ieee_qw/04_rewriters.ipynb b/docs/tutorials/2025_ieee_qw/04_rewriters.ipynb
index 35c72a58..c86035d5 100644
--- a/docs/tutorials/2025_ieee_qw/04_rewriters.ipynb
+++ b/docs/tutorials/2025_ieee_qw/04_rewriters.ipynb
@@ -12,6 +12,22 @@
"`bartiq` includes a set of utilities for manipulating symbolic expressions – rewriting them to make them simpler and easier to analyze. They're known as **rewriters**. This functionality is contained in the analysis submodule, and backend-specific rewriters can be imported directly."
]
},
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "924a6e3d-890c-4844-9f6c-72d9787a3192",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# NOTE\n",
+ "\n",
+ "# This tutorial is a a jupyter notebook.\n",
+ "# Click the \"Open in Collab\" button to view an interactive version of the tutorial.\n",
+ "\n",
+ "# Install dependencies for this notebook . Run once per session.\n",
+ "%pip install -q \"bartiq[optimization]\" pyyaml\n"
+ ]
+ },
{
"cell_type": "code",
"execution_count": null,
diff --git a/docs/tutorials/2025_ieee_qw/05_hyperparameter_optimization.ipynb b/docs/tutorials/2025_ieee_qw/05_hyperparameter_optimization.ipynb
index a10d4c84..8a952a58 100644
--- a/docs/tutorials/2025_ieee_qw/05_hyperparameter_optimization.ipynb
+++ b/docs/tutorials/2025_ieee_qw/05_hyperparameter_optimization.ipynb
@@ -12,6 +12,22 @@
"We will start by loading a QREF file with an already compiled double factorization routine, and examine its input parameters."
]
},
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "7b1d946e-7a28-4aae-8b58-11f63010c8a6",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# NOTE\n",
+ "\n",
+ "# This tutorial is a a jupyter notebook.\n",
+ "# Click the \"Open in Collab\" button to view an interactive version of the tutorial.\n",
+ "\n",
+ "# Install dependencies for this notebook . Run once per session.\n",
+ "%pip install -q \"bartiq[optimization,interactive,jupyter]\" pyyaml matplotlib sympy\n"
+ ]
+ },
{
"cell_type": "code",
"execution_count": 1,
diff --git a/mkdocs.yml b/mkdocs.yml
index 48ed99db..1a849c36 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -9,6 +9,7 @@ edit_uri: edit/main/docs/
theme:
name: material
+ custom_dir: overrides
logo: assets/logo_white.png
palette:
primary: custom
@@ -100,3 +101,5 @@ extra_javascript:
extra:
version:
provider: mike
+ # Default branch for "Open in Colab" GitHub URLs (keep aligned with the branch that hosts these docs).
+ colab_branch: main
diff --git a/overrides/partials/header.html b/overrides/partials/header.html
new file mode 100644
index 00000000..33b508bb
--- /dev/null
+++ b/overrides/partials/header.html
@@ -0,0 +1,77 @@
+{#-
+ Extends Material header: Open in Colab in top-right on .ipynb pages (upstream:
+ mkdocs-material templates/partials/header.html).
+-#}
+{% set class = "md-header" %}
+{% if "navigation.tabs.sticky" in features %}
+ {% set class = class ~ " md-header--shadow md-header--lifted" %}
+{% elif "navigation.tabs" not in features %}
+ {% set class = class ~ " md-header--shadow" %}
+{% endif %}
+
+
+ {% if "navigation.tabs.sticky" in features %}
+ {% if "navigation.tabs" in features %}
+ {% include "partials/tabs.html" %}
+ {% endif %}
+ {% endif %}
+
diff --git a/overrides/partials/nav.html b/overrides/partials/nav.html
new file mode 100644
index 00000000..176d148a
--- /dev/null
+++ b/overrides/partials/nav.html
@@ -0,0 +1,26 @@
+{#-
+ Material nav without header-style GitHub repo link (md-nav__source).
+ Upstream: mkdocs-material templates/partials/nav.html
+-#}
+{% import "partials/nav-item.html" as item with context %}
+{% set class = "md-nav md-nav--primary" %}
+{% if "navigation.tabs" in features %}
+ {% set class = class ~ " md-nav--lifted" %}
+{% endif %}
+{% if "toc.integrate" in features %}
+ {% set class = class ~ " md-nav--integrated" %}
+{% endif %}
+