# amplify.Solver¶

class `Solver`

The `Solver` class accepts a client class corresponding to one of the available annealing machines and solves a given model with the specified client.

Note

Acceptable clients are described in the references

`__init__`(client=None)

Constructor

Parameters
• client (`client`, optional) – Client object. Defaults to `None`.

• chain_strength (float/optional) – A parameter for controlling the quadratic interactions within the connected physical bits of a given solver for forming chains. It is set to 1.0 by default.

Example

```from amplify import BinaryPoly, gen_symbols, Solver
from amplify.client import FixstarsClient

q = gen_symbols(BinaryPoly, 8)
f = 2 * q[0] * q[1] * q[2] - q[0] * q[1] + q[2] + 1

client = FixstarsClient()
client.token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
client.parameters.timeout = 1000  # timeout 1second

solver = Solver(client)
result = solver.solve(f)
```
```>>> f
2.000000 q_0 q_1 q_2 - q_0 q_1 + q_2 + 1.000000
>>> [f"energy = {s.energy}, q[0] = {s.values[0]}, q[1] = {s.values[1]}, q[2] = {s.values[2]}" for s in result]
['energy = 0.0, q[0] = 1, q[1] = 1, q[2] = 0']
```

Methods

 `__init__`([client]) Constructor `solve`(*args, **kwargs) Solve the given model.

Attributes

 `chain_strength` `client` `client_result` `deduplicate` `embedding_time_limit` `filter_solution` `logical_result` `sort_solution`
`solve`(*args, **kwargs)

Solve the given model.

1. solve(model)

2. solve(poly)

3. solve(matrix, constant)

4. solve(constraint)

Parameters

• Input polynomial. It is internally converted to a Quadratic Model.

• Input matrix. It is internally converted to a Quadratic Model.

• constant (`int` or `float`, optional) –

• A constant value added to the above matrix. The type is according to the coefficients of the matrix.

• Input constraint(s).

Returns

Solver’s result class whose type is depending on the client. See Client for each client’s ClientResult class for further details.

Return type

`SolverResult`