Skip to main content

Uno, a highly customizable SQP & barrier solver for nonlinearly constrained optimization

Project description

Uno

Uno is a solver for nonlinearly constrained optimization that unifies Lagrange-Newton (essentially SQP and interior-point) methods. It breaks them down into a set of building blocks (e.g., strategies to compute descent directions and techniques to enforce globalization).

unopy, Uno's Python interface, allows you to solve an optimization model described by callback functions.

Example

An implementation example of the Hock-Schittkowski model hs015 is available in the file example_hs015.py.

Building an optimization model

Building an optimization model is incremental and starts with the information about the variables:

model = unopy.Model(problem_type, number_variables,
   variables_lower_bounds, variables_upper_bounds, base_indexing)

The following optional elements can be added to the model separately:

  • the objective function (and its gradient). It is 0 otherwise;
model.set_objective(optimization_sense, objective_function, objective_gradient)
  • constraint functions (and their Jacobian);
model.set_constraints(number_constraints, constraint_functions,
   constraints_lower_bounds, constraints_upper_bounds, number_jacobian_nonzeros,
   jacobian_row_indices, jacobian_column_indices, constraint_jacobian)
  • the Lagrangian Hessian;
model.set_lagrangian_hessian(number_hessian_nonzeros, hessian_triangular_part, 
   hessian_row_indices, hessian_column_indices, lagrangian_hessian, lagrangian_sign_convention)
  • a Jacobian operator (performs Jacobian-vector products);
model.set_jacobian_operator(jacobian_operator)
  • a Jacobian-transposed operator (performs Jacobian-transposed-vector products);
model.set_jacobian_transposed_operator(jacobian_transposed_operator)
  • a Hessian operator (performs Hessian-vector products);
model.set_lagrangian_hessian_operator(lagrangian_hessian_operator, lagrangian_sign_convention)
  • user data of an arbitrary type;
model.set_user_data(user_data)
  • an initial primal point;
model.set_initial_primal_iterate(initial_primal_iterate)
  • an initial dual point.
model.set_initial_dual_iterate(initial_dual_iterate)

Each of these functions throws an exception upon failure.

Creating an instance of the Uno solver

Create an instance of the Uno solver with a simple function call:

uno_solver = unopy.UnoSolver()

Passing options to the Uno solver

Options can be passed to the Uno solver:

uno_solver.set_option("print_solution", True)

Uno mimics the state-of-the-art solvers filterSQP and IPOPT via presets:

uno_solver.set_preset("filtersqp")
# or
uno_solver.set_preset("ipopt")

Solving the model

The model can then be solved by Uno:

result = uno_solver.optimize(model)

Inspecting the result

To inspect the result of the optimization, read the attributes of the result object:

  • the optimization status (UNO_SUCCESS, UNO_ITERATION_LIMIT, UNO_TIME_LIMIT, UNO_EVALUATION_ERROR, UNO_ALGORITHMIC_ERROR): result.optimization_status
  • the solution status (UNO_NOT_OPTIMAL, UNO_FEASIBLE_KKT_POINT, UNO_FEASIBLE_FJ_POINT, UNO_INFEASIBLE_STATIONARY_POINT, UNO_FEASIBLE_SMALL_STEP, UNO_INFEASIBLE_SMALL_STEP, UNO_UNBOUNDED): result.solution_status
  • the objective value of the solution: result.solution_objective
  • the primal solution: result.primal_solution
  • the dual solution associated with the general constraints: result.constraint_dual_solution
  • the dual solution associated with the lower bounds: result.lower_bound_dual_solution
  • the dual solution associated with the upper bounds: result.upper_bound_dual_solution
  • the primal feasibility residual at the solution: result.solution_primal_feasibility
  • the stationarity residual at the solution: result.solution_stationarity
  • the complementarity residual at the solution: result.solution_complementarity
  • the number of (outer) iterations: result.number_iterations
  • the CPU time (in seconds): result.cpu_time
  • the number of objective evaluations: result.number_objective_evaluations
  • the number of constraint evaluations: result.number_constraint_evaluations
  • the number of objective gradient evaluations: result.number_objective_gradient_evaluations
  • the number of Jacobian evaluations: result.number_jacobian_evaluations
  • the number of Hessian evaluations: result.number_hessian_evaluations
  • the number of subproblems solved: result.number_subproblems_solved

How to cite Uno

We have submitted our paper to the Mathematical Programming Computation journal. The preprint is available on ResearchGate.

Until it is published, you can use the following bibtex entry:

@unpublished{VanaretLeyffer2024,
  author = {Vanaret, Charlie and Leyffer, Sven},
  title = {Implementing a unified solver for nonlinearly constrained optimization},
  year = {2024},
  note = {Submitted to Mathematical Programming Computation}
}

Project details


Download files

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

Source Distribution

unopy-0.1.1.tar.gz (28.1 MB view details)

Uploaded Source

Built Distributions

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

unopy-0.1.1-cp39-cp39-musllinux_1_2_x86_64.whl (9.6 MB view details)

Uploaded CPython 3.9musllinux: musl 1.2+ x86-64

unopy-0.1.1-cp39-cp39-musllinux_1_2_aarch64.whl (8.6 MB view details)

Uploaded CPython 3.9musllinux: musl 1.2+ ARM64

unopy-0.1.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (8.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

unopy-0.1.1-cp39-cp39-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (7.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

unopy-0.1.1-cp39-cp39-macosx_15_0_x86_64.whl (10.2 MB view details)

Uploaded CPython 3.9macOS 15.0+ x86-64

unopy-0.1.1-cp39-cp39-macosx_15_0_arm64.whl (9.3 MB view details)

Uploaded CPython 3.9macOS 15.0+ ARM64

unopy-0.1.1-cp38-cp38-musllinux_1_2_x86_64.whl (9.6 MB view details)

Uploaded CPython 3.8musllinux: musl 1.2+ x86-64

unopy-0.1.1-cp38-cp38-musllinux_1_2_aarch64.whl (8.6 MB view details)

Uploaded CPython 3.8musllinux: musl 1.2+ ARM64

unopy-0.1.1-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (8.5 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

unopy-0.1.1-cp38-cp38-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (7.7 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

unopy-0.1.1-cp38-cp38-macosx_15_0_x86_64.whl (10.2 MB view details)

Uploaded CPython 3.8macOS 15.0+ x86-64

unopy-0.1.1-cp38-cp38-macosx_15_0_arm64.whl (9.3 MB view details)

Uploaded CPython 3.8macOS 15.0+ ARM64

File details

Details for the file unopy-0.1.1.tar.gz.

File metadata

  • Download URL: unopy-0.1.1.tar.gz
  • Upload date:
  • Size: 28.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for unopy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b7a867140727ebbea5224cbc8eb76d8faafadfebc04f792a89315285f5c9a4b3
MD5 b2f115a79ea71702bbfb38d5cfac8173
BLAKE2b-256 cab5e3e9bc5a25cf565cce8b2564261e975e3e12f25e7884c5a45a066e23bc06

See more details on using hashes here.

Provenance

The following attestation bundles were made for unopy-0.1.1.tar.gz:

Publisher: build-python-wheels.yml on cvanaret/Uno

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

File details

Details for the file unopy-0.1.1-cp39-cp39-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for unopy-0.1.1-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 12747ea157e6ff2aba17ab51ebe25ddcdbe0fed2554df41b02e036c11667bdca
MD5 bdc53da19f191a03ab5415393bced93c
BLAKE2b-256 bcc7f179b2fd8333cdf82f85c6962f0bdb4f61dfeb14c09c099b18d03fb8c41c

See more details on using hashes here.

Provenance

The following attestation bundles were made for unopy-0.1.1-cp39-cp39-musllinux_1_2_x86_64.whl:

Publisher: build-python-wheels.yml on cvanaret/Uno

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

File details

Details for the file unopy-0.1.1-cp39-cp39-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for unopy-0.1.1-cp39-cp39-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 94c8ebe7467ebc4f570fc323ba90151804169e3341857be3bc6ba6175ba66cc9
MD5 2d8c23f48047a076eb716ce1e4fbca35
BLAKE2b-256 995b74b883f5e619b44cf888405a4ae234908c43a99d1c2b910b45f053119b56

See more details on using hashes here.

Provenance

The following attestation bundles were made for unopy-0.1.1-cp39-cp39-musllinux_1_2_aarch64.whl:

Publisher: build-python-wheels.yml on cvanaret/Uno

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

File details

Details for the file unopy-0.1.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for unopy-0.1.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7406f15003bb693a54ca0da31acdc978e9498c946cc8ee96e6a67ef2b237bcba
MD5 bf67490708007cee6ab71c34af009dad
BLAKE2b-256 41d9df97b8e24c6a9c65dff160000d38a968c67d4662ca765de04824a6e31676

See more details on using hashes here.

Provenance

The following attestation bundles were made for unopy-0.1.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-python-wheels.yml on cvanaret/Uno

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

File details

Details for the file unopy-0.1.1-cp39-cp39-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for unopy-0.1.1-cp39-cp39-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 109e22c3a4b7b042cfecb0efe32ef66af7a1894bbe90cdd4a204d7fca7fd3e5d
MD5 5cce069729b6b19d924adf8f15dba287
BLAKE2b-256 3a10351fa7d23a2b7f07c9d0a9ae597efe8baad817dda4c425a851ae73c3de0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for unopy-0.1.1-cp39-cp39-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl:

Publisher: build-python-wheels.yml on cvanaret/Uno

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

File details

Details for the file unopy-0.1.1-cp39-cp39-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for unopy-0.1.1-cp39-cp39-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 08c83e8c2f5a0e39f8e43e553fc7e5c380764b717bccdf4680f572dff8cbc341
MD5 0108a42684cbed2194392ea1ecbd5c68
BLAKE2b-256 03a5ee6391d0fd0bf29d31e50562ff67ebf047ebd97fec5d1bf69a73a22c030a

See more details on using hashes here.

Provenance

The following attestation bundles were made for unopy-0.1.1-cp39-cp39-macosx_15_0_x86_64.whl:

Publisher: build-python-wheels.yml on cvanaret/Uno

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

File details

Details for the file unopy-0.1.1-cp39-cp39-macosx_15_0_arm64.whl.

File metadata

  • Download URL: unopy-0.1.1-cp39-cp39-macosx_15_0_arm64.whl
  • Upload date:
  • Size: 9.3 MB
  • Tags: CPython 3.9, macOS 15.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for unopy-0.1.1-cp39-cp39-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 e742264b1c9b8d3cbbb8b57e715146c3b47c094776c7b52e1f4d0bcbc0720f22
MD5 32ae0d144b2d3b4ade72f106d2b614a9
BLAKE2b-256 8a3d9df129def692ca06de354c2b3078022641650cd88917b0f7647b4fefe11f

See more details on using hashes here.

Provenance

The following attestation bundles were made for unopy-0.1.1-cp39-cp39-macosx_15_0_arm64.whl:

Publisher: build-python-wheels.yml on cvanaret/Uno

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

File details

Details for the file unopy-0.1.1-cp38-cp38-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for unopy-0.1.1-cp38-cp38-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c6a6b63b743eef4cd88b80e76c2ac279a6d50437e68718f56ee1aafdfa114de6
MD5 9f9aac3f1211a38159ec05adfd12480e
BLAKE2b-256 32b214e9b779aaaf3fccba60f64abad01f50312d3b0fa7d76196e4a5e30a1251

See more details on using hashes here.

Provenance

The following attestation bundles were made for unopy-0.1.1-cp38-cp38-musllinux_1_2_x86_64.whl:

Publisher: build-python-wheels.yml on cvanaret/Uno

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

File details

Details for the file unopy-0.1.1-cp38-cp38-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for unopy-0.1.1-cp38-cp38-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 2c7f90dc67573fd4ac59ef7d7767f68e0ff8ab646ac5a4a4f4856e309261e2ad
MD5 0a48c0015edc3b5952b02dae9ea09f81
BLAKE2b-256 205add4254af77f97728a9434dd7c5620f86e9ffc78c95e46076a969e40c7a9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for unopy-0.1.1-cp38-cp38-musllinux_1_2_aarch64.whl:

Publisher: build-python-wheels.yml on cvanaret/Uno

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

File details

Details for the file unopy-0.1.1-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for unopy-0.1.1-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 adbcd81ebe4e8073162153c713a45a8105395f19f9e006e8c2cbc0d8485f911c
MD5 0a4be81b4a15335c515d0e437c0c1a8f
BLAKE2b-256 6fcc5d16544ddf36430c61741e54ce4af5de4aab7969769884a9a380b7819edd

See more details on using hashes here.

Provenance

The following attestation bundles were made for unopy-0.1.1-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-python-wheels.yml on cvanaret/Uno

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

File details

Details for the file unopy-0.1.1-cp38-cp38-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for unopy-0.1.1-cp38-cp38-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 19784b08941c192d991b4f01bd280c9f91e4e52a58ffbccc5d4c7ba2da7a5e11
MD5 2ceacd27564ac2728019bcb95d82901f
BLAKE2b-256 a2da6b627f638d71fd96665cbeb8745ac4444f56624e5d13f990270690bd79dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for unopy-0.1.1-cp38-cp38-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl:

Publisher: build-python-wheels.yml on cvanaret/Uno

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

File details

Details for the file unopy-0.1.1-cp38-cp38-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for unopy-0.1.1-cp38-cp38-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 fb59534e037b9fa3b32fd6ff9cf9a76bbfc7ec72582a10bd2d1ed21ec3ca5508
MD5 68192f46b7faaa883fbf18a1cc5af8a0
BLAKE2b-256 6a8ae72f8f6e173cb1cdc226edaf11e2426862956e9f094f020b10056ab4af73

See more details on using hashes here.

Provenance

The following attestation bundles were made for unopy-0.1.1-cp38-cp38-macosx_15_0_x86_64.whl:

Publisher: build-python-wheels.yml on cvanaret/Uno

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

File details

Details for the file unopy-0.1.1-cp38-cp38-macosx_15_0_arm64.whl.

File metadata

  • Download URL: unopy-0.1.1-cp38-cp38-macosx_15_0_arm64.whl
  • Upload date:
  • Size: 9.3 MB
  • Tags: CPython 3.8, macOS 15.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for unopy-0.1.1-cp38-cp38-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 4360f98d95104dd3bb8e244fa72de118b493efc0009aa72751ee024e568b7133
MD5 53535cf6b3f0e3c181c6f9d256546d0f
BLAKE2b-256 e014b66602be6bcfdd5f572b4b63d317df583b4ba19064ec34634077c25bbfe7

See more details on using hashes here.

Provenance

The following attestation bundles were made for unopy-0.1.1-cp38-cp38-macosx_15_0_arm64.whl:

Publisher: build-python-wheels.yml on cvanaret/Uno

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

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