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
- Soft Algebra update rule for stable convergence
- SPSA Demeasurement for noisy hardware
- Adaptive "Noisy Mode" presets
- Validated on real quantum hardware (IBM)
📦 Installation
pip install mobiu-q
🔑 License
from mobiu_q import activate_license
activate_license("YOUR-LICENSE-KEY")
- Free tier: 5 runs/month
- Pro tier: Unlimited runs
🚀 Quick Start (Simulation)
Best for clean simulations or statevector backends.
import numpy as np
from mobiu_q import MobiuQCore, Demeasurement, get_energy_function
energy_fn = get_energy_function("h2_molecule")
# Initialize in standard mode
opt = MobiuQCore(mode="standard")
params = np.random.uniform(-np.pi, np.pi, 6)
for step in range(50):
E = energy_fn(params)
grad = Demeasurement.finite_difference(energy_fn, params)
params = opt.step(params, grad, E)
opt.end() # End session
⚡ Real Hardware / Shot Noise
When running on noisy quantum computers (IBM, IonQ) or simulators with shot noise:
# Initialize in noisy mode (robust learning)
opt = MobiuQCore(mode="noisy")
for step in range(100):
# SPSA returns gradient AND energy estimate (saves 50% measurements)
grad, E = Demeasurement.spsa(energy_fn, params, c_shift=0.1)
params = opt.step(params, grad, E)
opt.end()
📊 Performance Results
Clean Simulation
Tested on H2 molecule (6 params), 100 seeds:
| Optimizer | Gap to Ground State | Improvement |
|---|---|---|
| Adam | 0.089 | - |
| Mobiu-Q | 0.034 | +62% ✅ |
Shot Noise Simulation
Tested on Transverse Ising (4 qubits), 30 seeds:
| Shots | Adam Gap | Mobiu-Q Gap | Improvement | p-value |
|---|---|---|---|---|
| 1000 | 1.63 | 1.48 | +9.2% | 0.002 ✅ |
| 500 | 1.65 | 1.49 | +9.8% | 0.002 ✅ |
| 50 | 2.00 | 1.82 | +9.2% | 0.009 ✅ |
Real Quantum Hardware (IBM Fez)
H2 molecule optimization:
| Metric | Result |
|---|---|
| Initial gap | 0.22 |
| Final gap | 0.034 |
| Improvement | 85% ✅ |
💡 Choosing the Right Mode
| Scenario | Mode | Gradient Method |
|---|---|---|
| Clean simulation (statevector) | standard |
finite_difference |
| Shot noise simulation | noisy |
spsa |
| Real quantum hardware | noisy |
spsa |
Mode Settings
| Mode | Learning Rate | Best For |
|---|---|---|
standard |
0.05 | Simulators (Qiskit Aer, PennyLane, Cirq) |
noisy |
0.02 | Real hardware (IBM, IonQ, Rigetti) |
📚 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', ...]
energy_fn = get_energy_function("h2_molecule")
E0 = get_ground_state_energy("h2_molecule")
⚙️ API Reference
MobiuQCore
MobiuQCore(
license_key=None, # Your license key (or use activate_license())
mode="standard", # 'standard' or 'noisy'
base_lr=None, # Custom learning rate (overrides mode)
verbose=True # Print session messages
)
Methods:
step(params, gradient, energy)→ updated paramsend()→ close session
Demeasurement
# For clean simulations (2*N function calls)
grad = Demeasurement.finite_difference(fn, params)
# For noisy environments (only 2 function calls!)
grad, energy = Demeasurement.spsa(fn, params, c_shift=0.1)
🔥 Full Example: IBM Hardware
from qiskit_ibm_runtime import QiskitRuntimeService, EstimatorV2
from mobiu_q import MobiuQCore, Demeasurement
service = QiskitRuntimeService(channel="ibm_quantum")
backend = service.least_busy(simulator=False, min_num_qubits=5)
estimator = EstimatorV2(mode=backend)
opt = MobiuQCore(mode="noisy")
for step in range(60):
grad, energy = Demeasurement.spsa(
lambda p: estimator.run([(circuit, observable)]).result()[0].data.evs.item(),
params,
c_shift=0.12
)
params = opt.step(params, grad, energy)
opt.end()
© 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.5.tar.gz.
File metadata
- Download URL: mobiu_q-1.0.5.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3162b10b478b6a082aa0fe4eb7a80b52a1ca25c7376d26b4c02f5492c64eec05
|
|
| MD5 |
46c197e0e4edbcfeb569bd1c0b7fcd08
|
|
| BLAKE2b-256 |
eab24ac7777c25abba86d5c846a74ac5e4e1d9f362527747235a56c5eb21eb01
|
File details
Details for the file mobiu_q-1.0.5-py3-none-any.whl.
File metadata
- Download URL: mobiu_q-1.0.5-py3-none-any.whl
- Upload date:
- Size: 12.3 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 |
3e6cdfd43841a313acda2e8ccf763177f16499acd4dd6b79b62b4ae1a8170d6e
|
|
| MD5 |
0ea2a785ea461108272cbecd91da4684
|
|
| BLAKE2b-256 |
a308f8639c7102e7af540c4abd3047a29664ee7ee9f7e6efbff5052482860f61
|