lazyqml 3.0.5__py2.py3-none-any.whl → 3.1.0__py2.py3-none-any.whl

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.
lazyqml/__init__.py CHANGED
@@ -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.0.5"
5
+ __version__ = "3.1.0"
@@ -0,0 +1,130 @@
1
+ Metadata-Version: 2.1
2
+ Name: lazyqml
3
+ Version: 3.1.0
4
+ Summary: LazyQML benchmarking utility to test quantum machine learning models.
5
+ Author-email: QHPC Group <qhpcgroup@gmail.com>
6
+ License: MIT License
7
+ Project-URL: Homepage, https://github.com/QHPC-SP-Research-Lab/LazyQML
8
+ Keywords: lazyqml
9
+ Classifier: Intended Audience :: Science/Research
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Natural Language :: English
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Requires-Python: >=3.9
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ License-File: LICENSE copy
17
+ License-File: AUTHORS.rst
18
+ Requires-Dist: wheel
19
+ Requires-Dist: tabulate
20
+ Requires-Dist: torch
21
+ Requires-Dist: torchaudio
22
+ Requires-Dist: torchvision
23
+ Requires-Dist: scipy
24
+ Requires-Dist: scikit-learn
25
+ Requires-Dist: PennyLane
26
+ Requires-Dist: PennyLane_Lightning
27
+ Requires-Dist: PennyLane_Lightning_GPU
28
+ Requires-Dist: custatevec_cu12
29
+ Requires-Dist: ucimlrepo
30
+ Requires-Dist: pydantic
31
+ Requires-Dist: psutil
32
+ Requires-Dist: pandas
33
+ Requires-Dist: joblib
34
+ Requires-Dist: gputil
35
+ Provides-Extra: all
36
+ Requires-Dist: lazyqml[extra]; extra == "all"
37
+ Provides-Extra: extra
38
+ Requires-Dist: pandas; extra == "extra"
39
+
40
+ ![logo](./docs/logo.jpg)
41
+ ---
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
+ ![GitHub Actions](https://img.shields.io/badge/github%20actions-%232671E5.svg?style=for-the-badge&logo=githubactions&logoColor=white)
44
+ ![NumPy](https://img.shields.io/badge/numpy-%23013243.svg?style=for-the-badge&logo=numpy&logoColor=white)
45
+ ![Pandas](https://img.shields.io/badge/pandas-%23150458.svg?style=for-the-badge&logo=pandas&logoColor=white)
46
+ ![PyTorch](https://img.shields.io/badge/PyTorch-%23EE4C2C.svg?style=for-the-badge&logo=PyTorch&logoColor=white)
47
+ ![scikit-learn](https://img.shields.io/badge/scikit--learn-%23F7931E.svg?style=for-the-badge&logo=scikit-learn&logoColor=white)
48
+ ![nVIDIA](https://img.shields.io/badge/cuda-000000.svg?style=for-the-badge&logo=nVIDIA&logoColor=green)
49
+ ![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black)
50
+
51
+
52
+
53
+ LazyQML is a Python library designed to streamline, automate, and accelerate experimentation with Quantum Machine Learning (QML) architectures, right on classical computers.
54
+
55
+ With LazyQML, you can:
56
+ - 🛠️ Build, test, and benchmark QML models with minimal effort.
57
+
58
+ - ⚡ Compare different QML architectures, hyperparameters seamlessly.
59
+
60
+ - 🧠 Gather knowledge about the most suitable architecture for your problem.
61
+
62
+ ## ✨ Why LazyQML?
63
+
64
+ - Rapid Prototyping: Experiment with different QML models using just a few lines of code.
65
+
66
+ - Automated Benchmarking: Evaluate performance and trade-offs across architectures effortlessly.
67
+
68
+ - Flexible & Modular: From basic quantum circuits to hybrid quantum-classical models—LazyQML has you covered.
69
+
70
+ ## Documentation
71
+ For detailed usage instructions, API reference, and code examples, please refer to the official LazyQML documentation.
72
+
73
+ ## Requirements
74
+
75
+ - Python >= 3.10
76
+
77
+ > [!CAUTION]
78
+ > This library is only supported by Linux Systems. It doesn't support Windows nor MacOS.
79
+
80
+
81
+ ## Installation
82
+ To install lazyqml, run this command in your terminal:
83
+
84
+ ```
85
+ pip install lazyqml
86
+ ```
87
+
88
+ This is the preferred method to install lazyqml, as it will always install the most recent stable release.
89
+
90
+ 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.
91
+
92
+ ### From sources
93
+
94
+ To install lazyqml from sources, run this command in your terminal:
95
+
96
+ ```
97
+ pip install git+https://github.com/QHPC-SP-Research-Lab/LazyQML
98
+ ```
99
+ ## Example
100
+
101
+ ```python
102
+ from sklearn.datasets import load_iris
103
+ from lazyqml.lazyqml import *
104
+
105
+ # Load data
106
+ data = load_iris()
107
+ X = data.data
108
+ y = data.target
109
+
110
+ classifier = QuantumClassifier(nqubits={4}, classifiers={Model.QNN, Model.QSVM}, epochs=10)
111
+
112
+ # Fit and predict
113
+ classifier.fit(X=X, y=y, test_size=0.4)
114
+ ```
115
+
116
+ ## Quantum and High Performance Computing (QHPC) - University of Oviedo
117
+ - José Ranilla Pastor - ranilla@uniovi.es
118
+ - Elías Fernández Combarro - efernandezca@uniovi.es
119
+ - Diego García Vega - diegogarciavega@gmail.com
120
+ - Fernando Álvaro Plou Llorente - ploufernando@uniovi.es
121
+ - Alejandro Leal Castaño - lealcalejandro@uniovi.es
122
+ - Group - https://qhpc.uniovi.es
123
+
124
+ ## Citing
125
+ If you used LazyQML in your work, please cite:
126
+ - 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)
127
+
128
+ ## License
129
+ - Free software: MIT License
130
+
@@ -1,4 +1,4 @@
1
- lazyqml/__init__.py,sha256=kP3TbYSYJSGlF-TE_vBY3sf-9lrkJsOBBsC6nr2fDZI,242
1
+ lazyqml/__init__.py,sha256=M5rTFF_L-2w-CYVAK1ACQXECNM3EvF2WCorMhl4jd64,242
2
2
  lazyqml/lazyqml.py,sha256=zrKvufHWroOnHJeeytKqrZ3BsWliFRvwVzdcsV8I-cE,14397
3
3
  lazyqml/Factories/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  lazyqml/Factories/Circuits/AmplitudeEmbedding.py,sha256=alkSF082NuQk_FkBfCh3fMPu_d6q7kBIfyhYBztlhYo,646
@@ -30,11 +30,11 @@ lazyqml/Interfaces/iModel.py,sha256=W_yYoZd7hS8ZKGvNAyl-waJ6f7F0kIM6zrg9WqyPt_I,
30
30
  lazyqml/Interfaces/iPreprocessing.py,sha256=O9f2tCnWTbjkHi4_XKaPWsE2SWKsdI1pj2lCyBWih9o,255
31
31
  lazyqml/Utils/Utils.py,sha256=JMmN1ilzNXTnhA5PZaMZvEVbtnKFYW50xUejWDLeAfM,10034
32
32
  lazyqml/Utils/Validator.py,sha256=6Ox2A5WAV5GYPuFfB873mpEqCHSmhhSwFV_LGI-ZJ5s,4622
33
- lazyqml-3.0.5.dist-info/AUTHORS.rst,sha256=Y_bDRslOAz5wcAYrTAnjDlmlW-51LfVF0Xwf09TbW3Y,245
34
- lazyqml-3.0.5.dist-info/LICENSE,sha256=42X2ZTCkjjhUks41WOjPmwX8sbCfgf431zzdCne6gqE,1079
35
- lazyqml-3.0.5.dist-info/LICENSE copy,sha256=y9EYvUN_l9ZWDuiVcxHE1NWbfy_HR9Z-8G19719ynbQ,1077
36
- lazyqml-3.0.5.dist-info/METADATA,sha256=qCS0uGVkp7rnvUXXvPQuq54jK8Fp32Fzm7rBdVPY_9s,9615
37
- lazyqml-3.0.5.dist-info/WHEEL,sha256=pxeNX5JdtCe58PUSYP9upmc7jdRPgvT0Gm9kb1SHlVw,109
38
- lazyqml-3.0.5.dist-info/entry_points.txt,sha256=I0WR08yVIeXjSa8XBSGZ9SsZtM8uMvKwZOdU1qQajao,45
39
- lazyqml-3.0.5.dist-info/top_level.txt,sha256=x2ffpytT-NeXmC7YaZLSQNMLK0pLfUiRmGOqwNbyjZE,8
40
- lazyqml-3.0.5.dist-info/RECORD,,
33
+ lazyqml-3.1.0.dist-info/AUTHORS.rst,sha256=Y_bDRslOAz5wcAYrTAnjDlmlW-51LfVF0Xwf09TbW3Y,245
34
+ lazyqml-3.1.0.dist-info/LICENSE,sha256=42X2ZTCkjjhUks41WOjPmwX8sbCfgf431zzdCne6gqE,1079
35
+ lazyqml-3.1.0.dist-info/LICENSE copy,sha256=y9EYvUN_l9ZWDuiVcxHE1NWbfy_HR9Z-8G19719ynbQ,1077
36
+ lazyqml-3.1.0.dist-info/METADATA,sha256=95H9LbZCtRGGCgx6ILQ5nD1RyadoLBWsFoqXPBLvMlc,4747
37
+ lazyqml-3.1.0.dist-info/WHEEL,sha256=pxeNX5JdtCe58PUSYP9upmc7jdRPgvT0Gm9kb1SHlVw,109
38
+ lazyqml-3.1.0.dist-info/entry_points.txt,sha256=I0WR08yVIeXjSa8XBSGZ9SsZtM8uMvKwZOdU1qQajao,45
39
+ lazyqml-3.1.0.dist-info/top_level.txt,sha256=x2ffpytT-NeXmC7YaZLSQNMLK0pLfUiRmGOqwNbyjZE,8
40
+ lazyqml-3.1.0.dist-info/RECORD,,
@@ -1,122 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: lazyqml
3
- Version: 3.0.5
4
- Summary: LazyQML benchmarking utility to test quantum machine learning models.
5
- Author-email: QHPC Group <qhpcgroup@gmail.com>
6
- License: MIT License
7
- Project-URL: Homepage, https://github.com/QHPC-SP-Research-Lab/LazyQML
8
- Keywords: lazyqml
9
- Classifier: Intended Audience :: Science/Research
10
- Classifier: License :: OSI Approved :: MIT License
11
- Classifier: Natural Language :: English
12
- Classifier: Programming Language :: Python :: 3.10
13
- Requires-Python: >=3.9
14
- Description-Content-Type: text/markdown
15
- License-File: LICENSE
16
- License-File: LICENSE copy
17
- License-File: AUTHORS.rst
18
- Requires-Dist: wheel
19
- Requires-Dist: tabulate
20
- Requires-Dist: torch
21
- Requires-Dist: torchaudio
22
- Requires-Dist: torchvision
23
- Requires-Dist: scipy
24
- Requires-Dist: scikit-learn
25
- Requires-Dist: PennyLane
26
- Requires-Dist: PennyLane_Lightning
27
- Requires-Dist: PennyLane_Lightning_GPU
28
- Requires-Dist: custatevec_cu12
29
- Requires-Dist: ucimlrepo
30
- Requires-Dist: pydantic
31
- Requires-Dist: psutil
32
- Requires-Dist: pandas
33
- Requires-Dist: joblib
34
- Requires-Dist: gputil
35
- Provides-Extra: all
36
- Requires-Dist: lazyqml[extra]; extra == "all"
37
- Provides-Extra: extra
38
- Requires-Dist: pandas; extra == "extra"
39
-
40
- # LazyQML
41
-
42
-
43
- [![image](https://img.shields.io/badge/pypi-%23ececec.svg?style=for-the-badge&logo=pypi&logoColor=1f73b7)](https://pypi.python.org/pypi/lazyqml)
44
- ![GitHub Actions](https://img.shields.io/badge/github%20actions-%232671E5.svg?style=for-the-badge&logo=githubactions&logoColor=white)
45
- ![NumPy](https://img.shields.io/badge/numpy-%23013243.svg?style=for-the-badge&logo=numpy&logoColor=white)
46
- ![Pandas](https://img.shields.io/badge/pandas-%23150458.svg?style=for-the-badge&logo=pandas&logoColor=white)
47
- ![PyTorch](https://img.shields.io/badge/PyTorch-%23EE4C2C.svg?style=for-the-badge&logo=PyTorch&logoColor=white)
48
- ![scikit-learn](https://img.shields.io/badge/scikit--learn-%23F7931E.svg?style=for-the-badge&logo=scikit-learn&logoColor=white)
49
- ![nVIDIA](https://img.shields.io/badge/cuda-000000.svg?style=for-the-badge&logo=nVIDIA&logoColor=green)
50
- <img src="https://assets.cloud.pennylane.ai/pennylane_website/generic/logo.svg" alt="Pennylane Logo" style="background-color: white; padding: 2px;" />
51
- ![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black)
52
-
53
- <!-- ![Pennylane](https://assets.cloud.pennylane.ai/pennylane_website/generic/logo.svg) -->
54
-
55
- pLazyQML, a software package designed to accelerate, automate, and streamline experimentation with quantum machine learning models on classical computers. pLazyQML reduces the complexity and time required for developing and testing quantum-enhanced machine learning models.
56
- ## Usage
57
- ```python
58
- from lazyqml.lazyqml import QuantumClassifier
59
- from lazyqml.Global.globalEnums import *
60
- from sklearn.datasets import load_breast_cancer, load_iris
61
- from sklearn.model_selection import train_test_split
62
- # Load data
63
- data = load_iris()
64
- X = data.data
65
- y = data.target
66
-
67
- # Split data
68
- X_train, X_test, y_train, y_test = train_test_split(X, y,test_size=.3,random_state =123)
69
-
70
- # Initialize L azyClass ifier
71
- classifier = QuantumClassifier(nqubits={4,8,16},verbose=True,sequential=False,backend=Backend.lightningQubit)
72
-
73
- # Fit and predict
74
- classifier.fit(X_train=X_train,y_train=y_train,X_test=X_test,y_test=y_test)
75
- ```
76
-
77
- ## License & Compatibility
78
- - Free software: MIT License
79
- - This Python package is only compatible with Linux systems.
80
- - Hardware acceleration is only enabled using CUDA-compatible devices.
81
- ## Quantum and High Performance Computing (QHPC) - University of Oviedo
82
- - José Ranilla Pastor - ranilla@uniovi.es
83
- - Elías Fernández Combarro - efernandezca@uniovi.es
84
- - Diego García Vega - diegogarciavega@gmail.com
85
- - Fernando Álvaro Plou Llorente - ploufernando@uniovi.es
86
- - Alejandro Leal Castaño - lealcalejandro@uniovi.es
87
- - Group - https://qhpc.uniovi.es
88
-
89
- ## Parameters:
90
- - **verbose** _bool, optional (default=False)_: If set to True, detailed messages about the training process will be displayed, helping users to monitor the progress and debug if necessary.
91
- - **customMetric** _function, optional (default=None)_: A custom evaluation function provided by the user to evaluate the models. This allows the user to define their own metrics tailored to specific requirements.
92
- - **customImputerNum** _function, optional (default=None)_: A custom function provided by the user to handle the imputation of missing numeric data. This provides flexibility in how missing values are treated in the dataset.
93
- - **customImputerCat** _function, optional (default=None)_: A custom function provided by the user to handle the imputation of missing categorical data, allowing users to apply their own strategies for handling missing categorical values.
94
- - **prediction** _bool, optional (default=False)_: If set to True, the predictions made by all the models will be returned as a pandas DataFrame for easy comparison and analysis of different models’ outputs.
95
- - **classifiers** _set of enums, optional (default={Model.ALL})_: A set specifying which classifiers to train. Options include `{Model.ALL, Model.QSVM, Model.QNN, Model.QNN_BAG}`, enabling the user to select specific quantum classifiers or train all available ones.
96
- - **embeddings** _set of enums, optional (default={Embedding.ALL})_: A set specifying which embeddings to use for training. Options include `{Embedding.ALL, Embedding.RX, Embedding.RZ, Embedding.RY, Embedding.ZZ, Embedding.AMP}`, allowing the user to choose specific data encodings.
97
- - **ansatzs** _set of enums, optional (default={Ansatzs.ALL})_: A set specifying which quantum circuit ansatzes to use. Options include `{Ansatzs.ALL, Ansatzs.HCZRX, Ansatzs.TREE_TENSOR, Ansatzs.TWO_LOCAL, Ansatzs.HARDWARE_EFFICIENT}`, giving users the ability to experiment with different quantum circuit structures.
98
- - **randomState** _int, optional (default=1234)_: An integer seed used to ensure the repeatability of experiments, making the results consistent across different runs.
99
- - **nqubits** _int, optional (default=8)_: Specifies the number of qubits for the quantum circuits used by the models. This parameter controls the size of the quantum circuits.
100
- - **numLayers** _int, optional (default=5)_: Indicates the number of layers in the Quantum Neural Network (QNN) models, affecting the depth and potentially the performance of the neural networks.
101
- - **numPredictors** _int, optional (default=10)_: Specifies the number of different predictors used in Quantum Neural Networks with Bagging (QNN_Bag). This parameter controls the ensemble size in bagging models.
102
- - **maxSamples** _float, optional (default=1.0)_: A floating point number between 0 and 1.0 indicating the fraction of the dataset to be used for each Quantum Neural Network with Bagging (QNN_Bag).
103
- - **maxFeatures** _float, optional (default=0.8)_: A floating point number between 0 and 1.0 indicating the fraction of the dataset features to be used for each Quantum Neural Network with Bagging (QNN_Bag).
104
- - **runs** _int, optional (default=1)_: The number of training runs for the Quantum Neural Network (QNN) models. This parameter determines how many times the model is trained and evaluated.
105
- - **learningRate** _float, optional (default=0.01)_: The learning rate for the gradient descent optimization process used in all Quantum Neural Networks (QNNs). This controls how much the model's weights are updated during each training step.
106
- - **epochs** _int, optional (default=100)_: The number of complete passes through the dataset during model fitting. More epochs can allow the model to converge more accurately, though may increase computation time.
107
- - **backend** _enum, optional (default=Backend.lightningQubit)_: This field controls the acceleration used in the quantum simulator. Supported values are `{Backend.lightningQubit, Backend.lightningGPU, Backend.defaultQubit}`, specifying which backend to use for quantum circuit simulation.
108
- - **threshold** _int, optional (default=22)_: Integer value used to delimit from which number of qubits the internal operations of the models start to be parallelized. This helps optimize performance for larger quantum circuits.
109
- - **cores** _int, optional (default=-1)_: Number of processes to be created by the dispatcher to run the selected models. Each process will be allocated as many CPU cores as possible for parallel execution.
110
- ## Functions:
111
- - **fit** _(X, y, test\_size, showTable=True)_: Fit Classification algorithms to X and y using hold-out, predict and score on test set (test_size).
112
- If the dimensions of the training vectors are not compatible with the different models, a
113
- PCA transformation will be used in order to reduce the dimensionality to a compatible space.
114
- All categories must be in the training data if there are new categories in the test date the
115
- function will not work. The objective variable must be in a numerical form like LabelEncoder or
116
- OrdinalEncoder. Onehot or strings won't work.
117
- - **repeated_cross_validation** _(X, y, n_splits=5, n_repeats=10, showTable=True)_: Perform repeated cross-validation on the given dataset and model.This method splits the dataset into multiple train-test splits using RepeatedStratifiedKFold,
118
- fits the model on the training set, evaluates it on the validation set, and aggregates the results.
119
-
120
- - **leave_one_out** _(X, y, showTable=True)_: Perform leave-one-out cross-validation on the given dataset and model. This method splits the dataset into multiple train-test splits using LeaveOneOut,
121
- fits the model on the training set, evaluates it on the validation set, and aggregates the results.
122
-