Metadata-Version: 2.4
Name: tno.quantum.optimization.qubo.components
Version: 1.2.0
Summary: QUBO components
Author-email: TNO Quantum Code Lab <tnoquantum@tno.nl>
Maintainer-email: TNO Quantum Code Lab <tnoquantum@tno.nl>
License: Apache License, Version 2.0
Project-URL: Homepage, https://github.com/TNO-Quantum/
Project-URL: Documentation, https://github.com/TNO-Quantum/
Project-URL: Source, https://github.com/TNO-Quantum/optimization.qubo.components
Keywords: TNO,Quantum,Optimization,QUBO
Platform: any
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: matplotlib
Requires-Dist: scipy
Requires-Dist: tno.quantum.utils~=5.0
Provides-Extra: tests
Requires-Dist: pytest>=8.1.1; extra == "tests"
Requires-Dist: pytest-cov>=4.1.0; extra == "tests"
Requires-Dist: tomlkit; extra == "tests"
Requires-Dist: dimod>=0.12.17; extra == "tests"
Dynamic: license-file

# TNO Quantum: Optimization - QUBO - Components

TNO Quantum provides generic software components aimed at facilitating the development
of quantum applications.

This package contains the components to define QUBOs and solvers.

## Documentation

Documentation of the `tno.quantum.optimization.qubo.components` package can be found [here](https://tno-quantum.github.io/documentation/).


## Install

Easily install the `tno.quantum.optimization.qubo.components` package using pip:

```console
$ python -m pip install tno.quantum.optimization.qubo.components
```


## Usage

The QUBO Components package can be used to define custom solver classes as shown in the following example.

```python
from tno.quantum.optimization.qubo.components import QUBO, Solver, BasicResult

class CustomSolver(Solver[BasicResult]):
   def _solve(self, qubo: QUBO) -> BasicResult:
      result = ... # solve QUBO and construct result
      return result
```

The example below shows how to obtain all installed solvers.

An instance of a solver can be obtained via the `get_instance()` function on an `SolverConfig` instance.

*Note:* the `"simulated_annealing_solver"` solver shown in the example requires `tno.quantum.optimization.qubo.solvers` to be installed.  

```python
from tno.quantum.optimization.qubo.components import SolverConfig

supported_solvers = SolverConfig.supported_items()

solver_config = SolverConfig(name="simulated_annealing_solver", options={})
solver = solver_config.get_instance()
```

## (End)use limitations
The content of this software may solely be used for applications that comply with international export control laws.
