Skip to content

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 **kwargs and parameters are exist, the value of **kwargs takes precedence.

{}

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 True, the corresponding constraint is squared when added as a penalty to the QUBO. When the constraint label is not added to the 'needs_square_dict', it defaults to True for linear constraints and False for non-linear constraints.

None
search bool

If True, the parameter search will be carried out, which tries to find better values of multipliers for penalty terms.

False
num_search int

The number of parameter search iteration. Defaults to set 15. This option works if search is True.

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, 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 **kwargs and parameters are exist, the value of **kwargs takes precedence.

{}

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, 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 **kwargs and parameters are exist, the value of **kwargs takes precedence.

{}

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]

sweeps in QIO Population Annealing. The number of sweeps. this will be set automatically.

beta_min Optional[float]

Initial value of annealing schedule beta in QIO Population Annealing. this will be set automatically.

beta_max Optional[float]

Final value of annealing schedule beta in QIO Population Annealing. this will be set automatically.

population Optional[int]

The Number of walkers in the population. this will be set automatically.

schedule_type Optional[str]

Type of annealing schedule beta in QIO Population Annealing. Specifying 'linear' or 'geometric'. If None, this will be set 'linear'.

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]

sweeps in QIO Parallel Tempering. The number of sweeps. this will be set automatically.

replicas Optional[int]

The number of concurrent running copies for sampling. replicas must be the length of all_betas.

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]

sweeps in QIO Simulated Annealing. The number of sweeps. this will be set automatically.

beta_min Optional[float]

beta_start in QIO Simulated Annealing. Minimum (initial) inverse temperature. this will be set automatically.

beta_max Optional[float]

beta_stop in QIO Simulated Annealing. Maximum (final) inverse temperature. this will be set automatically.

num_reads Optional[int]

restarts in QIO Simulated Annealing. The number of samples. this will be set automatically.

seed Optional[int]

Seed value - used for reproducing results.

platform Optional[str]

"CPU" or "FPGA". If None, "CPU" will be set.

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]

sweeps in QIO Quantum Monte Carlo. The number of sweeps. this will be set automatically.

num_reads Optional[int]

restarts in QIO Quantum Monte Carlo. The number of samples. this will be set automatically.

beta Optional[float]

beta_start in QIO Quantum Monte Carlo. Minimum (initial) inverse temperature. this will be set automatically.

trotter Optional[int]

trotter_number in QIO Quantum Monte Carlo. The number of Trotter. this will be set automatically.

transverse_field_max Optional[float]

transverse_field_start in QIO Quantum Monte Carlo. The starting values of the external field applied to the annealing schedule. this will be set automatically.

transverse_field_min Optional[float]

transverse_field_stop in "QIO Quantum Monte Carlo. The stopping values of the external field applied to the annealing schedule. this will be set automatically.

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 True, the parameter search will be carried out, which tries to find bettervalues of multipliers for penalty terms.

num_search int

The number of parameter search iteration. This option works if search is True.

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 in QIOSSMC. alpha is the schedule for the stepping chance. this will be set automatically.

alpha_max Optional[float]

Final value of alpha in QIOSSMC. alpha is the schedule for the stepping chance. this will be set automatically.

beta_min Optional[float]

Initial value of beta in QIOSSMC. beta is the schedule for the resampling factor. this will be set automatically.

beta_max Optional[float]

Final value of beta in QIOSSMC. beta is the schedule for the resampling factor. this will be set automatically.

alpha_schedule_type Optional[str]

Schedule type of alpha in QIOSSMC. 'linear' or 'geometric'. If None will be set 'linear'.

beta_schedule_type Optional[str]

Schedule type of beta in QIOSSMC. 'linear' or 'geometric'. If None, this will be set 'linear'.

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]

sweeps in QIO Tabu Search. The number of sweeps. this will be set automatically.

tabu_tenure Optional[int]

Tenure of the tabu list in moves. this will be set automatically.

num_reads Optional[int]

restarts in QIO Tabu Search. The number of samples. this will be set automatically.

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.


Last update: 2023年5月24日