# Solver Client To run a solver from the Amplify SDK, you must create a solver client that abstracts each solver and specifies the connection point, API token, and execution parameters. The solver client also contains information about the solver's capabilities, such as the types of variables, constraints, degree, and so on that it can handle. Amplify SDK uses this information to perform **model conversions** automatically, such as **variable conversions**, **degree reduction**, **constraint implementation**, and **embedding in hardware topology**. ## Configuring solver client Using the Amplify Annealing Engine (AE) as an example, let's create the {py:class}`~amplify.FixstarsClient` client as follows. ```{testcode} from amplify import FixstarsClient client = FixstarsClient() ``` ```{tip} Amplify AE provides a free API token when you [register](https://amplify.fixstars.com/en/register) as a user. ``` Most parameters of the client class are initialized (or unset) with the solver's default values after construction, so you can use them immediately after setting the required parameters for each client. The required parameters vary from client to client, but you must set an API token in the `token` attribute for most cloud solvers. ```{testcode} client.token = "YOUR_API_TOKEN" ``` For all clients, the solver's execution parameters are retrieved and set to attributes in the `parameters` property. Because the setting items are as consistent as possible with the solver API, see the reference for each solver below for details. For example, in Amplify AE, you can set the execution time as follows. ```{testcode} from datetime import timedelta client.parameters.timeout = timedelta(milliseconds=1000) # 1000 milliseconds ``` ```{tip} Because each client has a different time unit and time format for time-related parameters, the Amplify SDK uses the datetime module for input and output. ``` The Amplify SDK can print parameters set in the client class as strings using the {py:class}`str` or {py:func}`print` function. ```{doctest} >>> print(client) # doctest: +NORMALIZE_WHITESPACE {"url":"https://optigan.fixstars.com","token":"YOUR_API_TOKEN","compression":true,"parameters":{"outputs":{},"timeout":1000}} ``` Setting some parameters to {py:obj}`None` means they are unset, i.e., using the solver defaults. ```{testcode} client.parameters.timeout = None # reset to solver defaults ``` ## List of solver clients (solver-clients)= The Amplify SDK supports the following solver clients. ``````{grid} 2 :gutter: 3 `````{grid-item-card} [Fixstars Amplify Annealing Engine](https://amplify.fixstars.com/en/engine) ````{button-ref} amplify.FixstarsClient :expand: amplify.FixstarsClient ```` ^^^ {bdg-primary}`QUBO` {bdg-success}`GPU` {bdg-secondary}`โ˜๏ธ Cloud` +++ ````{grid} 2 :margin: 0 :padding: 0 ```{grid-item} :margin: 0 :padding: 0 0 2 2 [{bdg-info}`๐Ÿ“– API Reference`](https://amplify.fixstars.com/en/docs/amplify/v0/amplify-ae/reference.html) ``` ```{grid-item} :margin: 0 :padding: 0 0 2 2 :class: sd-text-right [Learn more ยป](#clients-FixstarsClient) ``` ```` ````` `````{grid-item-card} [D-Wave Advantage](https://docs.dwavesys.com/docs/latest/doc_getting_started.html) ````{button-ref} amplify.DWaveSamplerClient :expand: amplify.DWaveSamplerClient ```` ^^^ {bdg-primary}`QUBO` {bdg-primary}`Ising` {bdg-success}`QPU` {bdg-secondary}`โ˜๏ธ Cloud` {bdg-warning}`Pegasus Graph` +++ ````{grid} 2 :margin: 0 :padding: 0 ```{grid-item} :margin: 0 :padding: 0 0 2 2 [{bdg-info}`๐Ÿ“– Parameter Reference`](https://docs.dwavesys.com/docs/latest/c_solver_parameters.html) ``` ```{grid-item} :margin: 0 :padding: 0 0 2 2 :class: sd-text-right [Learn more ยป](#clients-DWaveSamplerClient) ``` ```` ````` `````{grid-item-card} [Leap's Hybrid BQM Solver](https://docs.dwavesys.com/docs/latest/doc_leap_hybrid.html) ````{button-ref} amplify.LeapHybridSamplerClient :expand: amplify.LeapHybridSamplerClient ```` ^^^ {bdg-primary}`QUBO` {bdg-success}`Hybrid` {bdg-secondary}`โ˜๏ธ Cloud` +++ ````{grid} 2 :margin: 0 :padding: 0 ```{grid-item} :margin: 0 :padding: 0 0 2 2 [{bdg-info}`๐Ÿ“– Parameter Reference`](https://docs.dwavesys.com/docs/latest/c_solver_parameters.html) ``` ```{grid-item} :margin: 0 :padding: 0 0 2 2 :class: sd-text-right [Learn more ยป](#clients-LeapHybridSamplerClient) ``` ```` ````` `````{grid-item-card} [Leap's Hybrid CQM Solver](https://docs.dwavesys.com/docs/latest/doc_leap_hybrid.html) ````{button-ref} amplify.LeapHybridCQMSamplerClient :expand: amplify.LeapHybridCQMSamplerClient ```` ^^^ {bdg-primary}`MIP` {bdg-success}`Hybrid` {bdg-secondary}`โ˜๏ธ Cloud` +++ ````{grid} 2 :margin: 0 :padding: 0 ```{grid-item} :margin: 0 :padding: 0 0 2 2 [{bdg-info}`๐Ÿ“– Parameter Reference`](https://docs.dwavesys.com/docs/latest/c_solver_parameters.html) ``` ```{grid-item} :margin: 0 :padding: 0 0 2 2 :class: sd-text-right [Learn more ยป](#clients-LeapHybridCQMSamplerClient) ``` ```` ````` `````{grid-item-card} [Fujitsu DA4 Solver](https://www.fujitsu.com/global/services/business-services/digital-annealer/) ````{button-ref} amplify.FujitsuDA4Client :expand: amplify.FujitsuDA4Client ```` ^^^ {bdg-primary}`QUBO` {bdg-success}`GPU` {bdg-secondary}`โ˜๏ธ Cloud` +++ ````{grid} 2 :margin: 0 :padding: 0 ```{grid-item} :margin: 0 :padding: 0 0 2 2 [{bdg-info}`๐Ÿ“– API Reference`](https://portal.aispf.global.fujitsu.com/apidoc/da/jp/api-ref/da-qubo-v4-en.html) ``` ```{grid-item} :margin: 0 :padding: 0 0 2 2 :class: sd-text-right [Learn more ยป](#clients-FujitsuDA4Client) ``` ```` ````` `````{grid-item-card} [Fujitsu DA3c Solver](https://www.fujitsu.com/global/services/business-services/digital-annealer/) ````{button-ref} amplify.FujitsuDA3cClient :expand: amplify.FujitsuDA3cClient ```` ^^^ {bdg-primary}`QUBO` {bdg-success}`GPU` {bdg-secondary}`โ˜๏ธ Cloud` +++ ````{grid} 2 :margin: 0 :padding: 0 ```{grid-item} :margin: 0 :padding: 0 0 2 2 [{bdg-info}`๐Ÿ“– API Reference`](https://portal.aispf.global.fujitsu.com/apidoc/da/jp/api-ref/da-qubo-v3c-en.html) ``` ```{grid-item} :margin: 0 :padding: 0 0 2 2 :class: sd-text-right [Learn more ยป](#clients-FujitsuDA3cClient) ``` ```` ````` `````{grid-item-card} [TOSHIBA SQBM+ V2](https://www.global.toshiba/ww/products-solutions/ai-iot/sbm.html) ````{button-ref} amplify.ToshibaSQBM2Client :expand: amplify.ToshibaSQBM2Client ```` ^^^ {bdg-primary}`QUBO` {bdg-success}`GPU` {bdg-secondary}`โ˜๏ธ Cloud` +++ ````{grid} 2 :margin: 0 :padding: 0 ```{grid-item} :margin: 0 :padding: 0 0 2 2 [{bdg-info}`๐Ÿ“– User Guide (v2.0.3)`](/../_static/User_Manual-SQBM+_for_On-premises.pdf) ``` ```{grid-item} :margin: 0 :padding: 0 0 2 2 :class: sd-text-right [Learn more ยป](#clients-ToshibaSQBM2Client) ``` ```` ````` `````{grid-item-card} [NEC Vector Annealing Service 2.0](https://jpn.nec.com/nec-vector-annealing-service/) ````{button-ref} amplify.NECVA2Client :expand: amplify.NECVA2Client ```` ^^^ {bdg-primary}`QUBO` {bdg-success}`VE` {bdg-secondary}`โ˜๏ธ Cloud` +++ ````{grid} 2 :margin: 0 :padding: 0 ```{grid-item} :margin: 0 :padding: 0 0 2 2 [{bdg-info}`๐Ÿ“– User Guide`](/../_static/nec_vector_annealing_service_2.0_user_guide_v4.pdf) ``` ```{grid-item} :margin: 0 :padding: 0 0 2 2 :class: sd-text-right [Learn more ยป](#clients-NECVA2Client) ``` ```` ````` `````{grid-item-card} [Gurobi Optimization](https://www.gurobi.com/) ````{button-ref} amplify.GurobiClient :expand: amplify.GurobiClient ```` ^^^ {bdg-primary}`MIP` {bdg-success}`CPU` {bdg-secondary}`๐Ÿ’ป Local` +++ ````{grid} 2 :margin: 0 :padding: 0 ```{grid-item} :margin: 0 :padding: 0 0 2 2 [{bdg-info}`๐Ÿ“– Reference Manual`](https://www.gurobi.com/documentation/current/refman/index.html) ``` ```{grid-item} :margin: 0 :padding: 0 0 2 2 :class: sd-text-right [Learn more ยป](#clients-GurobiClient) ``` ```` ````` `````` --- {bdg-primary}`QUBO` {bdg-primary}`Ising` {bdg-primary}`MIP` : These represent the types of problems that the solver can directly handle. - {bdg-primary}`QUBO` This solver can solve for the objective function of a quadratic polynomial in binary variables. It cannot directly handle constraints, but some solvers support the input of equality and inequality constraints. - {bdg-primary}`Ising` This solver can solve for the objective function of a quadratic polynomial in an Ising variable. It cannot directly handle constraints, but some solvers support the input of equality and inequality constraints. - {bdg-primary}`MIP` This solver can solve mixed integer programming problems. It can directly handle binary, integer, and real variables. It generally targets first-order problems (linear programming problems), but some solvers can handle second-order problems, including QUBO. ```{note} The Amplify SDK automatically performs transformations such as variable conversion, degree reduction, and constraint penalty function generation for problems the solver cannot handle directly. Therefore, users do not necessarily need to create problems in a format the solver can address directly. However, depending on the type of solver and the type of model input, it may not be supported or formulated accurately. See [](conversion.md) for more information. ``` {bdg-warning}`Graph` : This represents a quadratic term that you can pass to the solver. Solvers without these tags have no restrictions on quadratic terms. Other solvers have restrictions on the quadratic terms in the input model and require an operation called graph embedding to solve arbitrary quadratic polynomials. The problem size the solvers can handle is about $O\left( \sqrt N \right)$ in the worst case for $N$ variables the solver can take. See "[](graph.md)" for details. {bdg-success}`CPU` {bdg-success}`GPU` {bdg-success}`VE` {bdg-success}`QPU` {bdg-success}`Hybrid` : This indicates the type of computing device the machine is running on; VE indicates NEC SX-Aurora TSUBASA Vector Engine, and Hybrid indicates that the solver is a hybrid of QPU and other technologies. {bdg-secondary}`โ˜๏ธ Cloud` {bdg-secondary}`๐Ÿ’ป Local` : This indicates whether the solver is provided as a cloud service or must be installed on the user's machine.