Skip to main content

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 params
  • end() → 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

mobiu_q-1.0.4.tar.gz (12.5 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-1.0.4-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mobiu_q-1.0.4.tar.gz
Algorithm Hash digest
SHA256 c50c73b0a37d24526cf0414302ff3e9064d108782bd329c388c3cc484090c27a
MD5 3e594c25d229b4cc4dc47de26cc7e392
BLAKE2b-256 b1b08d14d3ea1cbd5a3c804086412aff498f83d2faeb4a96d5b5a10de0b86060

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mobiu_q-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 11.7 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-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 161d107522bd661fd715f80ffea1ac39119d97c39f8c9a79ba454a59455499b6
MD5 41bf239cc6015d96b6bc9bcadabe91b7
BLAKE2b-256 8132633879d199e979595bd8832e96eafc9cafc62d94c01aea72ea09f1cd62c3

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