Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
994 changes: 849 additions & 145 deletions algorithms/qml/qsvm/qsvm.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion algorithms/qml/qsvm/qsvm.metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"friendly_name": "QSVM: Bloch Sphere Kernel",
"description": "QSVM Algorithm (with Bloch Sphere Kernel)",
"description": "QSVM Algorithm (with Bloch Sphere and Pauli feature Kernels)",
"level": ["demos"],
"problem_domain_tags": ["machine learning"],
"qmod_type": ["algorithms"],
Expand Down
16 changes: 0 additions & 16 deletions algorithms/qml/qsvm/qsvm.qmod

This file was deleted.

43 changes: 0 additions & 43 deletions algorithms/qml/qsvm/qsvm.synthesis_options.json

This file was deleted.

599 changes: 0 additions & 599 deletions algorithms/qml/qsvm_pauli_feature_map/qsvm_pauli_feature_map.ipynb

This file was deleted.

This file was deleted.

15 changes: 9 additions & 6 deletions tests/notebooks/test_qsvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,23 @@
from testbook.client import TestbookNotebookClient


@wrap_testbook("qsvm", timeout_seconds=204)
@wrap_testbook("qsvm", timeout_seconds=270)
def test_notebook(tb: TestbookNotebookClient) -> None:
"""
A notebook for a hybrid classical quantum neural network.
The test verifies that the pre-trained model is indeed well trained.
"""
# test models
validate_quantum_model(tb.ref("QSVM_BLOCH_SHPERE_qmod"))
# test quantum programs
validate_quantum_program_size(
tb.ref_pydantic("qprog"),
tb.ref_pydantic("qprog_bloch"),
expected_width=1, # actual width: 1
expected_depth=10, # actual depth: 4
)

validate_quantum_program_size(
tb.ref_pydantic("qprog_pauli"),
expected_width=4, # actual width: 2
expected_depth=50, # actual depth: 30
)
# test notebook content
assert tb.ref("test_score") == 1
assert tb.ref("test_score") >= 0.98
assert tb.ref("test_score_pauli") >= 0.98
30 changes: 0 additions & 30 deletions tests/notebooks/test_qsvm_pauli_feature_map.py

This file was deleted.