The Amplify SDK provides client classes for the solvers that you can run from the SDK. The client classes wrap each solver’s API and provide an interface for configuring the solver and setting execution parameters and methods for requesting the API.
Solvers are available in various formats, including WEB API, executable files, and library APIs, but can be handled consistently through the solver client classes of the Amplify SDK. In addition, the Amplify SDK uses a common interface in the client class to allow abstraction of solver execution and analysis of results, in addition to model transformation and graph embedding processes.
This page describes the common interfaces provided by the solver clients, and we describe the functions and features specific to each solver client in their respective subpages.
The client class provides the following three general types of interfaces.
Setting solver execution parameters.
Retrieving client settings and solver information.
Calling solver-provided APIs
The common interface for the solver clients is as follows. Interfaces that are only valid for some solvers are classified by the tag assigned to each solver in the list of solver clients. For solver-specific interfaces, see the subpage for each solver.
- Execution parameters:
Returns a parameter class for retrieving and setting the solver execution parameters.
The type of parameter class varies from solver to solver but is designed to retrieve and set all possible execution parameters. For more parameter information, see the individual solver subpages and the solver API reference.
- Solver information:
Retrieves the degree of the problem that the solver can handle. See “Variable Conversion and Degree Reduction” for details.
Retrieves the solver version information.
For remote solvers, you may need to set a token to use this interface since the API may be queried. For local solvers, this retrieves the version information for the executable or library.
- Quadratic polynomial graph structure Graph:
- WEB API Connection setting ☁️ Cloud:
- Path to executable file and library 💻 Local:
Specifies the file path of the solver library.
- Save sent and received data ☁️ Cloud 💻 Local:
- Solver execution:
solve(...)method is implemented in each solver client as a function to execute the solver. This is a wrapper function for the solver API.
Usually, the user does not need to call this method directly. Use the
The API can be called with a polynomial (
Poly), matrix (
Matrix), or constraint (
ConstraintList) argument, or both, depending on what is available to the solver API. However, unlike the global
solve()function, no model transformation or graph embedding is performed. Therefore, if a variable type, order, or constraint condition is given that the solver cannot handle, an exception will be thrown.
The return type of the
solve(...)method is different for each solver. For example, in the case of Amplify AE (
FixstarsClient), it is an instance of the class
amplify.FixstarsClient.Result. This class is classified so that the data structure of the response data returned by the solver is modified as little as possible.
After performing the model conversion and graph embedding, the
solve() function calls the solver client’s
solve(...) method to execute the solver and analyze the returned data to obtain information about the solution and execution time.
Result of solver client execution (response data)
Solver internal execution time
Solver response time