mobiu-q 2.5.3__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.
- mobiu_q-2.5.3/PKG-INFO +389 -0
- mobiu_q-2.5.3/README.md +354 -0
- mobiu_q-2.5.3/mobiu_q/__init__.py +131 -0
- mobiu_q-2.5.3/mobiu_q/catalog.py +930 -0
- mobiu_q-2.5.3/mobiu_q/cli.py +48 -0
- mobiu_q-2.5.3/mobiu_q/core.py +795 -0
- mobiu_q-2.5.3/mobiu_q.egg-info/PKG-INFO +389 -0
- mobiu_q-2.5.3/mobiu_q.egg-info/SOURCES.txt +13 -0
- mobiu_q-2.5.3/mobiu_q.egg-info/dependency_links.txt +1 -0
- mobiu_q-2.5.3/mobiu_q.egg-info/entry_points.txt +2 -0
- mobiu_q-2.5.3/mobiu_q.egg-info/requires.txt +10 -0
- mobiu_q-2.5.3/mobiu_q.egg-info/top_level.txt +1 -0
- mobiu_q-2.5.3/pyproject.toml +56 -0
- mobiu_q-2.5.3/setup.cfg +4 -0
- mobiu_q-2.5.3/setup.py +60 -0
mobiu_q-2.5.3/PKG-INFO
ADDED
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mobiu-q
|
|
3
|
+
Version: 2.5.3
|
|
4
|
+
Summary: Soft Algebra Optimizer for Quantum & Complex Optimization
|
|
5
|
+
Home-page: https://mobiu.ai
|
|
6
|
+
Author: Mobiu Technologies
|
|
7
|
+
Author-email: Mobiu Technologies <ai@mobiu.ai>
|
|
8
|
+
License: Proprietary
|
|
9
|
+
Project-URL: Homepage, https://app.mobiu.ai
|
|
10
|
+
Project-URL: Documentation, https://pypi.org/project/mobiu-q/
|
|
11
|
+
Keywords: quantum,optimization,VQE,QAOA,machine-learning
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Requires-Python: >=3.8
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
Requires-Dist: numpy>=1.21.0
|
|
25
|
+
Requires-Dist: requests>=2.25.0
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
28
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
29
|
+
Provides-Extra: full
|
|
30
|
+
Requires-Dist: scipy>=1.7.0; extra == "full"
|
|
31
|
+
Requires-Dist: qiskit>=0.40.0; extra == "full"
|
|
32
|
+
Dynamic: author
|
|
33
|
+
Dynamic: home-page
|
|
34
|
+
Dynamic: requires-python
|
|
35
|
+
|
|
36
|
+
# Mobiu-Q
|
|
37
|
+
|
|
38
|
+
[](https://badge.fury.io/py/mobiu-q)
|
|
39
|
+
[](https://mobiu.ai)
|
|
40
|
+
[](https://mobiu.ai)
|
|
41
|
+
|
|
42
|
+
**Mobiu-Q** wraps your existing optimizer with **Soft Algebra** to filter noise and improve convergence. Same API, better results.
|
|
43
|
+
|
|
44
|
+
Works across **Quantum Computing**, **Reinforcement Learning**, **LLM Fine-tuning**, **Materials Science**, and **FinTech**.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## ๐ What's New in v2.5.3
|
|
49
|
+
|
|
50
|
+
- **LLM Fine-tuning Support**: +23.3% improvement on full fine-tuning, +97% on LoRA
|
|
51
|
+
- **Materials Science**: +98% on Bulk Modulus, +67% on Band Gap prediction
|
|
52
|
+
- **Noise Robustness**: +32.5% more robust to quantum hardware noise
|
|
53
|
+
- **Multi-Optimizer**: Choose from Adam, NAdam, AMSGrad, SGD, Momentum, LAMB
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## ๐ Benchmark Results (v2.5)
|
|
58
|
+
|
|
59
|
+
All benchmarks compare **Optimizer + Soft Algebra** vs **Optimizer alone**. Same learning rate, same seeds, fair A/B test.
|
|
60
|
+
|
|
61
|
+
### ๐ฌ Materials Science (NEW)
|
|
62
|
+
| Task | Improvement | p-value | Win Rate |
|
|
63
|
+
|------|-------------|---------|----------|
|
|
64
|
+
| **Bulk Modulus (GPa)** | **+98.3%** | <0.001 | 100% |
|
|
65
|
+
| **Band Gap (eV)** | **+66.8%** | <0.001 | 100% |
|
|
66
|
+
| **Formation Energy** | **+26.9%** | <0.001 | 100% |
|
|
67
|
+
|
|
68
|
+
### ๐ค LLM Fine-tuning
|
|
69
|
+
| Task | Improvement | p-value | Win Rate |
|
|
70
|
+
|------|-------------|---------|----------|
|
|
71
|
+
| **LoRA r16 + Momentum** | **+97.6%** | <0.001 | 100% |
|
|
72
|
+
| **LoRA r32 + SGD** | **+90.2%** | <0.001 | 100% |
|
|
73
|
+
| **Full Fine-tuning** | **+23.3%** | 0.002 | 100% |
|
|
74
|
+
| **GPT-2 Medium (PPL)** | **+21.2%** | <0.001 | 100% |
|
|
75
|
+
| **Soft Prompt Tuning** | **+18.1%** | <0.05 | 100% |
|
|
76
|
+
|
|
77
|
+
### ๐ฎ Reinforcement Learning
|
|
78
|
+
| Environment | Improvement | p-value | Win Rate |
|
|
79
|
+
|-------------|-------------|---------|----------|
|
|
80
|
+
| **LunarLander-v3** | **+129.7%** | <0.001 | 96.7% |
|
|
81
|
+
| **MuJoCo InvertedPendulum** | **+118.6%** | 0.001 | 100% |
|
|
82
|
+
| **Crypto Trading** | **+10.9% profit** | 0.005 | 90% |
|
|
83
|
+
|
|
84
|
+
### ๐งช Quantum Chemistry (VQE)
|
|
85
|
+
| Problem | Improvement |
|
|
86
|
+
|---------|-------------|
|
|
87
|
+
| **XY Model** | **+60.8%** |
|
|
88
|
+
| **He Atom** | **+51.2%** |
|
|
89
|
+
| **H2 Molecule** | **+46.6%** |
|
|
90
|
+
| **H3+ Chain** | **+42.0%** |
|
|
91
|
+
| **LiH Molecule** | **+41.4%** |
|
|
92
|
+
| **BeH2 Molecule** | **+37.8%** |
|
|
93
|
+
|
|
94
|
+
### ๐ฏ QAOA (Combinatorial Optimization)
|
|
95
|
+
| Problem | Improvement | p-value |
|
|
96
|
+
|---------|-------------|---------|
|
|
97
|
+
| **MaxCut 4-qubit** | **+27.2%** | 0.04 |
|
|
98
|
+
| **MaxCut 5-qubit** | **+23.7%** | 0.004 |
|
|
99
|
+
| **MaxCut p=3** | **+15.6%** | 0.008 |
|
|
100
|
+
|
|
101
|
+
### ๐ก๏ธ Noise Robustness (IBM FakeBackend)
|
|
102
|
+
| Metric | Result |
|
|
103
|
+
|--------|--------|
|
|
104
|
+
| **Robustness Advantage** | **+32.5%** |
|
|
105
|
+
| **Win Rate (all noise levels)** | **80% (12/15)** |
|
|
106
|
+
| **IBM FakeFez VQE** | **+50.9%** (p=0.03) |
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## ๐ฆ Installation
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
pip install mobiu-q
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## โก Quick Start
|
|
119
|
+
|
|
120
|
+
### 1. Materials Science (NEW)
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
from mobiu_q import MobiuQCore
|
|
124
|
+
|
|
125
|
+
opt = MobiuQCore(
|
|
126
|
+
license_key="YOUR-KEY",
|
|
127
|
+
method="standard",
|
|
128
|
+
base_optimizer="adam"
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
for epoch in range(100):
|
|
132
|
+
loss = compute_property_loss(model, batch)
|
|
133
|
+
gradient = compute_gradients()
|
|
134
|
+
|
|
135
|
+
params = opt.step(params, gradient, loss)
|
|
136
|
+
|
|
137
|
+
opt.end()
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### 2. LoRA Fine-tuning
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
opt = MobiuQCore(
|
|
144
|
+
license_key="YOUR-KEY",
|
|
145
|
+
method="adaptive",
|
|
146
|
+
base_optimizer="momentum" # Recommended for LoRA
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
for step in range(1000):
|
|
150
|
+
loss = lora_forward(model, batch)
|
|
151
|
+
gradient = compute_lora_gradients()
|
|
152
|
+
|
|
153
|
+
params = opt.step(params, gradient, loss)
|
|
154
|
+
|
|
155
|
+
opt.end()
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### 3. Reinforcement Learning
|
|
159
|
+
|
|
160
|
+
```python
|
|
161
|
+
opt = MobiuQCore(
|
|
162
|
+
license_key="YOUR-KEY",
|
|
163
|
+
method="adaptive",
|
|
164
|
+
base_optimizer="momentum"
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
for episode in range(1000):
|
|
168
|
+
episode_return = run_episode(policy)
|
|
169
|
+
gradient = compute_policy_gradient()
|
|
170
|
+
|
|
171
|
+
policy_params = opt.step(policy_params, gradient, episode_return)
|
|
172
|
+
|
|
173
|
+
opt.end()
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### 4. VQE (Quantum Chemistry)
|
|
177
|
+
|
|
178
|
+
```python
|
|
179
|
+
from mobiu_q import MobiuQCore, Demeasurement
|
|
180
|
+
|
|
181
|
+
opt = MobiuQCore(
|
|
182
|
+
license_key="YOUR-KEY",
|
|
183
|
+
method="standard"
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
for step in range(100):
|
|
187
|
+
grad = Demeasurement.finite_difference(energy_fn, params)
|
|
188
|
+
params = opt.step(params, grad, energy_fn(params))
|
|
189
|
+
|
|
190
|
+
opt.end()
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### 5. QAOA (Noisy Hardware)
|
|
194
|
+
|
|
195
|
+
```python
|
|
196
|
+
opt = MobiuQCore(
|
|
197
|
+
license_key="YOUR-KEY",
|
|
198
|
+
method="deep",
|
|
199
|
+
mode="hardware"
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
for step in range(150):
|
|
203
|
+
grad, energy = Demeasurement.spsa(energy_fn, params)
|
|
204
|
+
params = opt.step(params, grad, energy)
|
|
205
|
+
|
|
206
|
+
opt.end()
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## ๐ง Configuration
|
|
212
|
+
|
|
213
|
+
### Methods
|
|
214
|
+
|
|
215
|
+
| Method | Best For | Description |
|
|
216
|
+
|--------|----------|-------------|
|
|
217
|
+
| `standard` | VQE, Chemistry, Materials | Trust Ratio + Gradient Warping |
|
|
218
|
+
| `deep` | QAOA, Noisy Hardware | Super-Equation ฮโ for emergence detection |
|
|
219
|
+
| `adaptive` | RL, LLM, LoRA, Trading | Trust + Emergence + Warping combined |
|
|
220
|
+
|
|
221
|
+
### Base Optimizers
|
|
222
|
+
|
|
223
|
+
Choose from: `adam`, `momentum`, `sgd`, `nadam`, `amsgrad`, `lamb`
|
|
224
|
+
|
|
225
|
+
```python
|
|
226
|
+
opt = MobiuQCore(
|
|
227
|
+
license_key="YOUR-KEY",
|
|
228
|
+
method="adaptive",
|
|
229
|
+
base_optimizer="momentum" # Best for RL/LLM
|
|
230
|
+
)
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Modes
|
|
234
|
+
|
|
235
|
+
| Mode | Description |
|
|
236
|
+
|------|-------------|
|
|
237
|
+
| `simulation` | Clean quantum simulation (default) |
|
|
238
|
+
| `hardware` | Noisy quantum hardware |
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## ๐ ๏ธ Troubleshooting
|
|
243
|
+
|
|
244
|
+
If optimization is not improving or diverging, try these adjustments:
|
|
245
|
+
|
|
246
|
+
### 1. Switch Base Optimizer
|
|
247
|
+
|
|
248
|
+
Different optimizers work better for different problems:
|
|
249
|
+
|
|
250
|
+
| Problem Type | Recommended Optimizer |
|
|
251
|
+
|--------------|----------------------|
|
|
252
|
+
| LoRA / LLM | `momentum` (not SGD) |
|
|
253
|
+
| VQE / Chemistry | `adam` |
|
|
254
|
+
| QAOA | `nadam` |
|
|
255
|
+
| RL | `momentum` |
|
|
256
|
+
| Materials Science | `adam` |
|
|
257
|
+
|
|
258
|
+
```python
|
|
259
|
+
# If Adam isn't working, try Momentum:
|
|
260
|
+
opt = MobiuQCore(license_key="KEY", base_optimizer="momentum")
|
|
261
|
+
|
|
262
|
+
# If Momentum isn't working, try NAdam:
|
|
263
|
+
opt = MobiuQCore(license_key="KEY", base_optimizer="nadam")
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### 2. Switch Method
|
|
267
|
+
|
|
268
|
+
| If This Fails | Try This |
|
|
269
|
+
|---------------|----------|
|
|
270
|
+
| `standard` | `adaptive` |
|
|
271
|
+
| `adaptive` | `deep` |
|
|
272
|
+
| `deep` | `standard` |
|
|
273
|
+
|
|
274
|
+
```python
|
|
275
|
+
# If standard isn't working for your problem:
|
|
276
|
+
opt = MobiuQCore(license_key="KEY", method="adaptive")
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### 3. Switch Mode
|
|
280
|
+
|
|
281
|
+
For quantum problems, if `simulation` mode isn't working:
|
|
282
|
+
|
|
283
|
+
```python
|
|
284
|
+
# Try hardware mode (more aggressive noise filtering):
|
|
285
|
+
opt = MobiuQCore(license_key="KEY", mode="hardware")
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### 4. Adjust Learning Rate
|
|
289
|
+
|
|
290
|
+
Soft Algebra works best with moderate learning rates:
|
|
291
|
+
|
|
292
|
+
| Scenario | Recommendation |
|
|
293
|
+
|----------|---------------|
|
|
294
|
+
| Diverging | Lower LR by 2-5x |
|
|
295
|
+
| No improvement | Increase LR by 2x |
|
|
296
|
+
| LoRA specifically | Use LR=0.01-0.03 |
|
|
297
|
+
|
|
298
|
+
### 5. Common Fixes by Domain
|
|
299
|
+
|
|
300
|
+
| Domain | Common Issue | Fix |
|
|
301
|
+
|--------|--------------|-----|
|
|
302
|
+
| **LoRA** | SGD + high LR diverges | Use `momentum` + LR=0.02 |
|
|
303
|
+
| **Drug Discovery** | BCE loss unstable | Use `adam` + `standard` method |
|
|
304
|
+
| **Small Batch LLM** | High variance | Increase batch size or use `deep` method |
|
|
305
|
+
| **Classification** | Cross-entropy issues | Use `adam` + lower LR |
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## ๐ฌ How It Works
|
|
310
|
+
|
|
311
|
+
Mobiu-Q is based on **Soft Algebra**, a mathematical framework that extends real numbers with infinitesimal components using nilpotent arithmetic (ฮตยฒ=0).
|
|
312
|
+
|
|
313
|
+
### Core SoftNumber Multiplication
|
|
314
|
+
|
|
315
|
+
```
|
|
316
|
+
(a, b) ร (c, d) = (ad + bc, bd)
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
Where:
|
|
320
|
+
- `a` = potential (infinitesimal component)
|
|
321
|
+
- `b` = realization (real component)
|
|
322
|
+
|
|
323
|
+
### Evolution Law
|
|
324
|
+
|
|
325
|
+
```
|
|
326
|
+
S_{t+1} = (ฮณ ยท S_t) ยท ฮ_t + ฮ_t
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
This allows gradients to carry both magnitude AND uncertainty information, enabling the optimizer to distinguish real improvement from noise artifacts.
|
|
330
|
+
|
|
331
|
+
### Key Formulas
|
|
332
|
+
|
|
333
|
+
- **Trust Ratio**: `trust = |real| / (|real| + |soft| + ฮต)`
|
|
334
|
+
- **Gradient Warping**: `g_eff = gradient ร soft_factor`
|
|
335
|
+
- **Super-Equation ฮโ **: For emergence detection in rugged landscapes
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
## ๐ฐ Pricing
|
|
340
|
+
|
|
341
|
+
| Tier | Price | Runs |
|
|
342
|
+
|------|-------|------|
|
|
343
|
+
| **Free** | $0 | 20 runs/month |
|
|
344
|
+
| **Pro** | $19/month | Unlimited |
|
|
345
|
+
|
|
346
|
+
Get your license key at [app.mobiu.ai](https://app.mobiu.ai)
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## ๐ Full Benchmark Summary
|
|
351
|
+
|
|
352
|
+
| Domain | Best Result | vs Optimizer |
|
|
353
|
+
|--------|-------------|--------------|
|
|
354
|
+
| **RL (LunarLander)** | +129.7% | vs Momentum |
|
|
355
|
+
| **RL (MuJoCo)** | +118.6% | vs Momentum |
|
|
356
|
+
| **Materials (Bulk Modulus)** | +98.3% | vs Adam |
|
|
357
|
+
| **LoRA (r16 Momentum)** | +97.6% | vs Momentum |
|
|
358
|
+
| **Materials (Band Gap)** | +66.8% | vs Adam |
|
|
359
|
+
| **Quantum (XY Model)** | +60.8% | vs Adam |
|
|
360
|
+
| **Noise Robustness** | +32.5% | vs Momentum |
|
|
361
|
+
| **QAOA MaxCut** | +27.2% | vs NAdam |
|
|
362
|
+
| **LLM Full Fine-tune** | +23.3% | vs Momentum |
|
|
363
|
+
| **Crypto Trading** | +10.9% | vs Momentum |
|
|
364
|
+
|
|
365
|
+
**Overall Win Rate: 80%** across all benchmarks.
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
## ๐งโ๐ฌ Scientific Foundation
|
|
370
|
+
|
|
371
|
+
Developed by **Mobiu Technologies**, based on Soft Algebra theory by:
|
|
372
|
+
- **Dr. Moshe Klein** โ Developer of Soft Logic and Soft Numbers
|
|
373
|
+
- **Prof. Oded Maimon** โ Tel Aviv University, Industrial Engineering
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
## ๐ Links
|
|
378
|
+
|
|
379
|
+
- **Website**: [mobiu.ai](https://mobiu.ai)
|
|
380
|
+
- **App**: [app.mobiu.ai](https://app.mobiu.ai)
|
|
381
|
+
- **PyPI**: [pypi.org/project/mobiu-q](https://pypi.org/project/mobiu-q)
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
## ๐ License
|
|
386
|
+
|
|
387
|
+
Proprietary. See [LICENSE](LICENSE) for details.
|
|
388
|
+
|
|
389
|
+
ยฉ 2025 Mobiu Technologies. All rights reserved.
|