qumat 0.0.1__tar.gz → 0.5.0__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.
- qumat-0.5.0/.gitignore +54 -0
- {qumat-0.0.1 → qumat-0.5.0}/LICENSE +0 -112
- qumat-0.5.0/NOTICE +5 -0
- qumat-0.5.0/PKG-INFO +111 -0
- qumat-0.5.0/README.md +93 -0
- qumat-0.5.0/pyproject.toml +78 -0
- qumat-0.5.0/qumat/__init__.py +20 -0
- qumat-0.5.0/qumat/amazon_braket_backend.py +203 -0
- qumat-0.5.0/qumat/cirq_backend.py +197 -0
- qumat-0.5.0/qumat/qdp.py +63 -0
- qumat-0.5.0/qumat/qiskit_backend.py +218 -0
- qumat-0.5.0/qumat/qumat.py +585 -0
- qumat-0.0.1/NOTICE +0 -41
- qumat-0.0.1/PKG-INFO +0 -77
- qumat-0.0.1/README.md +0 -56
- qumat-0.0.1/pyproject.toml +0 -27
- qumat-0.0.1/qumat/__init__.py +0 -0
- qumat-0.0.1/qumat/amazon_braket_backend.py +0 -98
- qumat-0.0.1/qumat/cirq_backend.py +0 -108
- qumat-0.0.1/qumat/qiskit_backend.py +0 -117
- qumat-0.0.1/qumat/qumat.py +0 -90
qumat-0.5.0/.gitignore
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
|
|
2
|
+
output-asf-email-examples/
|
|
3
|
+
.checkstyle
|
|
4
|
+
.ruleset
|
|
5
|
+
.pmd
|
|
6
|
+
.classpath
|
|
7
|
+
.project
|
|
8
|
+
.settings/
|
|
9
|
+
.idea/
|
|
10
|
+
.DS_Store
|
|
11
|
+
.cache
|
|
12
|
+
*.iml
|
|
13
|
+
target/
|
|
14
|
+
examples/bin/tmp
|
|
15
|
+
output
|
|
16
|
+
community/mr/build/
|
|
17
|
+
community/mr/input/
|
|
18
|
+
community/mr/output/
|
|
19
|
+
community/mr/testdata/
|
|
20
|
+
community/mr/temp
|
|
21
|
+
temp
|
|
22
|
+
foo
|
|
23
|
+
math-tests/
|
|
24
|
+
metastore_db/*
|
|
25
|
+
bin/derby.log
|
|
26
|
+
bin/metastore_db
|
|
27
|
+
*.jar
|
|
28
|
+
*.log
|
|
29
|
+
|
|
30
|
+
# Jekyll (legacy)
|
|
31
|
+
website/_site
|
|
32
|
+
website/Gemfile.lock
|
|
33
|
+
website/.bundle
|
|
34
|
+
website/.sass-cache
|
|
35
|
+
|
|
36
|
+
# Docusaurus build artifacts (synced from /docs)
|
|
37
|
+
website/blog/
|
|
38
|
+
website-new/
|
|
39
|
+
|
|
40
|
+
*.iml
|
|
41
|
+
.idea
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
# Python environments
|
|
45
|
+
venv/
|
|
46
|
+
.venv/
|
|
47
|
+
|
|
48
|
+
# Python cache and compiled files
|
|
49
|
+
__pycache__/
|
|
50
|
+
*.pyc
|
|
51
|
+
*.pyo
|
|
52
|
+
|
|
53
|
+
# Testing and type checking (project uses these)
|
|
54
|
+
.pytest_cache/
|
|
@@ -202,77 +202,6 @@
|
|
|
202
202
|
limitations under the License.
|
|
203
203
|
|
|
204
204
|
|
|
205
|
-
==========================================================
|
|
206
|
-
CERN Colt Java Library
|
|
207
|
-
==========================================================
|
|
208
|
-
Copyright © 1999 CERN - European Organization for Nuclear Research.<br/><br/>
|
|
209
|
-
|
|
210
|
-
Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose
|
|
211
|
-
is hereby granted without fee, provided that the above copyright notice appear in all copies and
|
|
212
|
-
that both that copyright notice and this permission notice appear in supporting documentation.
|
|
213
|
-
CERN makes no representations about the suitability of this software for any purpose.
|
|
214
|
-
It is provided "as is" without expressed or implied warranty.
|
|
215
|
-
|
|
216
|
-
[Mahout note: We have included, as source, parts of the CERN Colt Java Matrix library as a Module
|
|
217
|
-
in the Mahout source tree. The parts included are those in cern.colt* , cern.jet*, cern.clhep.
|
|
218
|
-
We have excluded the hep.aida* packages.]
|
|
219
|
-
|
|
220
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/Arrays.java
|
|
221
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/OldQRDecomposition.java
|
|
222
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/PersistentObject.java
|
|
223
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/QRDecomposition.java
|
|
224
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/SingularValueDecomposition.java
|
|
225
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/Swapper.java
|
|
226
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/collections/Arithmetic.java
|
|
227
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/collections/Constants.java
|
|
228
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/function/DoubleDoubleFunction.java
|
|
229
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/function/DoubleFunction.java
|
|
230
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/function/Functions.java
|
|
231
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/function/IntFunction.java
|
|
232
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/function/IntIntDoubleFunction.java
|
|
233
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/function/Mult.java
|
|
234
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/function/ObjectProcedure.java
|
|
235
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/function/PlusMult.java
|
|
236
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/jet/math/Arithmetic.java
|
|
237
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/jet/math/Constants.java
|
|
238
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/jet/math/Polynomial.java
|
|
239
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/jet/random/AbstractContinuousDistribution.java
|
|
240
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/jet/random/AbstractDiscreteDistribution.java
|
|
241
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/jet/random/AbstractDistribution.java
|
|
242
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/jet/random/Exponential.java
|
|
243
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/jet/random/Gamma.java
|
|
244
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/jet/random/NegativeBinomial.java
|
|
245
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/jet/random/Normal.java
|
|
246
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/jet/random/Poisson.java
|
|
247
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/jet/random/Uniform.java
|
|
248
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/jet/random/engine/MersenneTwister.java
|
|
249
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/jet/random/engine/RandomEngine.java
|
|
250
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/jet/random/sampling/RandomSampler.java
|
|
251
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/jet/stat/Gamma.java
|
|
252
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/jet/stat/Probability.java
|
|
253
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/list/AbstractList.java
|
|
254
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/list/AbstractObjectList.java
|
|
255
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/list/ObjectArrayList.java
|
|
256
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/list/SimpleLongArrayList.java
|
|
257
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/map/HashFunctions.java
|
|
258
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/map/OpenHashMap.java
|
|
259
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/map/QuickOpenIntIntHashMap.java
|
|
260
|
-
apache-mahout-14.1/core/src/main/java/org/apache/mahout/math/set/AbstractSet.java
|
|
261
|
-
apache-mahout-14.1/core/src/main/java-templates/org/apache/mahout/math/buffer/ValueTypeBufferConsumer.java.t
|
|
262
|
-
apache-mahout-14.1/core/src/main/java-templates/org/apache/mahout/math/function/KeyTypeObjectProcedure.java.t
|
|
263
|
-
apache-mahout-14.1/core/src/main/java-templates/org/apache/mahout/math/function/KeyTypeProcedure.java.t
|
|
264
|
-
apache-mahout-14.1/core/src/main/java-templates/org/apache/mahout/math/function/KeyTypeProcedure.java.t
|
|
265
|
-
apache-mahout-14.1/core/src/main/java-templates/org/apache/mahout/math/function/ObjectValueTypeProcedure.java.t
|
|
266
|
-
apache-mahout-14.1/core/src/main/java-templates/org/apache/mahout/math/function/ObjectValueTypeProcedure.java.t
|
|
267
|
-
apache-mahout-14.1/core/src/main/java-templates/org/apache/mahout/math/list/AbstractValueTypeList.java.t
|
|
268
|
-
apache-mahout-14.1/core/src/main/java-templates/org/apache/mahout/math/list/ValueTypeArrayList.java.t
|
|
269
|
-
apache-mahout-14.1/core/src/main/java-templates/org/apache/mahout/math/map/AbstractKeyTypeObjectMap.java.t
|
|
270
|
-
apache-mahout-14.1/core/src/main/java-templates/org/apache/mahout/math/map/AbstractKeyTypeValueTypeMap.java.t
|
|
271
|
-
apache-mahout-14.1/core/src/main/java-templates/org/apache/mahout/math/map/AbstractObjectValueTypeMap.java.t
|
|
272
|
-
apache-mahout-14.1/core/src/main/java-templates/org/apache/mahout/math/map/OpenKeyTypeObjectHashMap.java.t
|
|
273
|
-
apache-mahout-14.1/core/src/main/java-templates/org/apache/mahout/math/map/OpenKeyTypeValueTypeHashMap.java.t
|
|
274
|
-
apache-mahout-14.1/core/src/main/java-templates/org/apache/mahout/math/map/OpenObjectValueTypeHashMap.java.t
|
|
275
|
-
|
|
276
205
|
================================================================
|
|
277
206
|
Austin Appleby's C algorithm implemented by Yonik Seeley under public domain
|
|
278
207
|
================================================================
|
|
@@ -303,44 +232,3 @@ Proper
|
|
|
303
232
|
Files in the directory: website/assets/vendor/propper
|
|
304
233
|
Are copied from the Propper project (https://popper.js.org/)
|
|
305
234
|
which is licensed under the MIT license.
|
|
306
|
-
|
|
307
|
-
================================================================
|
|
308
|
-
The following applies to the ViennaCL library and files in the mahout-native-viennacl module
|
|
309
|
-
================================================================
|
|
310
|
-
|
|
311
|
-
Copyright (c) 2010-2016 Institute for Microelectronics,
|
|
312
|
-
Institute for Analysis and Scientific Computing, TU Wien.
|
|
313
|
-
Portions of this software are copyright by UChicago Argonne, LLC.
|
|
314
|
-
Argonne National Laboratory, with facilities in the state of Illinois,
|
|
315
|
-
is owned by The United States Government, and operated by UChicago Argonne, LLC
|
|
316
|
-
under provision of a contract with the Department of Energy.
|
|
317
|
-
|
|
318
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
319
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
320
|
-
in the Software without restriction, including without limitation the rights
|
|
321
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
322
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
323
|
-
furnished to do so, subject to the following conditions:
|
|
324
|
-
|
|
325
|
-
The above copyright notice and this permission notice shall be included in
|
|
326
|
-
all copies or substantial portions of the Software.
|
|
327
|
-
|
|
328
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
329
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
330
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
331
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
332
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
333
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
334
|
-
THE SOFTWARE.
|
|
335
|
-
|
|
336
|
-
===============================================================================
|
|
337
|
-
The following applies to the bydeco/javacpp code and module
|
|
338
|
-
===============================================================================
|
|
339
|
-
You may use this work under the terms of either the Apache License,
|
|
340
|
-
Version 2.0, or the GNU General Public License (GPL), either version 2,
|
|
341
|
-
or any later version, with "Classpath" exception (details below).
|
|
342
|
-
|
|
343
|
-
You don't have to do anything special to choose one license or the other
|
|
344
|
-
and you don't have to notify anyone which license you are using. You are
|
|
345
|
-
free to use this work in any project (even commercial projects) as long
|
|
346
|
-
as the copyright header is left intact.
|
qumat-0.5.0/NOTICE
ADDED
qumat-0.5.0/PKG-INFO
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: qumat
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Summary: A library for composing quantum machine learning.
|
|
5
|
+
Author-email: Apache Mahout <dev@mahout.apache.org>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
License-File: NOTICE
|
|
9
|
+
Requires-Python: <3.13,>=3.10
|
|
10
|
+
Requires-Dist: amazon-braket-sdk<2.0,>=1.108.0
|
|
11
|
+
Requires-Dist: cirq<1.6.0,>=1.5.0
|
|
12
|
+
Requires-Dist: qiskit-aer<0.18.0,>=0.17.2
|
|
13
|
+
Requires-Dist: qiskit<3.0.0,>=2.2.0
|
|
14
|
+
Requires-Dist: sympy<2.0,>=1.14.0
|
|
15
|
+
Provides-Extra: qdp
|
|
16
|
+
Requires-Dist: qumat-qdp; extra == 'qdp'
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
<!--
|
|
21
|
+
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
22
|
+
contributor license agreements. See the NOTICE file distributed with
|
|
23
|
+
this work for additional information regarding copyright ownership.
|
|
24
|
+
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
25
|
+
(the "License"); you may not use this file except in compliance with
|
|
26
|
+
the License. You may obtain a copy of the License at
|
|
27
|
+
|
|
28
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
29
|
+
|
|
30
|
+
Unless required by applicable law or agreed to in writing, software
|
|
31
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
32
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
33
|
+
See the License for the specific language governing permissions and
|
|
34
|
+
limitations under the License.
|
|
35
|
+
-->
|
|
36
|
+
|
|
37
|
+
# Apache Mahout
|
|
38
|
+
|
|
39
|
+
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
40
|
+
[](https://www.python.org/)
|
|
41
|
+
[](https://github.com/apache/mahout/stargazers)
|
|
42
|
+
[](https://github.com/apache/mahout/graphs/contributors)
|
|
43
|
+
|
|
44
|
+
The goal of the Apache Mahout™ project is to build an environment for quickly creating scalable, performant machine learning applications.\
|
|
45
|
+
For additional information about Mahout, visit the [Mahout Home Page](http://mahout.apache.org/)
|
|
46
|
+
|
|
47
|
+
## Qumat
|
|
48
|
+
|
|
49
|
+
<p align="center">
|
|
50
|
+
<img src="https://raw.githubusercontent.com/apache/mahout/refs/heads/main/docs/assets/mascot_with_text.png" width="400" alt="Apache Mahout">
|
|
51
|
+
</p>
|
|
52
|
+
|
|
53
|
+
Qumat is a high-level Python library for quantum computing that provides:
|
|
54
|
+
|
|
55
|
+
- **Quantum Circuit Abstraction** - Build quantum circuits with standard gates (Hadamard, CNOT, Pauli, etc.) and run them on Qiskit, Cirq, or Amazon Braket with a single unified API. Write once, execute anywhere. Check out [basic gates](docs/basic_gates.md) for a quick introduction to the basic gates supported across all backends.
|
|
56
|
+
- **QDP (Quantum Data Plane)** - Encode classical data into quantum states using GPU-accelerated kernels. Zero-copy tensor transfer via DLPack lets you move data between PyTorch, NumPy, and TensorFlow without overhead.
|
|
57
|
+
|
|
58
|
+
## Quick Start
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
git clone https://github.com/apache/mahout.git
|
|
62
|
+
cd mahout
|
|
63
|
+
pip install uv
|
|
64
|
+
uv sync # Core Qumat
|
|
65
|
+
uv sync --extra qdp # With QDP (requires CUDA GPU)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Qumat: Run a Quantum Circuit
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
from qumat import QuMat
|
|
72
|
+
|
|
73
|
+
qumat = QuMat({"backend_name": "qiskit", "backend_options": {"simulator_type": "aer_simulator"}})
|
|
74
|
+
qumat.create_empty_circuit(num_qubits=2)
|
|
75
|
+
qumat.apply_hadamard_gate(0)
|
|
76
|
+
qumat.apply_cnot_gate(0, 1)
|
|
77
|
+
qumat.execute_circuit()
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### QDP: Encode data for Quantum ML
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
import qumat.qdp as qdp
|
|
84
|
+
|
|
85
|
+
engine = qdp.QdpEngine(device_id=0)
|
|
86
|
+
qtensor = engine.encode([1.0, 2.0, 3.0, 4.0], num_qubits=2, encoding_method="amplitude")
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Roadmap
|
|
90
|
+
|
|
91
|
+
### 2024
|
|
92
|
+
- [x] Transition of Classic to maintenance mode
|
|
93
|
+
- [x] Integration of Qumat with hardened (tests, docs, CI/CD) Cirq, Qiskit, and Braket backends
|
|
94
|
+
- [x] Integration with Amazon Braket
|
|
95
|
+
- [x] [Public talk about Qumat](https://2024.fossy.us/schedule/presentation/265/)
|
|
96
|
+
|
|
97
|
+
### 2025
|
|
98
|
+
- [x] [FOSDEM talk](https://fosdem.org/2025/schedule/event/fosdem-2025-5298-introducing-qumat-an-apache-mahout-joint-/)
|
|
99
|
+
- [x] QDP: Foundation & Infrastructure (Rust workspace, build configuration)
|
|
100
|
+
- [x] QDP: Core Implementation (CUDA kernels, CPU preprocessing, GPU memory management)
|
|
101
|
+
- [x] QDP: Zero-copy and Safety (DLManagedTensor, DLPack structures)
|
|
102
|
+
- [x] QDP: Python Binding (PyO3 wrapping, DLPack protocol)
|
|
103
|
+
|
|
104
|
+
### Q1 2026
|
|
105
|
+
- [ ] QDP: Input Format Support (PyTorch, NumPy, TensorFlow integration)
|
|
106
|
+
- [ ] QDP: Verification and Testing (device testing, benchmarking)
|
|
107
|
+
- [ ] QDP: Additional Encoders (angle/basis encoding, multi-GPU optimization)
|
|
108
|
+
- [ ] QDP: Integration & Release (documentation, example notebooks, PyPI publishing)
|
|
109
|
+
|
|
110
|
+
## Legal
|
|
111
|
+
Please see the `NOTICE.txt` included in this directory for more information.
|
qumat-0.5.0/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
|
|
2
|
+
<!--
|
|
3
|
+
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
4
|
+
contributor license agreements. See the NOTICE file distributed with
|
|
5
|
+
this work for additional information regarding copyright ownership.
|
|
6
|
+
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
7
|
+
(the "License"); you may not use this file except in compliance with
|
|
8
|
+
the License. You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
See the License for the specific language governing permissions and
|
|
16
|
+
limitations under the License.
|
|
17
|
+
-->
|
|
18
|
+
|
|
19
|
+
# Apache Mahout
|
|
20
|
+
|
|
21
|
+
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
22
|
+
[](https://www.python.org/)
|
|
23
|
+
[](https://github.com/apache/mahout/stargazers)
|
|
24
|
+
[](https://github.com/apache/mahout/graphs/contributors)
|
|
25
|
+
|
|
26
|
+
The goal of the Apache Mahout™ project is to build an environment for quickly creating scalable, performant machine learning applications.\
|
|
27
|
+
For additional information about Mahout, visit the [Mahout Home Page](http://mahout.apache.org/)
|
|
28
|
+
|
|
29
|
+
## Qumat
|
|
30
|
+
|
|
31
|
+
<p align="center">
|
|
32
|
+
<img src="https://raw.githubusercontent.com/apache/mahout/refs/heads/main/docs/assets/mascot_with_text.png" width="400" alt="Apache Mahout">
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
Qumat is a high-level Python library for quantum computing that provides:
|
|
36
|
+
|
|
37
|
+
- **Quantum Circuit Abstraction** - Build quantum circuits with standard gates (Hadamard, CNOT, Pauli, etc.) and run them on Qiskit, Cirq, or Amazon Braket with a single unified API. Write once, execute anywhere. Check out [basic gates](docs/basic_gates.md) for a quick introduction to the basic gates supported across all backends.
|
|
38
|
+
- **QDP (Quantum Data Plane)** - Encode classical data into quantum states using GPU-accelerated kernels. Zero-copy tensor transfer via DLPack lets you move data between PyTorch, NumPy, and TensorFlow without overhead.
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git clone https://github.com/apache/mahout.git
|
|
44
|
+
cd mahout
|
|
45
|
+
pip install uv
|
|
46
|
+
uv sync # Core Qumat
|
|
47
|
+
uv sync --extra qdp # With QDP (requires CUDA GPU)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Qumat: Run a Quantum Circuit
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
from qumat import QuMat
|
|
54
|
+
|
|
55
|
+
qumat = QuMat({"backend_name": "qiskit", "backend_options": {"simulator_type": "aer_simulator"}})
|
|
56
|
+
qumat.create_empty_circuit(num_qubits=2)
|
|
57
|
+
qumat.apply_hadamard_gate(0)
|
|
58
|
+
qumat.apply_cnot_gate(0, 1)
|
|
59
|
+
qumat.execute_circuit()
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### QDP: Encode data for Quantum ML
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
import qumat.qdp as qdp
|
|
66
|
+
|
|
67
|
+
engine = qdp.QdpEngine(device_id=0)
|
|
68
|
+
qtensor = engine.encode([1.0, 2.0, 3.0, 4.0], num_qubits=2, encoding_method="amplitude")
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Roadmap
|
|
72
|
+
|
|
73
|
+
### 2024
|
|
74
|
+
- [x] Transition of Classic to maintenance mode
|
|
75
|
+
- [x] Integration of Qumat with hardened (tests, docs, CI/CD) Cirq, Qiskit, and Braket backends
|
|
76
|
+
- [x] Integration with Amazon Braket
|
|
77
|
+
- [x] [Public talk about Qumat](https://2024.fossy.us/schedule/presentation/265/)
|
|
78
|
+
|
|
79
|
+
### 2025
|
|
80
|
+
- [x] [FOSDEM talk](https://fosdem.org/2025/schedule/event/fosdem-2025-5298-introducing-qumat-an-apache-mahout-joint-/)
|
|
81
|
+
- [x] QDP: Foundation & Infrastructure (Rust workspace, build configuration)
|
|
82
|
+
- [x] QDP: Core Implementation (CUDA kernels, CPU preprocessing, GPU memory management)
|
|
83
|
+
- [x] QDP: Zero-copy and Safety (DLManagedTensor, DLPack structures)
|
|
84
|
+
- [x] QDP: Python Binding (PyO3 wrapping, DLPack protocol)
|
|
85
|
+
|
|
86
|
+
### Q1 2026
|
|
87
|
+
- [ ] QDP: Input Format Support (PyTorch, NumPy, TensorFlow integration)
|
|
88
|
+
- [ ] QDP: Verification and Testing (device testing, benchmarking)
|
|
89
|
+
- [ ] QDP: Additional Encoders (angle/basis encoding, multi-GPU optimization)
|
|
90
|
+
- [ ] QDP: Integration & Release (documentation, example notebooks, PyPI publishing)
|
|
91
|
+
|
|
92
|
+
## Legal
|
|
93
|
+
Please see the `NOTICE.txt` included in this directory for more information.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
|
+
# contributor license agreements. See the NOTICE file distributed with
|
|
3
|
+
# this work for additional information regarding copyright ownership.
|
|
4
|
+
# The ASF licenses this file to You under the Apache License, Version 2.0
|
|
5
|
+
# (the "License"); you may not use this file except in compliance with
|
|
6
|
+
# the License. You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
|
|
16
|
+
[project]
|
|
17
|
+
name = "qumat"
|
|
18
|
+
version = "0.5.0"
|
|
19
|
+
description = "A library for composing quantum machine learning."
|
|
20
|
+
authors = [{ name = "Apache Mahout", email = "dev@mahout.apache.org" }]
|
|
21
|
+
license = "Apache-2.0"
|
|
22
|
+
requires-python = ">=3.10,<3.13"
|
|
23
|
+
readme = "README.md"
|
|
24
|
+
dependencies = [
|
|
25
|
+
"qiskit>=2.2.0,<3.0.0",
|
|
26
|
+
"qiskit-aer>=0.17.2,<0.18.0",
|
|
27
|
+
"cirq>=1.5.0,<1.6.0",
|
|
28
|
+
"amazon-braket-sdk>=1.108.0,<2.0",
|
|
29
|
+
"sympy>=1.14.0,<2.0",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.optional-dependencies]
|
|
33
|
+
qdp = ["qumat-qdp"]
|
|
34
|
+
|
|
35
|
+
[dependency-groups]
|
|
36
|
+
dev = [
|
|
37
|
+
"pytest>=9.0.1",
|
|
38
|
+
"ruff>=0.13.1",
|
|
39
|
+
"pre-commit>=3.0.0",
|
|
40
|
+
"maturin>=1.10.2",
|
|
41
|
+
"patchelf>=0.17.2.4",
|
|
42
|
+
"torch>=2.2,<=2.9.0",
|
|
43
|
+
"numpy>=1.24,<2.0",
|
|
44
|
+
"setuptools>=80.9.0",
|
|
45
|
+
"tensorflow>=2.20",
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
[tool.uv]
|
|
49
|
+
# Override to fix amazon-braket-default-simulator dependency on old numba/llvmlite
|
|
50
|
+
# The simulator v1.32.1 requires numba 0.53.1 which doesn't support Python 3.10+
|
|
51
|
+
override-dependencies = [
|
|
52
|
+
"numba>=0.60.0",
|
|
53
|
+
"llvmlite>=0.43.0",
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
[tool.uv.sources]
|
|
57
|
+
qumat-qdp = { path = "qdp/qdp-python", editable = true }
|
|
58
|
+
|
|
59
|
+
[tool.pytest.ini_options]
|
|
60
|
+
testpaths = ["testing"]
|
|
61
|
+
python_files = "test_*.py"
|
|
62
|
+
python_functions = "test_*"
|
|
63
|
+
addopts = ["-v", "--tb=short", "-rs"]
|
|
64
|
+
markers = [
|
|
65
|
+
"gpu: marks tests as requiring GPU and _qdp extension (auto-skipped if unavailable)",
|
|
66
|
+
"slow: marks tests as slow running",
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
[build-system]
|
|
70
|
+
requires = ["hatchling"]
|
|
71
|
+
build-backend = "hatchling.build"
|
|
72
|
+
|
|
73
|
+
[tool.hatch.build.targets.sdist]
|
|
74
|
+
only-include = [
|
|
75
|
+
"qumat",
|
|
76
|
+
"LICENSE",
|
|
77
|
+
"README.md",
|
|
78
|
+
]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
# contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
# this work for additional information regarding copyright ownership.
|
|
5
|
+
# The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
# (the "License"); you may not use this file except in compliance with
|
|
7
|
+
# the License. You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
|
|
17
|
+
from .qumat import QuMat
|
|
18
|
+
from . import qdp
|
|
19
|
+
|
|
20
|
+
__all__ = ["QuMat", "qdp"]
|