Soft Algebra Optimizer for Quantum & Complex Optimization
Project description
Mobiu-Q
Mobiu-Q is a next-generation optimizer built on Soft Algebra and Demeasurement theory, enabling stable and efficient optimization in quantum variational algorithms (VQE, QAOA).
✨ Features
- +43% improvement over Adam optimizer in VQE benchmarks
- 99.68% accuracy on LiH molecule optimization
- Soft Algebra update rule for stable convergence
- SPSA Demeasurement for noisy hardware (95% fewer measurements)
- Adaptive Trust Ratio - automatically adjusts to noise levels
📦 Installation
pip install mobiu-q
🔑 Get Your License Key
Get your free license key at app.mobiu.ai
Then either:
Option 1: Set environment variable (recommended):
export MOBIU_Q_LICENSE_KEY=your-license-key
Option 2: Pass directly in code:
opt = MobiuQCore(license_key="your-license-key")
🚀 Quick Start
Clean Simulations
import numpy as np
from mobiu_q import MobiuQCore, Demeasurement, get_energy_function
# Load a built-in problem
energy_fn = get_energy_function("h2_molecule")
# Initialize optimizer (uses MOBIU_Q_LICENSE_KEY env var)
opt = MobiuQCore(mode="standard")
# Random starting point
params = np.random.uniform(-np.pi, np.pi, 12)
# Optimization loop
for step in range(100):
E = energy_fn(params)
grad = Demeasurement.finite_difference(energy_fn, params)
params = opt.step(params, grad, E)
if step % 20 == 0:
print(f"Step {step}: E = {E:.6f}")
# Always end the session!
opt.end()
Noisy Quantum Hardware
from mobiu_q import MobiuQCore, Demeasurement, get_energy_function
energy_fn = get_energy_function("h2_molecule")
# For NISQ devices, use noisy mode + SPSA
opt = MobiuQCore(mode="noisy")
params = np.random.uniform(-np.pi, np.pi, 12)
for step in range(100):
# SPSA: Only 2 measurements per step!
grad, E = Demeasurement.spsa(energy_fn, params)
params = opt.step(params, grad, E)
opt.end()
Custom Problem (Your Own Hamiltonian)
import numpy as np
from mobiu_q import MobiuQCore, Demeasurement
# Define your own energy function
def my_energy_fn(params):
# Your quantum circuit / Hamiltonian here
return np.sum(params**2) # Example
opt = MobiuQCore(mode="standard")
params = np.random.uniform(-1, 1, 10)
for step in range(100):
E = my_energy_fn(params)
grad = Demeasurement.finite_difference(my_energy_fn, params)
params = opt.step(params, grad, E)
opt.end()
📊 Built-in Problems
from mobiu_q import list_problems, get_energy_function, get_ground_state_energy
print(list_problems())
# ['h2_molecule', 'lih_molecule', 'transverse_ising', 'heisenberg_xxz',
# 'xy_model', 'h3_chain', 'ferro_ising', 'antiferro_heisenberg',
# 'be2_molecule', 'he4_atom']
energy_fn = get_energy_function("lih_molecule")
E0 = get_ground_state_energy("lih_molecule")
print(f"Ground state energy: {E0}")
⚙️ API Reference
MobiuQCore
MobiuQCore(
license_key=None, # Your license key (or use MOBIU_Q_LICENSE_KEY env var)
mode="standard", # 'standard' (clean) or 'noisy' (quantum hardware)
base_lr=None, # Learning rate (auto-set by mode)
offline_fallback=True # Fall back to plain Adam if API unavailable
)
Methods:
step(params, gradient, energy)→ Returns updated parametersend()→ End session (important - always call this!)reset()→ Reset optimizer for new optimization
Demeasurement
| Method | Measurements | Best For |
|---|---|---|
finite_difference(fn, params) |
2N | Clean simulations |
parameter_shift(fn, params) |
2N | Exact quantum gradients |
spsa(fn, params) |
2 | Noisy quantum hardware |
💰 Pricing
| Tier | Runs/Month | Price |
|---|---|---|
| Free | 20 | $0 |
| Pro | Unlimited | $19/month |
What counts as a "run"?
- A run = one optimization session (start → steps → end)
- Sessions ended within 60 seconds with <5 steps are free (grace period)
Get Pro at app.mobiu.ai
🔒 Security & Privacy
- Your optimization runs on Mobiu's secure cloud (Google Cloud)
- The core Soft Algebra logic stays on our servers
- Your client only sends: parameters, gradients, energy values
- We don't store your data beyond the session
🐛 Troubleshooting
"License key required" → Set your license key via environment variable or pass it directly
"Monthly limit reached" → Upgrade to Pro or wait for next month
"Cannot connect to API" → Check internet connection. If offline_fallback=True, it will use plain Adam
📧 Support
- Email: ai@mobiu.ai
📄 License
Proprietary - see LICENSE.md
© Mobiu Technologies, 2025
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mobiu_q-1.0.1.tar.gz.
File metadata
- Download URL: mobiu_q-1.0.1.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9055b6347c973f61f23ea7ee4217fabcddc5852f05cfc43fef832d08ca78b86
|
|
| MD5 |
7f34056aa5047170b72d95db7e7d8097
|
|
| BLAKE2b-256 |
a8b9ba6b115f99ff812dcb4a00c6d4fae64fbe054e66a8eb5f8fb523cf8049e9
|
File details
Details for the file mobiu_q-1.0.1-py3-none-any.whl.
File metadata
- Download URL: mobiu_q-1.0.1-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb41ea7cb42243709de23887bd8dc3424bc3ff170a03733ce10a123456187484
|
|
| MD5 |
f40f6ed051be72bcbef3ff7677db70d8
|
|
| BLAKE2b-256 |
64989f7f9c84487214879590ed338a330f29d0621d344c0d4ba1a997b11dbd4f
|