superquantx 0.1.0__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.
- superquantx/__init__.py +321 -0
- superquantx/algorithms/__init__.py +55 -0
- superquantx/algorithms/base_algorithm.py +413 -0
- superquantx/algorithms/hybrid_classifier.py +628 -0
- superquantx/algorithms/qaoa.py +406 -0
- superquantx/algorithms/quantum_agents.py +1006 -0
- superquantx/algorithms/quantum_kmeans.py +575 -0
- superquantx/algorithms/quantum_nn.py +544 -0
- superquantx/algorithms/quantum_pca.py +499 -0
- superquantx/algorithms/quantum_svm.py +346 -0
- superquantx/algorithms/vqe.py +553 -0
- superquantx/algorithms.py +863 -0
- superquantx/backends/__init__.py +265 -0
- superquantx/backends/base_backend.py +321 -0
- superquantx/backends/braket_backend.py +420 -0
- superquantx/backends/cirq_backend.py +466 -0
- superquantx/backends/ocean_backend.py +491 -0
- superquantx/backends/pennylane_backend.py +419 -0
- superquantx/backends/qiskit_backend.py +451 -0
- superquantx/backends/simulator_backend.py +455 -0
- superquantx/backends/tket_backend.py +519 -0
- superquantx/circuits.py +447 -0
- superquantx/cli/__init__.py +28 -0
- superquantx/cli/commands.py +528 -0
- superquantx/cli/main.py +254 -0
- superquantx/client.py +298 -0
- superquantx/config.py +326 -0
- superquantx/exceptions.py +287 -0
- superquantx/gates.py +588 -0
- superquantx/logging_config.py +347 -0
- superquantx/measurements.py +702 -0
- superquantx/ml.py +936 -0
- superquantx/noise.py +760 -0
- superquantx/utils/__init__.py +83 -0
- superquantx/utils/benchmarking.py +523 -0
- superquantx/utils/classical_utils.py +575 -0
- superquantx/utils/feature_mapping.py +467 -0
- superquantx/utils/optimization.py +410 -0
- superquantx/utils/quantum_utils.py +456 -0
- superquantx/utils/visualization.py +654 -0
- superquantx/version.py +33 -0
- superquantx-0.1.0.dist-info/METADATA +365 -0
- superquantx-0.1.0.dist-info/RECORD +46 -0
- superquantx-0.1.0.dist-info/WHEEL +4 -0
- superquantx-0.1.0.dist-info/entry_points.txt +2 -0
- superquantx-0.1.0.dist-info/licenses/LICENSE +21 -0
superquantx/__init__.py
ADDED
@@ -0,0 +1,321 @@
|
|
1
|
+
"""SuperQuantX: Experimental Quantum AI Research Platform.
|
2
|
+
|
3
|
+
⚠️ RESEARCH SOFTWARE WARNING: This is experimental research software developed by
|
4
|
+
SuperXLab (Superagentic AI Research Division). NOT intended for production use.
|
5
|
+
For research and educational purposes only.
|
6
|
+
|
7
|
+
Part of SuperXLab's comprehensive quantum research program - the practical implementation
|
8
|
+
platform for validating theoretical research in:
|
9
|
+
🔬 Quantum-Inspired Agentic Systems: Superposition, interference, entanglement in agents
|
10
|
+
🔬 Quantum Neural Networks (QNNs): Hardware-validated quantum neural architectures
|
11
|
+
🔬 QuantumML for AI Training: Quantum-accelerated machine learning techniques
|
12
|
+
🔬 Quantinuum Integration: Real hardware validation on H-Series quantum computers
|
13
|
+
|
14
|
+
Research Examples:
|
15
|
+
Experimental quantum agent research:
|
16
|
+
>>> import superquantx as sqx # EXPERIMENTAL
|
17
|
+
>>> agent = sqx.QuantumTradingAgent(strategy="quantum_portfolio", backend="simulator")
|
18
|
+
>>> results = agent.solve(research_data) # Research use only
|
19
|
+
>>> print(f"Research findings: {results.metadata}")
|
20
|
+
|
21
|
+
Quantum neural network experiments:
|
22
|
+
>>> qnn = sqx.QuantumNN(architecture='hybrid', backend='pennylane') # EXPERIMENTAL
|
23
|
+
>>> qnn.fit(X_research, y_research) # Research data only
|
24
|
+
>>> analysis = qnn.analyze_expressivity() # Research analysis
|
25
|
+
|
26
|
+
Quantum algorithm benchmarking:
|
27
|
+
>>> qsvm = sqx.QuantumSVM(backend='simulator') # EXPERIMENTAL
|
28
|
+
>>> benchmark = sqx.benchmark_algorithm(qsvm, classical_baseline)
|
29
|
+
"""
|
30
|
+
|
31
|
+
import logging
|
32
|
+
from typing import Any, Dict
|
33
|
+
|
34
|
+
# Core imports - make available at top level
|
35
|
+
from . import algorithms, backends, cli, datasets, utils
|
36
|
+
from .config import config, configure
|
37
|
+
from .version import __version__
|
38
|
+
|
39
|
+
|
40
|
+
# Quantum AI Agents (High-level interface)
|
41
|
+
try:
|
42
|
+
from .algorithms.quantum_agents import (
|
43
|
+
QuantumClassificationAgent,
|
44
|
+
QuantumOptimizationAgent,
|
45
|
+
QuantumPortfolioAgent,
|
46
|
+
QuantumResearchAgent,
|
47
|
+
QuantumTradingAgent,
|
48
|
+
)
|
49
|
+
except (ImportError, AttributeError):
|
50
|
+
# Fallback classes for when agents module isn't fully implemented
|
51
|
+
QuantumTradingAgent = None
|
52
|
+
QuantumResearchAgent = None
|
53
|
+
QuantumOptimizationAgent = None
|
54
|
+
QuantumClassificationAgent = None
|
55
|
+
QuantumPortfolioAgent = None
|
56
|
+
|
57
|
+
# Quantum AutoML
|
58
|
+
try:
|
59
|
+
from .ml import QuantumAutoML
|
60
|
+
except (ImportError, AttributeError, NameError):
|
61
|
+
# QuantumAutoML temporarily disabled due to dependency issues
|
62
|
+
QuantumAutoML = None
|
63
|
+
|
64
|
+
# Core quantum algorithms
|
65
|
+
from .algorithms import (
|
66
|
+
QAOA,
|
67
|
+
VQE,
|
68
|
+
HybridClassifier,
|
69
|
+
QuantumKMeans,
|
70
|
+
QuantumNN,
|
71
|
+
QuantumPCA,
|
72
|
+
QuantumSVM,
|
73
|
+
)
|
74
|
+
from .backends import (
|
75
|
+
BaseBackend,
|
76
|
+
SimulatorBackend,
|
77
|
+
check_backend_compatibility,
|
78
|
+
get_backend,
|
79
|
+
list_available_backends,
|
80
|
+
)
|
81
|
+
|
82
|
+
|
83
|
+
# Import available backends gracefully
|
84
|
+
try:
|
85
|
+
from .backends import QiskitBackend
|
86
|
+
except (ImportError, AttributeError):
|
87
|
+
QiskitBackend = None
|
88
|
+
|
89
|
+
try:
|
90
|
+
from .backends import PennyLaneBackend
|
91
|
+
except (ImportError, AttributeError):
|
92
|
+
PennyLaneBackend = None
|
93
|
+
|
94
|
+
try:
|
95
|
+
from .backends import CirqBackend
|
96
|
+
except (ImportError, AttributeError):
|
97
|
+
CirqBackend = None
|
98
|
+
|
99
|
+
try:
|
100
|
+
from .backends import BraketBackend
|
101
|
+
except (ImportError, AttributeError):
|
102
|
+
BraketBackend = None
|
103
|
+
|
104
|
+
try:
|
105
|
+
from .backends import TKETBackend
|
106
|
+
except (ImportError, AttributeError):
|
107
|
+
TKETBackend = None
|
108
|
+
|
109
|
+
try:
|
110
|
+
from .backends import OceanBackend
|
111
|
+
except (ImportError, AttributeError):
|
112
|
+
OceanBackend = None
|
113
|
+
|
114
|
+
# Create dummy classes for non-existent backends
|
115
|
+
class AutoBackend:
|
116
|
+
"""Auto backend selection (wrapper around get_backend)."""
|
117
|
+
|
118
|
+
def __new__(cls, **kwargs):
|
119
|
+
return get_backend('auto', **kwargs)
|
120
|
+
|
121
|
+
# Aliases for compatibility
|
122
|
+
QuantinuumBackend = TKETBackend # Quantinuum uses TKET
|
123
|
+
DWaveBackend = OceanBackend # D-Wave uses Ocean SDK
|
124
|
+
AWSBackend = BraketBackend # AWS uses Braket
|
125
|
+
|
126
|
+
# Not yet implemented
|
127
|
+
AzureBackend = None
|
128
|
+
CuQuantumBackend = None
|
129
|
+
ForestBackend = None
|
130
|
+
TensorFlowQuantumBackend = None
|
131
|
+
ClassicalBackend = SimulatorBackend
|
132
|
+
|
133
|
+
try:
|
134
|
+
from .datasets import (
|
135
|
+
generate_portfolio_data,
|
136
|
+
load_iris_quantum,
|
137
|
+
load_molecule,
|
138
|
+
)
|
139
|
+
except ImportError:
|
140
|
+
# Fallback if datasets module has issues
|
141
|
+
load_iris_quantum = None
|
142
|
+
generate_portfolio_data = None
|
143
|
+
load_molecule = None
|
144
|
+
|
145
|
+
try:
|
146
|
+
from .utils import (
|
147
|
+
QuantumFeatureMap,
|
148
|
+
benchmark_algorithm,
|
149
|
+
optimize_circuit,
|
150
|
+
visualize_results,
|
151
|
+
)
|
152
|
+
except ImportError:
|
153
|
+
# Fallback if utils module has issues
|
154
|
+
optimize_circuit = None
|
155
|
+
visualize_results = None
|
156
|
+
benchmark_algorithm = None
|
157
|
+
QuantumFeatureMap = None
|
158
|
+
|
159
|
+
# Set up logging
|
160
|
+
logging.getLogger(__name__).addHandler(logging.NullHandler())
|
161
|
+
|
162
|
+
# Package metadata
|
163
|
+
__title__ = "SuperQuantX"
|
164
|
+
__description__ = "Experimental Quantum AI Research Platform - NOT for production use"
|
165
|
+
__author__ = "SuperXLab - Superagentic AI Research Division"
|
166
|
+
__author_email__ = "research@superagentic.ai"
|
167
|
+
__license__ = "MIT (Research and Educational Use)"
|
168
|
+
__url__ = "https://github.com/superagentic/superquantx"
|
169
|
+
|
170
|
+
# Version information
|
171
|
+
def get_version() -> str:
|
172
|
+
"""Get SuperQuantX version."""
|
173
|
+
return __version__
|
174
|
+
|
175
|
+
def get_backend_info() -> Dict[str, Any]:
|
176
|
+
"""Get information about available backends."""
|
177
|
+
info = {}
|
178
|
+
|
179
|
+
# Check which backends are available
|
180
|
+
try:
|
181
|
+
import pennylane
|
182
|
+
info['pennylane'] = pennylane.__version__
|
183
|
+
except ImportError:
|
184
|
+
info['pennylane'] = None
|
185
|
+
|
186
|
+
try:
|
187
|
+
import qiskit
|
188
|
+
info['qiskit'] = qiskit.__version__
|
189
|
+
except ImportError:
|
190
|
+
info['qiskit'] = None
|
191
|
+
|
192
|
+
try:
|
193
|
+
import cirq
|
194
|
+
info['cirq'] = cirq.__version__
|
195
|
+
except ImportError:
|
196
|
+
info['cirq'] = None
|
197
|
+
|
198
|
+
try:
|
199
|
+
import braket
|
200
|
+
info['braket'] = braket.__version__
|
201
|
+
except ImportError:
|
202
|
+
info['braket'] = None
|
203
|
+
|
204
|
+
try:
|
205
|
+
import azure.quantum
|
206
|
+
info['azure_quantum'] = azure.quantum.__version__
|
207
|
+
except (ImportError, AttributeError):
|
208
|
+
info['azure_quantum'] = None
|
209
|
+
|
210
|
+
try:
|
211
|
+
import pytket
|
212
|
+
info['pytket'] = pytket.__version__
|
213
|
+
except ImportError:
|
214
|
+
info['pytket'] = None
|
215
|
+
|
216
|
+
try:
|
217
|
+
import dwave
|
218
|
+
info['dwave'] = dwave.ocean.__version__
|
219
|
+
except (ImportError, AttributeError):
|
220
|
+
info['dwave'] = None
|
221
|
+
|
222
|
+
try:
|
223
|
+
import pyquil
|
224
|
+
info['pyquil'] = pyquil.__version__
|
225
|
+
except ImportError:
|
226
|
+
info['pyquil'] = None
|
227
|
+
|
228
|
+
try:
|
229
|
+
import tensorflow_quantum
|
230
|
+
info['tensorflow_quantum'] = tensorflow_quantum.__version__
|
231
|
+
except ImportError:
|
232
|
+
info['tensorflow_quantum'] = None
|
233
|
+
|
234
|
+
try:
|
235
|
+
import cuquantum
|
236
|
+
info['cuquantum'] = cuquantum.__version__
|
237
|
+
except (ImportError, AttributeError):
|
238
|
+
info['cuquantum'] = None
|
239
|
+
|
240
|
+
return info
|
241
|
+
|
242
|
+
def print_system_info() -> None:
|
243
|
+
"""Print system and backend information."""
|
244
|
+
import platform
|
245
|
+
import sys
|
246
|
+
|
247
|
+
print(f"SuperQuantX version: {__version__}")
|
248
|
+
print(f"Python version: {sys.version}")
|
249
|
+
print(f"Platform: {platform.platform()}")
|
250
|
+
print("\nBackend versions:")
|
251
|
+
|
252
|
+
backend_info = get_backend_info()
|
253
|
+
for backend, version in backend_info.items():
|
254
|
+
status = version if version else "Not installed"
|
255
|
+
print(f" {backend}: {status}")
|
256
|
+
|
257
|
+
# Make commonly used functions available at package level
|
258
|
+
__all__ = [
|
259
|
+
# Version and info
|
260
|
+
"__version__",
|
261
|
+
"get_version",
|
262
|
+
"get_backend_info",
|
263
|
+
"print_system_info",
|
264
|
+
|
265
|
+
# Configuration
|
266
|
+
"config",
|
267
|
+
"configure",
|
268
|
+
|
269
|
+
# Backend functions
|
270
|
+
"get_backend",
|
271
|
+
"list_available_backends",
|
272
|
+
"check_backend_compatibility",
|
273
|
+
|
274
|
+
# Modules
|
275
|
+
"algorithms",
|
276
|
+
"backends",
|
277
|
+
"datasets",
|
278
|
+
"utils",
|
279
|
+
"cli",
|
280
|
+
|
281
|
+
# Common algorithms
|
282
|
+
"QuantumSVM",
|
283
|
+
"QAOA",
|
284
|
+
"VQE",
|
285
|
+
"QuantumNN",
|
286
|
+
"QuantumPCA",
|
287
|
+
"QuantumKMeans",
|
288
|
+
"HybridClassifier",
|
289
|
+
|
290
|
+
# Common backends
|
291
|
+
"AutoBackend",
|
292
|
+
"QiskitBackend",
|
293
|
+
"PennyLaneBackend",
|
294
|
+
"CirqBackend",
|
295
|
+
"BraketBackend",
|
296
|
+
"TKETBackend",
|
297
|
+
"OceanBackend",
|
298
|
+
|
299
|
+
# Aliases
|
300
|
+
"QuantinuumBackend", # -> TKETBackend
|
301
|
+
"DWaveBackend", # -> OceanBackend
|
302
|
+
"AWSBackend", # -> BraketBackend
|
303
|
+
|
304
|
+
# Not yet implemented
|
305
|
+
"AzureBackend",
|
306
|
+
"CuQuantumBackend",
|
307
|
+
"ForestBackend",
|
308
|
+
"TensorFlowQuantumBackend",
|
309
|
+
"ClassicalBackend",
|
310
|
+
|
311
|
+
# Common datasets
|
312
|
+
"load_iris_quantum",
|
313
|
+
"generate_portfolio_data",
|
314
|
+
"load_molecule",
|
315
|
+
|
316
|
+
# Common utils
|
317
|
+
"optimize_circuit",
|
318
|
+
"visualize_results",
|
319
|
+
"benchmark_algorithm",
|
320
|
+
"QuantumFeatureMap",
|
321
|
+
]
|
@@ -0,0 +1,55 @@
|
|
1
|
+
"""Quantum AI algorithms and autonomous agents.
|
2
|
+
|
3
|
+
This module provides the core algorithms powering quantum agentic AI systems,
|
4
|
+
from traditional quantum ML algorithms to autonomous quantum agents that can
|
5
|
+
make decisions and optimize complex problems independently.
|
6
|
+
|
7
|
+
The module is organized in layers:
|
8
|
+
- Quantum ML Algorithms: QSVM, VQE, QAOA, Quantum NN
|
9
|
+
- Quantum AI Models: Advanced neural networks and transformers
|
10
|
+
- Quantum Agents: Autonomous systems for trading, research, optimization
|
11
|
+
- Hybrid Intelligence: Quantum-classical integrated systems
|
12
|
+
"""
|
13
|
+
|
14
|
+
from .base_algorithm import BaseQuantumAlgorithm, QuantumResult
|
15
|
+
from .hybrid_classifier import HybridClassifier
|
16
|
+
from .qaoa import QAOA
|
17
|
+
from .quantum_agents import (
|
18
|
+
QuantumAgent,
|
19
|
+
QuantumClassificationAgent,
|
20
|
+
QuantumOptimizationAgent,
|
21
|
+
QuantumPortfolioAgent,
|
22
|
+
)
|
23
|
+
from .quantum_kmeans import QuantumKMeans
|
24
|
+
from .quantum_nn import QuantumNeuralNetwork, QuantumNN
|
25
|
+
from .quantum_pca import QuantumPCA
|
26
|
+
from .quantum_svm import QuantumSVM
|
27
|
+
from .vqe import VQE, create_vqe_for_molecule
|
28
|
+
|
29
|
+
|
30
|
+
__all__ = [
|
31
|
+
# Base classes
|
32
|
+
"BaseQuantumAlgorithm",
|
33
|
+
"QuantumResult",
|
34
|
+
|
35
|
+
# Classification algorithms
|
36
|
+
"QuantumSVM",
|
37
|
+
"QuantumNN",
|
38
|
+
"QuantumNeuralNetwork",
|
39
|
+
"HybridClassifier",
|
40
|
+
|
41
|
+
# Optimization algorithms
|
42
|
+
"QAOA",
|
43
|
+
"VQE",
|
44
|
+
"create_vqe_for_molecule",
|
45
|
+
|
46
|
+
# Unsupervised learning
|
47
|
+
"QuantumPCA",
|
48
|
+
"QuantumKMeans",
|
49
|
+
|
50
|
+
# Pre-built agents
|
51
|
+
"QuantumAgent",
|
52
|
+
"QuantumPortfolioAgent",
|
53
|
+
"QuantumOptimizationAgent",
|
54
|
+
"QuantumClassificationAgent",
|
55
|
+
]
|