Microsoft QIO¶
JijQIOBaseSampler
¶
Bases: JijZeptBaseSampler
, typ.Generic[P]
sample_hubo(J, parameters=None, max_wait_time=None, sync=True, queue_name=None, **kwargs)
¶
Microsoft QIO simulated annealing solver is performed for binary polynomial models.
To configure the solver, instantiate the JijQIOXXParameters
class for your desired solver and pass the instance to the parameters
argument.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
J | Dict | Polynomial interactions. | required |
parameters | P | None | parameters for QIO. Defaults to None. | None |
max_wait_time | int | float | None | The number of timeout [sec] for post request. If None, 60 (one minute) will be set. Please note that this argument is for the jijzept timeout and not for configuring solver settings, such as solving time. | None |
sync | bool | Synchronous mode. | True |
queue_name | Optional[str] | Queue name. | None |
**kwargs | QIO parameters using **kwargs. If both | {} |
Returns:
Type | Description |
---|---|
JijModelingResponse | dimod.SampleSet: Stores minimum energy samples and other information. |
Examples:
import jijzept as jz
sampler = jz.JijQIOSASampler(config='config.toml')
response = sampler.sample_hubo(J={(0,1,2,3,4): -1}, vartype="SPIN")
sample_model(model, feed_dict, multipliers={}, fixed_variables={}, needs_square_dict=None, search=False, num_search=15, algorithm=None, parameters=None, max_wait_time=None, sync=True, queue_name=None, **kwargs)
¶
Sample using JijModeling by means of Microsoft QIO Simulated Annealing solver.
To configure the solver, instantiate the JijQIOXXParameters
class for your desired solver and pass the instance to the parameters
argument.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model | jijmodeling.Problem | Mathematical model is constracted by JijModeling. | required |
feed_dict | Dict[str, Union[Number, list, np.ndarray]] | The actual values to be assigned to the placeholders. | required |
multipliers | Dict[str, Number] | The actual multipliers for penalty terms, derived from constraint conditions. | {} |
fixed_variables | Dict[str, Dict[Tuple[int, ...], Union[int, float]]] | dictionary of variables to fix. | {} |
needs_square_dict | Dict[str, bool] | If | None |
search | bool | If | False |
num_search | int | The number of parameter search iteration. Defaults to set 15. This option works if | 15 |
algorithm | Optional[str] | Algorithm for parameter search. Defaults to None. | None |
parameters | P | None | parameters for QIO. Defaults to None. | None |
max_wait_time | int | float | None | The number of timeout [sec] for post request. If | None |
sync | bool | Synchronous mode. | True |
queue_name | Optional[str] | Queue name. | None |
**kwargs | QIO parameters using **kwargs. If both | {} |
Returns:
Name | Type | Description |
---|---|---|
JijModelingResponse | JijModelingResponse | Stores minimum energy samples and other information. |
Examples:
import jijzept as jz
import jijmodeling as jm
n = jm.Placeholder('n')
x = jm.Binary('x', shape=n)
d = jm.Placeholder('d', shape=n)
i = jm.Element("i", n)
problem = jm.Problem('problem')
problem += jm.Sum(i, d[i] * x[i])
sampler = jz.JijQIOSASampler(config='config.toml')
response = sampler.sample_model(problem, feed_dict={'n': 5, 'd': [1,2,3,4,5]})
sample_qubo(Q, parameters=None, max_wait_time=None, sync=True, queue_name=None, **kwargs)
¶
Microsoft QIO solver is performed for binary quadratic models.
To configure the solver, instantiate the JijQIOXXParameters
class for your desired solver and pass the instance to the parameters
argument.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
Q | Dict | The linear or quadratic terms. | required |
parameters | P | None | parameters for QIO. Defaults to None. | None |
max_wait_time | int | float | None | The number of timeout [sec] for post request. If | None |
sync | bool | Synchronous mode. | True |
queue_name | Optional[str] | Queue name. | None |
**kwargs | QIO parameters using **kwargs. If both | {} |
Returns:
Type | Description |
---|---|
JijModelingResponse | dimod.SampleSet: Stores minimum energy samples and other information. |
Examples:
import jijzept as jz
sampler = jz.JijQIOSASampler(config='config.toml')
response = sampler.sample_qubo(Q={(0,0): -0.5, (0,1): -1, (0,2): -1, (2,3): -1})
JijQIOPAParameters
dataclass
¶
Bases: QIOParameters
Manage Parameters for using Microsoft QIO Population Annealing.
An parameter with none will be set to the default value in QIO Population Annealing. For more information on the parameters. Please see this page.
Attributes:
Name | Type | Description |
---|---|---|
num_sweeps | Optional[int] |
|
beta_min | Optional[float] | Initial value of annealing schedule |
beta_max | Optional[float] | Final value of annealing schedule |
population | Optional[int] | The Number of walkers in the population. this will be set automatically. |
schedule_type | Optional[str] | Type of annealing schedule |
seed | Optional[int] | Seed value - used for reproducing results. |
JijQIOPASampler
¶
Bases: JijQIOBaseSampler[JijQIOPAParameters]
Smapler for using Microsoft QIO Population Annealing.
For details on Microsoft QIO Population Annealing, Please see this page.
JijQIOPTParameters
dataclass
¶
Bases: QIOParameters
Manage Parameters for using Microsoft QIO Parallel Tempering.
An parameter with none will be set to the default value in QIO Parallel Tempering. For more information on the parameters. Please see this page.
Attributes:
Name | Type | Description |
---|---|---|
num_sweeps | Optional[int] |
|
replicas | Optional[int] | The number of concurrent running copies for sampling. |
all_betas | Union[int, float, None] | The list of beta values used in each replica for sampling. this will be set automatically. |
seed | Optional[int] | Seed value - used for reproducing results. |
JijQIOPTSampler
¶
Bases: JijQIOBaseSampler[JijQIOPTParameters]
Sampler for using Microsoft QIO Parallel tempering.
For details on Microsoft QIO Parallel tempering, Please see this page.
JijQIOSAParameters
dataclass
¶
Bases: QIOParameters
Manage Parameters for using Microsoft QIO Simulated Annealing.
An parameter with none will be set to the default value in QIO Simulated Annealing. For more information on the parameters. Please see this page.
Attributes:
Name | Type | Description |
---|---|---|
num_sweeps | Optional[int] |
|
beta_min | Optional[float] |
|
beta_max | Optional[float] |
|
num_reads | Optional[int] |
|
seed | Optional[int] | Seed value - used for reproducing results. |
platform | Optional[str] | "CPU" or "FPGA". If |
JijQIOSASampler
¶
Bases: JijQIOBaseSampler[JijQIOSAParameters]
Sampler for using Microsoft QIO Simulated Annealing.
For details on Microsoft QIO Simulated Annealing, Please see this page.
JijQIOSQAParameters
dataclass
¶
Bases: QIOParameters
Manage Parameters for using Microsoft QIO Quantum Monte Carlo.
An parameter with none will be set to the default value in QIO Quantum Monte Carlo. For more information on the parameters. Please see this page.
Attributes:
Name | Type | Description |
---|---|---|
num_sweeps | Optional[int] |
|
num_reads | Optional[int] |
|
beta | Optional[float] |
|
trotter | Optional[int] |
|
transverse_field_max | Optional[float] |
|
transverse_field_min | Optional[float] |
|
seed | Optional[int] | Seed value - used for reproducing results. |
JijQIOSQASampler
¶
Bases: JijQIOBaseSampler
Sampler for using Microsoft QIO Quantum Monte Carlo.
For details on Microsoft QIO Quantum Monte Carlo, Please see this page.
JijQIOSSMCParameters
dataclass
¶
Bases: QIOParameters
Manage Parameters for using Microsoft QIO Substochastic Monte Carlo.
An parameter with none will be set to the default value in QIO Substochastic Monte Carlo. For more information on the parameters. Please see this page.
Attributes:
Name | Type | Description |
---|---|---|
search | bool | If |
num_search | int | The number of parameter search iteration. This option works if |
step_limit | Optional[int] | The number of Monte Carlo steps. this will be set automatically. |
target_population | Optional[int] | The number of walkers in the population. this will be set automatically. |
alpha_min | Optional[float] | Initial value of |
alpha_max | Optional[float] | Final value of |
beta_min | Optional[float] | Initial value of |
beta_max | Optional[float] | Final value of |
alpha_schedule_type | Optional[str] | Schedule type of |
beta_schedule_type | Optional[str] | Schedule type of |
seed | Optional[int] | Seed value - used for reproducing results. |
JijQIOSSMCSampler
¶
Bases: JijQIOBaseSampler[JijQIOSSMCParameters]
Sampler for using Substochastic Monte Carlo.
For details on Microsoft QIO Substochastic Monte Carlo, Please see this page.
JijQIOTBParameters
dataclass
¶
Bases: QIOParameters
Manage Parameters for using Microsoft QIO Tabu Search.
An parameter with none will be set to the default value in QIO Tabu Search. For more information on the parameters. Please see this page.
Attributes:
Name | Type | Description |
---|---|---|
num_sweeps | Optional[int] |
|
tabu_tenure | Optional[int] | Tenure of the tabu list in moves. this will be set automatically. |
num_reads | Optional[int] |
|
seed | Optional[int] | Seed value - used for reproducing results. |
JijQIOTBSampler
¶
Bases: JijQIOBaseSampler
Sampler for using Microsoft Tabu Search.
For details on Microsoft QIO Tabu Search, Please see this page.