Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
fdbddd1
-included tutorial notebook with Figure, modified bug in kyriienko en…
RobertoFlorez Dec 10, 2024
66dfce8
fixed typos
RobertoFlorez Dec 10, 2024
845a38b
formatted with black
RobertoFlorez Dec 10, 2024
be6ef6f
typo in example_qnn_ode_solver.nblink
RobertoFlorez Dec 10, 2024
62a7faf
changed bibliography in tutorial example
RobertoFlorez Dec 10, 2024
527bde0
included example_qnn_ode_solver in the .rst file
RobertoFlorez Dec 10, 2024
7cd2dea
removing possibly problematic paragraph
RobertoFlorez Dec 10, 2024
737a2cc
creating a dummy to test error
RobertoFlorez Dec 10, 2024
6ce0f4d
removing from examples_index all changes
RobertoFlorez Dec 10, 2024
6ead68e
removed almost all modifications to see if doc_checks were working pr…
RobertoFlorez Dec 10, 2024
3a689be
Merge branch 'develop' of https://github.com/sQUlearn/squlearn into O…
RobertoFlorez Dec 18, 2024
aacaf49
removed bm, included more x0 info, included .nbink and pyproject back
RobertoFlorez Dec 18, 2024
5e637b9
included examples index , black and removed some text to test
RobertoFlorez Dec 18, 2024
22e92f3
included back text formatting for notebook
RobertoFlorez Dec 18, 2024
f595c77
changed begin equation for $$, and removed ´
RobertoFlorez Dec 18, 2024
76b43bf
changed labeling and using begin equation
RobertoFlorez Dec 18, 2024
93164b1
used black again
RobertoFlorez Dec 18, 2024
0c19e05
removed extra space for proper sphinx
RobertoFlorez Dec 18, 2024
df79aee
cleaning
David-Kreplin Dec 19, 2024
0ae34f1
Merge branch 'develop' into ODE_QNN_regressor_tutorial_develop
David-Kreplin Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/examples/example_qnn_ode_solver.nblink
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"path": "../../examples/tutorials/qnn_ode_solver.ipynb",
"extra-media": [
"../../examples/tutorials/images"
]
}
3 changes: 2 additions & 1 deletion docs/examples/examples_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ Examples
example_kernel_digit_classification
example_kernel_grid_search
example_quantum_bayesian_optimization
example_qnn_backend_mitigation
example_qnn_backend_mitigation
example_qnn_ode_solver
Binary file added examples/tutorials/images/QNN_ode_workflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
302 changes: 302 additions & 0 deletions examples/tutorials/qnn_ode_solver.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/tutorials/quantum_bayesian_optimization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The follwing example will adapt the structre of the examples made in [scikit-optimize](https://scikit-optimize.github.io/stable/auto_examples/bayesian-optimization.html).\n",
"The follwing example will adapt the structure of the examples made in [scikit-optimize](https://scikit-optimize.github.io/stable/auto_examples/bayesian-optimization.html).\n",
"\n",
"We start by defining the Bayesian optimization base class."
]
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,5 @@ extension-pkg-allow-list = [
addopts = [
"--import-mode=importlib",
"--ignore=examples/tutorials/qnn_backend_mitigation.ipynb",
"--ignore=examples/tutorials/qnn_ode_solver.ipynb",
]
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ def variational_gate_block(
)
QC.add_layer(layer, num_layers=self.num_encoding_layers)

QC = QC.get_circuit(features, [])
elif self.encoding_style in ("chebyshev_tower", "chebyshev_sparse"):
QC = QuantumCircuit(self.num_qubits)
for layer in range(self.num_encoding_layers):
Expand All @@ -223,7 +224,9 @@ def variational_gate_block(
QC = variational_gate_block(QC, self.num_variational_layers, self.num_qubits)[0]
elif self.variational_arrangement == "ABA":
if self.num_qubits % self.block_width != 0:
raise ValueError("Block width must be a divisor of the number of qubits.")
raise ValueError(
f"block_width = {self.block_width} must be a divisor of the num_qubits = {self.num_qubits}."
)

number_of_blocks = int(np.ceil(self.num_qubits / self.block_width)) # vertical blocks
shifting_factor = np.floor(self.block_width / 2)
Expand Down