lazyqml 3.1.1__tar.gz → 3.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. {lazyqml-3.1.1 → lazyqml-3.2.1}/PKG-INFO +6 -6
  2. lazyqml-3.2.1/README.md +91 -0
  3. lazyqml-3.2.1/docs/api.md +90 -0
  4. lazyqml-3.1.1/README.md → lazyqml-3.2.1/docs/index.md +4 -4
  5. lazyqml-3.2.1/docs/lazyqml.md +154 -0
  6. lazyqml-3.2.1/docs/usage.md +19 -0
  7. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Dispatchers/Dispatcher.py +4 -1
  8. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/__init__.py +1 -1
  9. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml.egg-info/PKG-INFO +6 -6
  10. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml.egg-info/SOURCES.txt +1 -0
  11. {lazyqml-3.1.1 → lazyqml-3.2.1}/mkdocs.yml +8 -7
  12. {lazyqml-3.1.1 → lazyqml-3.2.1}/pyproject.toml +2 -2
  13. lazyqml-3.1.1/docs/index.md +0 -16
  14. lazyqml-3.1.1/docs/lazyqml.md +0 -0
  15. lazyqml-3.1.1/docs/usage.md +0 -25
  16. {lazyqml-3.1.1 → lazyqml-3.2.1}/.editorconfig +0 -0
  17. {lazyqml-3.1.1 → lazyqml-3.2.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  18. {lazyqml-3.1.1 → lazyqml-3.2.1}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  19. {lazyqml-3.1.1 → lazyqml-3.2.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  20. {lazyqml-3.1.1 → lazyqml-3.2.1}/.github/workflows/docs-build.yml +0 -0
  21. {lazyqml-3.1.1 → lazyqml-3.2.1}/.github/workflows/docs.yml +0 -0
  22. {lazyqml-3.1.1 → lazyqml-3.2.1}/.github/workflows/installation.yml +0 -0
  23. {lazyqml-3.1.1 → lazyqml-3.2.1}/.github/workflows/pypi.yml +0 -0
  24. {lazyqml-3.1.1 → lazyqml-3.2.1}/.github/workflows/ubuntu.yml +0 -0
  25. {lazyqml-3.1.1 → lazyqml-3.2.1}/.gitignore +0 -0
  26. {lazyqml-3.1.1 → lazyqml-3.2.1}/AUTHORS.rst +0 -0
  27. {lazyqml-3.1.1 → lazyqml-3.2.1}/LICENSE +0 -0
  28. {lazyqml-3.1.1 → lazyqml-3.2.1}/LICENSE copy +0 -0
  29. {lazyqml-3.1.1 → lazyqml-3.2.1}/MANIFEST.in +0 -0
  30. {lazyqml-3.1.1 → lazyqml-3.2.1}/docs/authors.rst +0 -0
  31. {lazyqml-3.1.1 → lazyqml-3.2.1}/docs/changelog.md +0 -0
  32. {lazyqml-3.1.1 → lazyqml-3.2.1}/docs/common.md +0 -0
  33. {lazyqml-3.1.1 → lazyqml-3.2.1}/docs/contributing.md +0 -0
  34. {lazyqml-3.1.1 → lazyqml-3.2.1}/docs/examples/intro.ipynb +0 -0
  35. {lazyqml-3.1.1 → lazyqml-3.2.1}/docs/faq.md +0 -0
  36. {lazyqml-3.1.1 → lazyqml-3.2.1}/docs/installation.md +0 -0
  37. {lazyqml-3.1.1 → lazyqml-3.2.1}/docs/logo.jpg +0 -0
  38. {lazyqml-3.1.1 → lazyqml-3.2.1}/docs/overrides/main.html +0 -0
  39. {lazyqml-3.1.1 → lazyqml-3.2.1}/experimentallibs.txt +0 -0
  40. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Circuits/AmplitudeEmbedding.py +0 -0
  41. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Circuits/HCzRx.py +0 -0
  42. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Circuits/HardwareEfficient.py +0 -0
  43. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Circuits/RxEmbedding.py +0 -0
  44. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Circuits/RyEmbedding.py +0 -0
  45. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Circuits/RzEmbedding.py +0 -0
  46. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Circuits/TreeTensor.py +0 -0
  47. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Circuits/TwoLocal.py +0 -0
  48. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Circuits/ZzEmbedding.py +0 -0
  49. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Circuits/fCircuits.py +0 -0
  50. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Models/Hybrid.py +0 -0
  51. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Models/QNNBag.py +0 -0
  52. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Models/QNNTorch.py +0 -0
  53. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Models/QSVM.py +0 -0
  54. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Models/_QNNPennylane.py +0 -0
  55. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Models/fModels.py +0 -0
  56. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Preprocessing/Pca.py +0 -0
  57. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Preprocessing/Sanitizer.py +0 -0
  58. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Preprocessing/__init__.py +0 -0
  59. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/Preprocessing/fPreprocessing.py +0 -0
  60. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Factories/__init__.py +0 -0
  61. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Global/globalEnums.py +0 -0
  62. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Interfaces/__init__.py +0 -0
  63. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Interfaces/iAnsatz.py +0 -0
  64. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Interfaces/iCircuit.py +0 -0
  65. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Interfaces/iModel.py +0 -0
  66. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Interfaces/iPreprocessing.py +0 -0
  67. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Utils/Utils.py +0 -0
  68. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/Utils/Validator.py +0 -0
  69. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml/lazyqml.py +0 -0
  70. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml.egg-info/dependency_links.txt +0 -0
  71. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml.egg-info/entry_points.txt +0 -0
  72. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml.egg-info/requires.txt +0 -0
  73. {lazyqml-3.1.1 → lazyqml-3.2.1}/lazyqml.egg-info/top_level.txt +0 -0
  74. {lazyqml-3.1.1 → lazyqml-3.2.1}/requirements.txt +0 -0
  75. {lazyqml-3.1.1 → lazyqml-3.2.1}/requirements_dev.txt +0 -0
  76. {lazyqml-3.1.1 → lazyqml-3.2.1}/setup.cfg +0 -0
  77. {lazyqml-3.1.1 → lazyqml-3.2.1}/tests/__init__.py +0 -0
  78. {lazyqml-3.1.1 → lazyqml-3.2.1}/tests/test_lazyqml.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: lazyqml
3
- Version: 3.1.1
3
+ Version: 3.2.1
4
4
  Summary: LazyQML benchmarking utility to test quantum machine learning models.
5
5
  Author-email: QHPC Group <qhpcgroup@gmail.com>
6
6
  License: MIT License
@@ -37,7 +37,7 @@ Requires-Dist: lazyqml[extra]; extra == "all"
37
37
  Provides-Extra: extra
38
38
  Requires-Dist: pandas; extra == "extra"
39
39
 
40
- ![logo](https://github.com/QHPC-SP-Research-Lab/LazyQML/blob/main/docs/logo.jpg)
40
+ ![LazyQML](./docs/logo.jpg)
41
41
  ---
42
42
  [![Pypi](https://img.shields.io/badge/pypi-%23ececec.svg?style=for-the-badge&logo=pypi&logoColor=1f73b7)](https://pypi.python.org/pypi/lazyqml)
43
43
  ![GitHub Actions](https://img.shields.io/badge/github%20actions-%232671E5.svg?style=for-the-badge&logo=githubactions&logoColor=white)
@@ -68,15 +68,15 @@ With LazyQML, you can:
68
68
  - Flexible & Modular: From basic quantum circuits to hybrid quantum-classical models—LazyQML has you covered.
69
69
 
70
70
  ## Documentation
71
- For detailed usage instructions, API reference, and code examples, please refer to the official LazyQML documentation.
71
+ For detailed usage instructions, API reference, and code examples, please refer to the official LazyQML [documentation](https://qhpc-sp-research-lab.github.io/LazyQML/).
72
72
 
73
73
  ## Requirements
74
74
 
75
75
  - Python >= 3.10
76
76
 
77
- > [!CAUTION]
77
+ > ❗❗
78
78
  > This library is only supported by Linux Systems. It doesn't support Windows nor MacOS.
79
-
79
+ > Only supports CUDA compatible devices.
80
80
 
81
81
  ## Installation
82
82
  To install lazyqml, run this command in your terminal:
@@ -0,0 +1,91 @@
1
+ ![LazyQML](./docs/logo.jpg)
2
+ ---
3
+ [![Pypi](https://img.shields.io/badge/pypi-%23ececec.svg?style=for-the-badge&logo=pypi&logoColor=1f73b7)](https://pypi.python.org/pypi/lazyqml)
4
+ ![GitHub Actions](https://img.shields.io/badge/github%20actions-%232671E5.svg?style=for-the-badge&logo=githubactions&logoColor=white)
5
+ ![NumPy](https://img.shields.io/badge/numpy-%23013243.svg?style=for-the-badge&logo=numpy&logoColor=white)
6
+ ![Pandas](https://img.shields.io/badge/pandas-%23150458.svg?style=for-the-badge&logo=pandas&logoColor=white)
7
+ ![PyTorch](https://img.shields.io/badge/PyTorch-%23EE4C2C.svg?style=for-the-badge&logo=PyTorch&logoColor=white)
8
+ ![scikit-learn](https://img.shields.io/badge/scikit--learn-%23F7931E.svg?style=for-the-badge&logo=scikit-learn&logoColor=white)
9
+ ![nVIDIA](https://img.shields.io/badge/cuda-000000.svg?style=for-the-badge&logo=nVIDIA&logoColor=green)
10
+ ![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black)
11
+
12
+
13
+
14
+ LazyQML is a Python library designed to streamline, automate, and accelerate experimentation with Quantum Machine Learning (QML) architectures, right on classical computers.
15
+
16
+ With LazyQML, you can:
17
+ - 🛠️ Build, test, and benchmark QML models with minimal effort.
18
+
19
+ - ⚡ Compare different QML architectures, hyperparameters seamlessly.
20
+
21
+ - 🧠 Gather knowledge about the most suitable architecture for your problem.
22
+
23
+ ## ✨ Why LazyQML?
24
+
25
+ - Rapid Prototyping: Experiment with different QML models using just a few lines of code.
26
+
27
+ - Automated Benchmarking: Evaluate performance and trade-offs across architectures effortlessly.
28
+
29
+ - Flexible & Modular: From basic quantum circuits to hybrid quantum-classical models—LazyQML has you covered.
30
+
31
+ ## Documentation
32
+ For detailed usage instructions, API reference, and code examples, please refer to the official LazyQML [documentation](https://qhpc-sp-research-lab.github.io/LazyQML/).
33
+
34
+ ## Requirements
35
+
36
+ - Python >= 3.10
37
+
38
+ > ❗❗
39
+ > This library is only supported by Linux Systems. It doesn't support Windows nor MacOS.
40
+ > Only supports CUDA compatible devices.
41
+
42
+ ## Installation
43
+ To install lazyqml, run this command in your terminal:
44
+
45
+ ```
46
+ pip install lazyqml
47
+ ```
48
+
49
+ This is the preferred method to install lazyqml, as it will always install the most recent stable release.
50
+
51
+ If you don't have [pip](https://pip.pypa.io) installed, this [Python installation guide](http://docs.python-guide.org/en/latest/starting/installation/) can guide you through the process.
52
+
53
+ ### From sources
54
+
55
+ To install lazyqml from sources, run this command in your terminal:
56
+
57
+ ```
58
+ pip install git+https://github.com/QHPC-SP-Research-Lab/LazyQML
59
+ ```
60
+ ## Example
61
+
62
+ ```python
63
+ from sklearn.datasets import load_iris
64
+ from lazyqml.lazyqml import *
65
+
66
+ # Load data
67
+ data = load_iris()
68
+ X = data.data
69
+ y = data.target
70
+
71
+ classifier = QuantumClassifier(nqubits={4}, classifiers={Model.QNN, Model.QSVM}, epochs=10)
72
+
73
+ # Fit and predict
74
+ classifier.fit(X=X, y=y, test_size=0.4)
75
+ ```
76
+
77
+ ## Quantum and High Performance Computing (QHPC) - University of Oviedo
78
+ - José Ranilla Pastor - ranilla@uniovi.es
79
+ - Elías Fernández Combarro - efernandezca@uniovi.es
80
+ - Diego García Vega - diegogarciavega@gmail.com
81
+ - Fernando Álvaro Plou Llorente - ploufernando@uniovi.es
82
+ - Alejandro Leal Castaño - lealcalejandro@uniovi.es
83
+ - Group - https://qhpc.uniovi.es
84
+
85
+ ## Citing
86
+ If you used LazyQML in your work, please cite:
87
+ - García-Vega, D., Plou Llorente, F., Leal Castaño, A., Combarro, E.F., Ranilla, J.: Lazyqml: A python library to benchmark quantum machine learning models. In: 30th European Conference on Parallel and Distributed Processing (2024)
88
+
89
+ ## License
90
+ - Free software: MIT License
91
+
@@ -0,0 +1,90 @@
1
+ Certainly! Here's the complete markdown code with a bit of flair to make the documentation more engaging, all ready for you to copy and use:
2
+
3
+
4
+ # LazyQML API Overview
5
+
6
+ Welcome to **LazyQML** – your quantum machine learning playground! LazyQML is a cutting-edge Python library designed to simplify the integration of quantum classifiers into your machine learning workflows. With LazyQML, you'll be able to explore quantum neural networks, quantum support vector machines, and other quantum models, all while maintaining a simple and easy to use code.
7
+
8
+ At the heart of LazyQML is the **QuantumClassifier** – the Swiss Army knife of quantum machine learning. This easy-to-use class empowers you to train, evaluate, and fine-tune quantum classifiers on your data, whether you're a beginner or a seasoned quantum enthusiast.
9
+
10
+ ## Key Features
11
+
12
+ LazyQML is packed with tools to streamline quantum classification. Below are the core features that set it apart from the crowd:
13
+
14
+ ### 1. **QuantumClassifier: The Heart of LazyQML**
15
+
16
+ The **QuantumClassifier** class is the core of LazyQML, offering a variety of methods for training and evaluating quantum models. It provides an elegant and flexible interface for working with quantum circuits, allowing you to explore different types of classifiers, embeddings, and ansatz circuits. The goal? To make quantum classification as intuitive as possible.
17
+
18
+ ### 2. **Variants of QuantumClassifier**
19
+
20
+ LazyQML provides **two exciting variants** of the **QuantumClassifier**, depending on which module you import. This gives you the freedom to choose the right quantum simulation backend for your specific needs:
21
+
22
+ - **State Vector Simulation** (imported from `lazyqml.st`): This variant simulates the full quantum state of your system, perfect for smaller systems or when you want a more intuitive understanding of quantum behavior.
23
+
24
+ - **Tensor Networks** (imported from `lazyqml.tn`): This variant uses tensor networks, providing higher scalability for larger quantum systems. It's optimized for more complex and larger datasets, helping you tackle big problems with ease.
25
+
26
+ #### Importing State Vector Simulation Variant:
27
+ ```python
28
+ from lazyqml.st import *
29
+ ```
30
+
31
+ - Use this import to access the **QuantumClassifier** based on **State Vector simulations**, simulating the full quantum state for an intuitive understanding.
32
+
33
+ #### Importing Tensor Network Variant:
34
+ ```python
35
+ from lazyqml.tn import *
36
+ ```
37
+ - Use this import to access the **QuantumClassifier** based on **Tensor Networks**, offering efficient simulation of larger quantum systems using approximate methods.
38
+
39
+ ### 3. **Training and Evaluation Methods**
40
+
41
+ LazyQML offers you three robust methods to train and evaluate your quantum models. These methods are designed to give you complete control over the classification process:
42
+
43
+ #### **fit**
44
+ The **fit** method is where the magic happens. 🌟 It trains your quantum model on your dataset, selecting from different quantum classifiers, embeddings, and ansatz circuits. This method provides a simple interface to quickly train a model, view its results, and get on with your quantum journey.
45
+
46
+ - **When to use it?** Use **fit** when you want to quickly train and evaluate a quantum model with just a few lines of code.
47
+
48
+ #### **leave_one_out**
49
+ **Leave-One-Out Cross Validation (LOO CV)** is a robust technique where each data point is used as the test set exactly once. This method is fantastic for small datasets, providing a deeper understanding of your model’s performance.
50
+
51
+ - **When to use it?** Choose **leave_one_out** when working with small datasets and you need to evaluate every data point for a thorough assessment.
52
+
53
+ #### **repeated_cross_validation**
54
+ This method performs repeated k-fold cross-validation. It divides your dataset into k subsets, trains the model on k-1 subsets, and tests on the remaining fold. This process is repeated multiple times to provide a more accurate estimate of your model's performance.
55
+
56
+ - **When to use it?** Use **repeated_cross_validation** for a more comprehensive evaluation of your model, especially when working with larger datasets.
57
+
58
+ ### 4. **Enums for Quantum Model Selection**
59
+
60
+ LazyQML gives you full control over your quantum model's architecture. With a rich set of enums, you can easily select the correct ansatz circuits, embedding strategies, and classification models. 🎯
61
+
62
+ #### **Ansatzs Enum**
63
+ Ansatz circuits define the structure of your quantum model. LazyQML provides a selection of ansatz types:
64
+
65
+ - `ALL`: All available ansatz circuits.
66
+ - `HCZRX`, `TREE_TENSOR`, `TWO_LOCAL`, `HARDWARE_EFFICIENT`: Popular ansatz circuits that are ideal for quantum machine learning.
67
+
68
+ #### **Embedding Enum**
69
+ Embeddings control how your classical data is encoded onto quantum states. LazyQML offers several types of embedding strategies:
70
+
71
+ - `ALL`: All available embedding circuits.
72
+ - `RX`, `RY`, `RZ`: Common qubit rotation embeddings.
73
+ - `ZZ`, `AMP`: Embedding strategies based on entanglement or amplitude encoding.
74
+
75
+ #### **Model Enum**
76
+ LazyQML supports a variety of quantum models, each suited for different tasks. Choose the model that best fits your data and problem:
77
+
78
+ - `ALL`: All available quantum models.
79
+ - `QNN`: Quantum Neural Network.
80
+ - `QNN_BAG`: Quantum Neural Network with Bagging.
81
+ - `QSVM`: Quantum Support Vector Machine.
82
+ - `QKNN`: Quantum k-Nearest Neighbors.
83
+
84
+ ---
85
+
86
+ ## What's Next?
87
+
88
+ This overview introduces you to the powerful features of **LazyQML** and the **QuantumClassifier**. Whether you’re just getting started or you’re a quantum computing pro, LazyQML simplifies quantum machine learning. 🌐✨
89
+
90
+ For more detailed documentation on each function, parameter, and quantum algorithm, head over to the full documentation pages. Get ready to dive into the world of quantum classification with LazyQML – your quantum adventure begins here! 🛸
@@ -1,4 +1,4 @@
1
- ![logo](https://github.com/QHPC-SP-Research-Lab/LazyQML/blob/main/docs/logo.jpg)
1
+ ![LazyQML](./docs/logo.jpg)
2
2
  ---
3
3
  [![Pypi](https://img.shields.io/badge/pypi-%23ececec.svg?style=for-the-badge&logo=pypi&logoColor=1f73b7)](https://pypi.python.org/pypi/lazyqml)
4
4
  ![GitHub Actions](https://img.shields.io/badge/github%20actions-%232671E5.svg?style=for-the-badge&logo=githubactions&logoColor=white)
@@ -35,8 +35,9 @@ For detailed usage instructions, API reference, and code examples, please refer
35
35
 
36
36
  - Python >= 3.10
37
37
 
38
- > [!CAUTION]
38
+ > ❗❗
39
39
  > This library is only supported by Linux Systems. It doesn't support Windows nor MacOS.
40
+ > Only supports CUDA compatible devices.
40
41
 
41
42
 
42
43
  ## Installation
@@ -87,5 +88,4 @@ If you used LazyQML in your work, please cite:
87
88
  - García-Vega, D., Plou Llorente, F., Leal Castaño, A., Combarro, E.F., Ranilla, J.: Lazyqml: A python library to benchmark quantum machine learning models. In: 30th European Conference on Parallel and Distributed Processing (2024)
88
89
 
89
90
  ## License
90
- - Free software: MIT License
91
-
91
+ - Free software: MIT License
@@ -0,0 +1,154 @@
1
+ ## QuantumClassifier Parameters:
2
+ #### Core Parameters:
3
+ - **`nqubits`**: `Set[int]`
4
+ - Description: Set of qubit indices, where each value must be greater than 0.
5
+ - Validation: Ensures that all elements are integers > 0.
6
+
7
+ - **`randomstate`**: `int`
8
+ - Description: Seed value for random number generation.
9
+ - Default: `1234`
10
+
11
+ - **`predictions`**: `bool`
12
+ - Description: Flag to determine if predictions are enabled.
13
+ - Default: `False`
14
+
15
+ #### Model Structure Parameters:
16
+ - **`numPredictors`**: `int`
17
+ - Description: Number of predictors used in the QNN with bagging.
18
+ - Constraints: Must be greater than 0.
19
+ - Default: `10`
20
+
21
+ - **`numLayers`**: `int`
22
+ - Description: Number of layers in the Quantum Neural Networks.
23
+ - Constraints: Must be greater than 0.
24
+ - Default: `5`
25
+
26
+ #### Set-Based Configuration Parameters:
27
+ - **`classifiers`**: `Set[Model]`
28
+ - Description: Set of classifier models.
29
+ - Constraints: Must contain at least one classifier.
30
+ - Default: `{Model.ALL}`
31
+ - Options: `{Model.QNN, Model.QSVM, Model.QNN_BAG}`
32
+
33
+ - **`ansatzs`**: `Set[Ansatzs]`
34
+ - Description: Set of quantum ansatz configurations.
35
+ - Constraints: Must contain at least one ansatz.
36
+ - Default: `{Ansatzs.ALL}`
37
+ - Options: `{Ansatzs.RX, Ansatzs.RZ, Ansatzs.RY, Ansatzs.ZZ, Ansatzs.AMP}`
38
+
39
+ - **`embeddings`**: `Set[Embedding]`
40
+ - Description: Set of embedding strategies.
41
+ - Constraints: Must contain at least one embedding.
42
+ - Default: `{Embedding.ALL}`
43
+ - Options: `{Embedding.HCZRX, Embedding.TREE_TENSOR, Embedding.TWO_LOCAL, Embedding.HARDWARE_EFFICENT}`
44
+
45
+ - **`features`**: `Set[float]`
46
+ - Description: Set of feature values (must be between 0 and 1).
47
+ - Constraints: Values > 0 and <= 1.
48
+ - Default: `{0.3, 0.5, 0.8}`
49
+
50
+ #### Training Parameters:
51
+ - **`learningRate`**: `float`
52
+ - Description: Learning rate for optimization.
53
+ - Constraints: Must be greater than 0.
54
+ - Default: `0.01`
55
+
56
+ - **`epochs`**: `int`
57
+ - Description: Number of training epochs.
58
+ - Constraints: Must be greater than 0.
59
+ - Default: `100`
60
+
61
+ - **`batchSize`**: `int`
62
+ - Description: Size of each batch during training.
63
+ - Constraints: Must be greater than 0.
64
+ - Default: `8`
65
+
66
+ #### Threshold and Sampling:
67
+ - **`threshold`**: `int`
68
+ - Description: Decision threshold for parallelization, if the model is bigger than this threshold it will use GPU.
69
+ - Constraints: Must be greater than 0.
70
+ - Default: `22`
71
+
72
+ - **`maxSamples`**: `float`
73
+ - Description: Maximum proportion of samples to be used from the dataset characteristics.
74
+ - Constraints: Between 0 and 1.
75
+ - Default: `1.0`
76
+
77
+ #### Logging and Metrics:
78
+ - **`verbose`**: `bool`
79
+ - Description: Flag for detailed output during training.
80
+ - Default: `False`
81
+
82
+ - **`customMetric`**: `Optional[Callable]`
83
+ - Description: User-defined metric function for evaluation.
84
+ - Validation:
85
+ - Function must accept `y_true` and `y_pred` as the first two arguments.
86
+ - Must return a scalar value (int or float).
87
+ - Function execution is validated with dummy arguments.
88
+ - Default: `None`
89
+
90
+ #### Custom Preprocessors:
91
+ - **`customImputerNum`**: `Optional[Any]`
92
+ - Description: Custom numeric data imputer.
93
+ - Validation:
94
+ - Must be an object with `fit`, `transform`, and optionally `fit_transform` methods.
95
+ - Validated with dummy data.
96
+ - Default: `None`
97
+
98
+ - **`customImputerCat`**: `Optional[Any]`
99
+ - Description: Custom categorical data imputer.
100
+ - Validation:
101
+ - Must be an object with `fit`, `transform`, and optionally `fit_transform` methods.
102
+ - Validated with dummy data.
103
+ - Default: `None`
104
+
105
+ ## Functions:
106
+
107
+ ### **`fit`**
108
+ ```python
109
+ fit(self, X, y, test_size=0.4, showTable=True)
110
+ ```
111
+ Fits classification algorithms to `X` and `y` using a hold-out approach. Predicts and scores on a test set determined by `test_size`.
112
+
113
+ #### Parameters:
114
+ - **`X`**: Input features (DataFrame or compatible format).
115
+ - **`y`**: Target labels (must be numeric, e.g., via `LabelEncoder` or `OrdinalEncoder`).
116
+ - **`test_size`**: Proportion of the dataset to use as the test set. Default is `0.4`.
117
+ - **`showTable`**: Display a table with results. Default is `True`.
118
+
119
+ #### Behavior:
120
+ - Validates the compatibility of input dimensions.
121
+ - Automatically applies PCA transformation for incompatible dimensions.
122
+ - Requires all categories to be present in training data.
123
+
124
+ ### **`repeated_cross_validation`**
125
+ ```python
126
+ repeated_cross_validation(self, X, y, n_splits=10, n_repeats=5, showTable=True)
127
+ ```
128
+ Performs repeated cross-validation on the dataset using the specified splits and repeats.
129
+
130
+ #### Parameters:
131
+ - **`X`**: Input features (DataFrame or compatible format).
132
+ - **`y`**: Target labels (must be numeric).
133
+ - **`n_splits`**: Number of folds for splitting the dataset. Default is `10`.
134
+ - **`n_repeats`**: Number of times cross-validation is repeated. Default is `5`.
135
+ - **`showTable`**: Display a table with results. Default is `True`.
136
+
137
+ #### Behavior:
138
+ - Uses `RepeatedStratifiedKFold` for generating splits.
139
+ - Aggregates results from multiple train-test splits.
140
+
141
+ ### **`leave_one_out`**
142
+ ```python
143
+ leave_one_out(self, X, y, showTable=True)
144
+ ```
145
+ Performs leave-one-out cross-validation on the dataset.
146
+
147
+ #### Parameters:
148
+ - **`X`**: Input features (DataFrame or compatible format).
149
+ - **`y`**: Target labels (must be numeric).
150
+ - **`showTable`**: Display a table with results. Default is `True`.
151
+
152
+ #### Behavior:
153
+ - Uses `LeaveOneOut` for generating train-test splits.
154
+ - Evaluates the model on each split and aggregates results.
@@ -0,0 +1,19 @@
1
+ # Usage
2
+
3
+ To use LazyQML:
4
+
5
+ ```python
6
+ from sklearn.datasets import load_iris
7
+ from lazyqml.lazyqml import *
8
+
9
+ # Load data
10
+ data = load_iris()
11
+ X = data.data
12
+ y = data.target
13
+
14
+ classifier = QuantumClassifier(nqubits={4}, classifiers={Model.QNN, Model.QSVM}, epochs=10)
15
+
16
+ # Fit and predict
17
+ classifier.fit(X=X, y=y, test_size=0.4)
18
+ ```
19
+
@@ -68,7 +68,10 @@ class Dispatcher:
68
68
  numProcs = psutil.cpu_count(logical=False)
69
69
  total_memory = calculate_free_memory()
70
70
  available_memory = total_memory
71
- available_cores = numProcs
71
+ if not self.sequential:
72
+ available_cores = numProcs
73
+ else:
74
+ available_cores = 1
72
75
 
73
76
  # Lock para el acceso seguro a los recursos compartidos
74
77
  manager = Manager()
@@ -2,4 +2,4 @@
2
2
 
3
3
  __author__ = """Diego García Vega, Fernando Álvaro Plou Llorente, Alejandro Leal Castaño"""
4
4
  __email__ = "garciavdiego@uniovi.es, ploufernando@uniovi.es, lealcalejandro@uniovi.es"
5
- __version__ = "3.1.1"
5
+ __version__ = "3.2.1"
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: lazyqml
3
- Version: 3.1.1
3
+ Version: 3.2.1
4
4
  Summary: LazyQML benchmarking utility to test quantum machine learning models.
5
5
  Author-email: QHPC Group <qhpcgroup@gmail.com>
6
6
  License: MIT License
@@ -37,7 +37,7 @@ Requires-Dist: lazyqml[extra]; extra == "all"
37
37
  Provides-Extra: extra
38
38
  Requires-Dist: pandas; extra == "extra"
39
39
 
40
- ![logo](https://github.com/QHPC-SP-Research-Lab/LazyQML/blob/main/docs/logo.jpg)
40
+ ![LazyQML](./docs/logo.jpg)
41
41
  ---
42
42
  [![Pypi](https://img.shields.io/badge/pypi-%23ececec.svg?style=for-the-badge&logo=pypi&logoColor=1f73b7)](https://pypi.python.org/pypi/lazyqml)
43
43
  ![GitHub Actions](https://img.shields.io/badge/github%20actions-%232671E5.svg?style=for-the-badge&logo=githubactions&logoColor=white)
@@ -68,15 +68,15 @@ With LazyQML, you can:
68
68
  - Flexible & Modular: From basic quantum circuits to hybrid quantum-classical models—LazyQML has you covered.
69
69
 
70
70
  ## Documentation
71
- For detailed usage instructions, API reference, and code examples, please refer to the official LazyQML documentation.
71
+ For detailed usage instructions, API reference, and code examples, please refer to the official LazyQML [documentation](https://qhpc-sp-research-lab.github.io/LazyQML/).
72
72
 
73
73
  ## Requirements
74
74
 
75
75
  - Python >= 3.10
76
76
 
77
- > [!CAUTION]
77
+ > ❗❗
78
78
  > This library is only supported by Linux Systems. It doesn't support Windows nor MacOS.
79
-
79
+ > Only supports CUDA compatible devices.
80
80
 
81
81
  ## Installation
82
82
  To install lazyqml, run this command in your terminal:
@@ -18,6 +18,7 @@ requirements_dev.txt
18
18
  .github/workflows/installation.yml
19
19
  .github/workflows/pypi.yml
20
20
  .github/workflows/ubuntu.yml
21
+ docs/api.md
21
22
  docs/authors.rst
22
23
  docs/changelog.md
23
24
  docs/common.md
@@ -63,13 +63,14 @@ markdown_extensions:
63
63
  nav:
64
64
  - Home: index.md
65
65
  - Installation: installation.md
66
- - Usage: usage.md
67
- - Contributing: contributing.md
68
- - FAQ: faq.md
69
- - Changelog: changelog.md
66
+ # - Usage: usage.md
67
+ # - Contributing: contributing.md
68
+ # - FAQ: faq.md
69
+ # - Changelog: changelog.md
70
70
  - Report Issues: https://github.com/QHPC-SP-Research-Lab/LazyQML/issues
71
- - Examples:
72
- - examples/intro.ipynb
71
+ # - Examples:
72
+ # - examples/intro.ipynb
73
73
  - API Reference:
74
- - lazyqml module: lazyqml.md
74
+ - Introduction: api.md
75
+ - QuantumClassifier: lazyqml.md
75
76
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "lazyqml"
3
- version = "3.1.1"
3
+ version = "3.2.1"
4
4
  dynamic = [
5
5
  "dependencies",
6
6
  ]
@@ -48,7 +48,7 @@ universal = true
48
48
 
49
49
 
50
50
  [tool.bumpversion]
51
- current_version = "3.1.1"
51
+ current_version = "3.2.1"
52
52
  commit = true
53
53
  tag = true
54
54
 
@@ -1,16 +0,0 @@
1
- # Welcome to lazyqml
2
-
3
-
4
- [![image](https://img.shields.io/pypi/v/lazyqml.svg)](https://pypi.python.org/pypi/lazyqml)
5
-
6
-
7
- **LazyQML benchmarking utility to test quantum machine learning models.**
8
-
9
-
10
- - Free software: MIT License
11
- - Documentation: <https://DiegoGV-Uniovi.github.io/lazyqml>
12
-
13
-
14
- ## Features
15
-
16
- - TODO
File without changes
@@ -1,25 +0,0 @@
1
- # Usage
2
-
3
- To use lazyqml in a project:
4
-
5
- ```
6
- # Importing lazyqml
7
- from lazyqml.supervised import QuantumClassifier
8
- from sklearn.datasets import load_breast_cancer, load_iris
9
- from sklearn.model_selection import train_test_split
10
-
11
- # Loading a dataset to use lazyqml
12
- data = load_iris()
13
- X = data.data
14
- y = data.target
15
-
16
- # Divide in train and test
17
- X_train, X_test, y_train, y_test = train_test_split(X, y,test_size=.3,random_state =123)
18
-
19
- # Create QuantumClassifier with preferred parameters
20
- q = QuantumClassifier(nqubits=4,classifiers="all")
21
-
22
- # Fit the quantum classifier
23
- scores = q.fit(X_train, X_test, y_train, y_test)
24
- scores
25
- ```
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes