Skip to main content

Soft Algebra Optimizer for Quantum & Complex Optimization

Project description

Mobiu-Q v2.7.8

PyPI version License

Mobiu-Q wraps your existing optimizer with Soft Algebra to filter noise and improve convergence. Same API, better results.


⚡ Quick Start

from mobiu_q import MobiuOptimizer

# PyTorch (RL, LLM, Deep Learning)
opt = MobiuOptimizer(torch_optimizer, method="adaptive")

# Quantum VQE (clean simulator)
opt = MobiuOptimizer(params, method="standard", mode="simulation")

# Quantum VQE (real/noisy hardware)
opt = MobiuOptimizer(params, method="standard", mode="hardware")

# QAOA (combinatorial optimization)
opt = MobiuOptimizer(params, method="deep", mode="hardware")

🔧 Configuration

Methods

Method Best For Default LR
standard VQE, Chemistry, smooth landscapes 0.01 (sim) / 0.02 (hw)
deep QAOA, combinatorial, rugged landscapes 0.1
adaptive RL, LLM, high-variance problems 0.0003

Modes (Quantum only)

Mode When to Use Gradient Method
simulation Clean simulator (Qiskit Aer, PennyLane default) Finite Difference (2N evals)
hardware Real quantum hardware, FakeFez, noisy backends SPSA (2 evals, noise-resilient)

Rule of thumb: If your backend has noise → use hardware. If it's a perfect simulator → use simulation.

Base Optimizers

Available: Adam (default), AdamW, NAdam, AMSGrad, SGD, Momentum, LAMB

Note: Optimizer names are case-sensitive!

A/B Testing Parameter

# For fair comparisons, toggle Soft Algebra:
opt = MobiuOptimizer(params, use_soft_algebra=True)   # Default - SA enabled
opt = MobiuOptimizer(params, use_soft_algebra=False)  # Baseline - SA disabled

📦 Installation

pip install mobiu-q

🎯 Usage Examples

PyTorch (RL / LLM / Deep Learning)

import torch
from mobiu_q import MobiuOptimizer

model = MyModel()
base_opt = torch.optim.Adam(model.parameters(), lr=0.0003)
opt = MobiuOptimizer(base_opt, method="adaptive")

for epoch in range(100):
    loss = criterion(model(x), y)
    loss.backward()
    opt.step(loss.item())  # Pass loss for Soft Algebra
    opt.zero_grad()

opt.end()

Quantum VQE (Simulation)

from mobiu_q import MobiuOptimizer
import numpy as np

params = np.random.randn(10)
opt = MobiuOptimizer(params, method="standard", mode="simulation")

for step in range(100):
    params = opt.step(params, energy_fn)  # Auto-computes gradient

opt.end()

Quantum VQE (Real Hardware / FakeFez)

from mobiu_q import MobiuOptimizer

opt = MobiuOptimizer(params, method="standard", mode="hardware")

for step in range(100):
    params = opt.step(params, energy_fn)  # Uses SPSA gradient

opt.end()

QAOA (Combinatorial Optimization)

from mobiu_q import MobiuOptimizer

opt = MobiuOptimizer(params, method="deep", mode="hardware")

for step in range(150):
    params = opt.step(params, maxcut_cost_fn)

opt.end()

🏆 Verified Benchmark Results

All benchmarks use fair A/B testing: Soft Algebra ON vs OFF, same seeds, same conditions.

🧪 Fair Testing Methodology

# How we test - you can reproduce this yourself:
opt_baseline = MobiuOptimizer(params, use_soft_algebra=False)  # SA OFF
opt_mobiu = MobiuOptimizer(params, use_soft_algebra=True)      # SA ON

# Same seed, same problem, same everything - only SA differs

This ensures improvements come from Soft Algebra, not different hyperparameters.

⚛️ Quantum VQE on IBM FakeFez

Molecule Qubits Improvement Win Rate
H₂ 2 +52.5% 100%
BeH₂ 6 +55.1% 100%
LiH 4 +34.5% 100%

🎯 QAOA on IBM FakeFez

Problem Improvement p-value
MaxCut +45.1% 0.0003

🎮 Reinforcement Learning

Environment Improvement Win Rate
LunarLander-v3 +127.8% 96.7%
MuJoCo InvertedPendulum +111% 100%
MuJoCo Hopper +41% 80%

💰 Finance

Problem Improvement
Credit Risk +52.3%
Portfolio Optimization +51.7%

🛠️ Troubleshooting

Not Improving?

  1. Switch optimizer: Try NAdam or Momentum
  2. Switch method: standardadaptivedeep
  3. Adjust LR: Diverging → lower by 2-5x, stuck → raise by 2x

Quantum Specific

  • Noisy results? Use mode="hardware" (enables SPSA)
  • Clean simulator? Use mode="simulation" (uses finite difference)

🔬 How It Works

Mobiu-Q is based on Soft Algebra from Klein/Maimon theory:

SoftNumber multiplication (ε²=0):
(a, b) × (c, d) = (ad + bc, bd)

The Super-Equation Δ† detects emergence moments for adaptive scaling.


💰 Pricing

Tier Price Runs
Free $0 20 runs/month
Pro $19/month Unlimited

Get your key at app.mobiu.ai


🧑‍🔬 Scientific Foundation

Based on Soft Numbers theory developed by Dr. Moshe Klein and Prof. Oded Maimon (Tel Aviv University), as presented in their book on Soft Logic and Soft Numbers.


📚 Links


© 2025 Mobiu Technologies. All rights reserved.

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

mobiu_q-2.7.8.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mobiu_q-2.7.8-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file mobiu_q-2.7.8.tar.gz.

File metadata

  • Download URL: mobiu_q-2.7.8.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for mobiu_q-2.7.8.tar.gz
Algorithm Hash digest
SHA256 da0b9caa5fdf2ddde04959b637e303527012729e7423f85fd2f8d21b06932436
MD5 e43e603d22aed4b6c5755127ba4ba27c
BLAKE2b-256 0d182924a6a0b81cdb8dfbdc6e6927e050ad7a4d8b979a35e304b7ca598466e4

See more details on using hashes here.

File details

Details for the file mobiu_q-2.7.8-py3-none-any.whl.

File metadata

  • Download URL: mobiu_q-2.7.8-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for mobiu_q-2.7.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c22fbe98ced8ed01e83244ba3908ac603985b6328ed432cc4fc1d3421ca860de
MD5 21fbc528dbfeff3b49c43f3e5ff4d6c3
BLAKE2b-256 3d41d0bb2499f661ee379e766ba722a6de04cc1d5ef8dc753a34b3c8c6a76023

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page