MCPcopy Index your code
hub / github.com/CERN-QTI/QuASK

github.com/CERN-QTI/QuASK @v1.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.1 ↗ · + Follow
109 symbols 262 edges 17 files 90 documented · 83%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

QuASK Made at CERN! Made at CERN! Made at CERN!

Quantum Advantage Seeker with Kernel

QuASK is a quantum machine learning software written in Python that supports researchers in designing, experimenting, and assessing different quantum and classic kernels performance. This software is package agnostic and can be integrated with all major quantum software packages (e.g. IBM Qiskit, Xanadu’s Pennylane, Amazon Braket).

QuASK guides the user through a simple preprocessing of input data, definition and calculation of quantum and classic kernels, either custom or pre-defined ones. From this evaluation the package provide an assessment about potential quantum advantage and prediction bounds on generalization error.

Beyond theoretical framing, it allows for the generation of parametric quantum kernels that can be trained using gradient-descent-based optimization, grid search, or genetic algorithms. Projected quantum kernels, an effective solution to mitigate the curse of dimensionality induced by the exponential scaling dimension of large Hilbert spaces, is also calculated. QuASK can also generate the observable values of a quantum model and use them to study the prediction capabilities of the quantum and classical kernels.

The initial release is accompanied by the journal article "QuASK - Quantum Advantage Seeker with Kernels" available on arxiv.org.

Documentation

The documentation for QuASK can be accessed on the website Read The Docs.

Installation

The software has been tested on Python 3.9.10. We recommend using this version or a newer one.

The library is available on the Python Package Index (PyPI) with pip install quask.

Usage

Use quask as a library of software components

QuASK can be used as a library to extend your own software. Check if everything's working with:

import numpy as np
import quask.metrics
A = np.array([[1,2], [3,4]])
B = np.array([[5,6], [7,8]])
print(quask.metrics.calculate_frobenius_inner_product(A, B))  # 70

Use quask as a command-line interface tool

QuASK can be used as a command-line interface to analyze the dataset with the kernel methods. These are the commands implemented so far.

To retrieve the datasets available:

$ python3.9 -m quask get-dataset

To preprocess a dataset:

$ python3.9 -m quask preprocess-dataset

To analyze a dataset using quantum and classical kernels:

$ python3.9 -m quask apply-kernel

To create some plot of the property related to the generated Gram matrices:

$ python3.9 -m quask plot-metric --metric accuracy --train-gram training_linear_kernel.npy --train-y Y_train.npy --test-gram testing_linear_kernel.npy --test-y Y_test.npy --label linear

Credits

Please cite the work using the following Bibtex entry:

@article{dimarcantonio2023quantum,
  title={Quantum Advantage Seeker with Kernels (QuASK): a software framework to speed up the research in quantum machine learning},
  author={Di Marcantonio, Francesco and Incudini, Massimiliano and Tezza, Davide and Grossi, Michele},
  journal={Quantum Machine Intelligence},
  volume={5},
  number={1},
  pages={20},
  year={2023},
  publisher={Springer}
}

Core symbols most depended-on inside this repo

register
called by 7
src/quask/datasets.py
register
called by 7
src/quask/kernels.py
download_dataset_openml
called by 4
src/quask/datasets.py
calculate_model_complexity
called by 3
src/quask/metrics.py
get_dataset_quantum
called by 3
src/quask/datasets.py
combinatorial_kernel
called by 3
src/quask/techniques/combinatorial_kernel_greedy.py
CombinatorialFeatureMap
called by 3
src/quask/techniques/combinatorial_kernel.py
combinatorial_kernel
called by 3
src/quask/techniques/combinatorial_kernel.py

Shape

Method 60
Function 40
Class 8
Route 1

Languages

Python100%

Modules by API surface

src/quask/template_pennylane.py16 symbols
src/quask/techniques/trainable_kernel.py12 symbols
src/quask/techniques/combinatorial_kernel_greedy.py11 symbols
src/quask/techniques/combinatorial_kernel_simanneal.py10 symbols
src/quask/metrics.py9 symbols
src/quask/datasets.py9 symbols
src/quask/techniques/scrambled_kernel.py8 symbols
src/quask/techniques/random_kernel.py8 symbols
src/quask/techniques/combinatorial_kernel_genetic.py8 symbols
src/quask/techniques/combinatorial_kernel.py7 symbols
src/quask/__main__.py6 symbols
src/quask/kernels.py5 symbols

For agents

$ claude mcp add QuASK \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact