Skip to main content

nexus-opt

One modelling API. Rust core. Every problem class.

Linear, mixed-integer, quadratic, conic (SOCP/SDP), nonlinear, black-box, multi-objective and stochastic programming — behind a single interface, so changing problem class doesn't mean changing library.

License: MIT Python Rust

Website · User guide · Energy layer


Install

pip install nexus-opt

Prebuilt wheels for Linux (glibc and musl; x86_64 / aarch64 / i686), macOS (arm64 and x86_64) and Windows (x64 and x86). The crate builds as an abi3 extension, so one wheel per platform serves every CPython from 3.9 up — and no Rust toolchain is needed to install.

Not yet on PyPI. The wheel matrix is built and verified but publication is pending. Until then, see Building from source.

Sixty seconds

import nexus_opt as nx

m = nx.Model()
x = m.variable("x", lower=0)
y = m.variable("y", lower=0)

m.add(x + y >= 10)
m.add(x <= 6)
m.minimize(2 * x + 3 * y)

r = m.solve()
print(r.status, r.objective, r.value(x), r.value(y))
# optimal 24.0 6.0 4.0

Variables are continuous, integer or binary. Constraints are written with ordinary <=, >=, == and compile straight to Rust structures; nx.sum() reduces expressions in parallel.

What's in it

Quadratic and conic. Quadratic objectives compile to native quadratic terms. Second-order cones via add_soc([head, x1, ..., xk]) (imposing t >= ||x||₂), PSD cones over the lower-triangular entries of a symmetric matrix, and quad_form(model, xs, P) which builds xᵀPx and validates that P is PSD.

Nonlinear. sin, cos, sqrt and division are first-class expression operators, not wrappers. Nonlinear constraints live in a parallel container, so the LP/QP presolve path stays untouched and bit-identical.

Black-box and metaheuristics. Differential evolution, particle swarm, simulated annealing and CMA-ES:

r = nx.solve_de(lambda x: x[0]**2 + x[1]**2, [(-5, 5), (-5, 5)])

nx.solve_portfolio(...) races several algorithms against the same objective and returns the best.

Multi-objective and stochastic. pareto_frontier(...), stochastic_solve(...).

Scale. solve_parallel_de, solve_admm, and PersistentHighs for warm-started re-solves across a sequence of related problems.

See WIKI.md for the full API reference.

Who uses it

nexus-energy is built directly on this core — capacity expansion, unit commitment and OPF at exact parity with PyPSA and GenX, several times faster. If you want the energy-system layer rather than the solver, start there.

Benchmarks

benchmarks/ holds the comparison harness and stored results (benchmarks/_results/*.jsonl) against scipy, cvxpy, PuLP, Pyomo, Optuna and Nevergrad.

Third-party solvers appear there only as comparison rows — they are never wrapped inside the library.

Building from source

git clone https://github.com/VishalRam24/nexus-opt
cd nexus-opt
maturin build --release
pip install target/wheels/*.whl

Needs a Rust toolchain. Run the tests with uv run pytest.

Licence

MIT — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nexus_opt-0.1.0.tar.gz (240.8 kB view details)

Uploaded Source

Built Distributions

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

nexus_opt-0.1.0-cp39-abi3-win_amd64.whl (526.2 kB view details)

Uploaded CPython 3.9+Windows x86-64

nexus_opt-0.1.0-cp39-abi3-win32.whl (473.1 kB view details)

Uploaded CPython 3.9+Windows x86

nexus_opt-0.1.0-cp39-abi3-musllinux_1_2_x86_64.whl (763.2 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ x86-64

nexus_opt-0.1.0-cp39-abi3-musllinux_1_2_i686.whl (795.6 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ i686

nexus_opt-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl (693.8 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

nexus_opt-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (550.0 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

nexus_opt-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (516.5 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

nexus_opt-0.1.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl (582.5 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.5+ i686

nexus_opt-0.1.0-cp39-abi3-macosx_11_0_arm64.whl (505.4 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

nexus_opt-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl (544.1 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file nexus_opt-0.1.0.tar.gz.

File metadata

  • Download URL: nexus_opt-0.1.0.tar.gz
  • Upload date:
  • Size: 240.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nexus_opt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e6a464295c1e80a0d78cd2a84137bf1facc110d4960fb43d6299d7230309bdf2
MD5 72dd858a1cde057332a184bf6959a00d
BLAKE2b-256 7a8d90ce208e7cc022d66a6fb558017dd41255965d35926fe33abe4ac95a6651

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexus_opt-0.1.0.tar.gz:

Publisher: CI.yml on VishalRam24/nexus-opt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nexus_opt-0.1.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: nexus_opt-0.1.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 526.2 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nexus_opt-0.1.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e61e32ae7b3d4a8bdb324a20c350f00b347c19e041f89cc7175d9c888cf45421
MD5 7f7b13508a7a901c4b1d9ab01129d0ce
BLAKE2b-256 98eb083ac0f0e77af711f2eca7f10c38f0975f0c1396e37cf4bb4900d21860d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexus_opt-0.1.0-cp39-abi3-win_amd64.whl:

Publisher: CI.yml on VishalRam24/nexus-opt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nexus_opt-0.1.0-cp39-abi3-win32.whl.

File metadata

  • Download URL: nexus_opt-0.1.0-cp39-abi3-win32.whl
  • Upload date:
  • Size: 473.1 kB
  • Tags: CPython 3.9+, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nexus_opt-0.1.0-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 733a8077bc70b59d3b4c0943c940fdab413fda3c26473c54b03fc566958d410b
MD5 5020e605b3acdb99c7c625b7be6d2873
BLAKE2b-256 eeee3e75f1f0bc23614c3d6f8ca93cef155fa7839c7b1b54dc287a3c6b9b5100

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexus_opt-0.1.0-cp39-abi3-win32.whl:

Publisher: CI.yml on VishalRam24/nexus-opt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nexus_opt-0.1.0-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nexus_opt-0.1.0-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 060228aebccafd71db046679211511c61a2fa6bbb7a0a98d9f77526bb5959e17
MD5 4f1e99e17e09d145d2b84ec6605fb502
BLAKE2b-256 8d4e634a7d3048fff840d6ccd4a96e9b85302932d18fe8dd7a4fe82c834caea4

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexus_opt-0.1.0-cp39-abi3-musllinux_1_2_x86_64.whl:

Publisher: CI.yml on VishalRam24/nexus-opt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nexus_opt-0.1.0-cp39-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for nexus_opt-0.1.0-cp39-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 13f68b08ba915301181efcc0ef9c01639455f66d34c70a83999a5c82d92c47e3
MD5 1f53f940ce6469ec2c020e9ae8a2e987
BLAKE2b-256 3e66e17f98ff710ee3a71c5f5babf84e94d4ce8e52f20bedaf631bbb7a0798a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexus_opt-0.1.0-cp39-abi3-musllinux_1_2_i686.whl:

Publisher: CI.yml on VishalRam24/nexus-opt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nexus_opt-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for nexus_opt-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 648dcbdc6c2eff19d83a6e194c5755eb6d79c66791ac514c967d452f0023427d
MD5 4902a74c7ae0cbc5baad077a9942f449
BLAKE2b-256 5015a084f296c7ba049a651a37c2cefd039bb70373b3732d2a8fd266c1033617

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexus_opt-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl:

Publisher: CI.yml on VishalRam24/nexus-opt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nexus_opt-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nexus_opt-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5808ea83de638fb12e1a51b5c878701a6185a29e1e86943c4bc88460c0b9073b
MD5 3f61329f6660b6e053649526360ec620
BLAKE2b-256 83563cca3ff8082f8f85245784e8ef1198d75c8209dacbd17c454d7070411a7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexus_opt-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: CI.yml on VishalRam24/nexus-opt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nexus_opt-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for nexus_opt-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b347c95c22e63a6e61e7baf25397b92df327f83ee162d3a77158c65f7b108fa0
MD5 4e181e677d3115dbb703243d6f54967a
BLAKE2b-256 c15ac9098c5cde43396954835f9544cf9bca5e83ce3b411b922f657b6ad301d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexus_opt-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: CI.yml on VishalRam24/nexus-opt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nexus_opt-0.1.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for nexus_opt-0.1.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 fe41722e92b969f44ed1c860bdee4b8d9ef89e5611ac6a9c4c42097db421640a
MD5 236b425d6adbc3a22ceaacd1c30c0833
BLAKE2b-256 17d189b2ffcd567124e242cb9b72fa03143a85b7a5db60f816e73eba0b5a48bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexus_opt-0.1.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl:

Publisher: CI.yml on VishalRam24/nexus-opt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nexus_opt-0.1.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nexus_opt-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a3d853fc62e80aedbf39c6858ed4d4e6cc0161b585de52eb38ec859a5a58ff67
MD5 07ba07f96472110bc772ebc1dabb2b13
BLAKE2b-256 438ee60fb29914523ae8eb21b02522bbe2e773e80191d17a9feeb0322fa80ff6

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexus_opt-0.1.0-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: CI.yml on VishalRam24/nexus-opt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nexus_opt-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for nexus_opt-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 469a23399a066409d877d9910554e317f084c3981769e9c7b0ff92732643fa7c
MD5 e285dd19f2745832621f7a4bfff3c923
BLAKE2b-256 3939d19d8083c38ab8143009adc23af2ab09f28860c86e46b1dcfefc5a75d0b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexus_opt-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: CI.yml on VishalRam24/nexus-opt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

11 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page