diff --git a/build/.DS_Store b/build/.DS_Store new file mode 100644 index 0000000..7dd6f56 Binary files /dev/null and b/build/.DS_Store differ diff --git a/build/doctrees/1-Introduction.doctree b/build/doctrees/1-Introduction.doctree index 6a92349..607d5ef 100644 Binary files a/build/doctrees/1-Introduction.doctree and b/build/doctrees/1-Introduction.doctree differ diff --git a/build/doctrees/2-Install.doctree b/build/doctrees/2-Install.doctree index 295a5be..20f3812 100644 Binary files a/build/doctrees/2-Install.doctree and b/build/doctrees/2-Install.doctree differ diff --git a/build/doctrees/3-Minimum_sample.doctree b/build/doctrees/3-Minimum_sample.doctree index 5c85512..6927f0a 100644 Binary files a/build/doctrees/3-Minimum_sample.doctree and b/build/doctrees/3-Minimum_sample.doctree differ diff --git a/build/doctrees/4-Parameters_customize.doctree b/build/doctrees/4-Parameters_customize.doctree index 8ca1561..7761013 100644 Binary files a/build/doctrees/4-Parameters_customize.doctree and b/build/doctrees/4-Parameters_customize.doctree differ diff --git a/build/doctrees/5-benchmark.doctree b/build/doctrees/5-benchmark.doctree index 600e705..a818f58 100644 Binary files a/build/doctrees/5-benchmark.doctree and b/build/doctrees/5-benchmark.doctree differ diff --git a/build/doctrees/6-HigherOrderModel.doctree b/build/doctrees/6-HigherOrderModel.doctree index a3db5f8..566d742 100644 Binary files a/build/doctrees/6-HigherOrderModel.doctree and b/build/doctrees/6-HigherOrderModel.doctree differ diff --git a/build/doctrees/7-hogehoge.doctree b/build/doctrees/7-hogehoge.doctree new file mode 100644 index 0000000..821df95 Binary files /dev/null and b/build/doctrees/7-hogehoge.doctree differ diff --git a/build/doctrees/apis/modules.doctree b/build/doctrees/apis/modules.doctree index 60bf20a..3aa080e 100644 Binary files a/build/doctrees/apis/modules.doctree and b/build/doctrees/apis/modules.doctree differ diff --git a/build/doctrees/apis/openjij.doctree b/build/doctrees/apis/openjij.doctree index 130d261..f7d16c7 100644 Binary files a/build/doctrees/apis/openjij.doctree and b/build/doctrees/apis/openjij.doctree differ diff --git a/build/doctrees/apis/openjij.model.doctree b/build/doctrees/apis/openjij.model.doctree index 3248383..b128e5e 100644 Binary files a/build/doctrees/apis/openjij.model.doctree and b/build/doctrees/apis/openjij.model.doctree differ diff --git a/build/doctrees/apis/openjij.sampler.chimera_gpu.doctree b/build/doctrees/apis/openjij.sampler.chimera_gpu.doctree index d018899..4ec8385 100644 Binary files a/build/doctrees/apis/openjij.sampler.chimera_gpu.doctree and b/build/doctrees/apis/openjij.sampler.chimera_gpu.doctree differ diff --git a/build/doctrees/apis/openjij.sampler.doctree b/build/doctrees/apis/openjij.sampler.doctree index 92ff50a..71b9123 100644 Binary files a/build/doctrees/apis/openjij.sampler.doctree and b/build/doctrees/apis/openjij.sampler.doctree differ diff --git a/build/doctrees/apis/openjij.utils.doctree b/build/doctrees/apis/openjij.utils.doctree index b0db5f0..1983094 100644 Binary files a/build/doctrees/apis/openjij.utils.doctree and b/build/doctrees/apis/openjij.utils.doctree differ diff --git a/build/doctrees/environment.pickle b/build/doctrees/environment.pickle index 644c4e8..19e74a4 100644 Binary files a/build/doctrees/environment.pickle and b/build/doctrees/environment.pickle differ diff --git a/build/doctrees/index.doctree b/build/doctrees/index.doctree index c850185..e1f2e5f 100644 Binary files a/build/doctrees/index.doctree and b/build/doctrees/index.doctree differ diff --git a/build/html/.DS_Store b/build/html/.DS_Store new file mode 100644 index 0000000..56d62f3 Binary files /dev/null and b/build/html/.DS_Store differ diff --git a/build/html/.buildinfo b/build/html/.buildinfo index 213a911..7f20e27 100644 --- a/build/html/.buildinfo +++ b/build/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 1b6f940f8d9e59c2bc24c23404cb4d10 +config: b5f240d1de9c371a4bcfd8495307cfd4 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/build/html/4-Parameters_customize.html b/build/html/4-Parameters_customize.html index 341f32e..a42d4ab 100644 --- a/build/html/4-Parameters_customize.html +++ b/build/html/4-Parameters_customize.html @@ -91,7 +91,31 @@
  • Install
  • Minimum sample code
  • Parameters customize
  • Benchmark
  • @@ -163,6 +187,37 @@

    Parameters customize

    Customize annealing schedule

    +

    In this page, let us show you how to set the parameters for annealing.

    +
    +

    SASampler

    +

    SASampler has arguments as follows.

    +
    +

    beta_min (float)

    +

    The minimum value of inverse temperature. Default to None. This corresponds to the starting temperature for annealing.
    If you do not specify anything, OpenJij will set the appropriate temperature automatically.

    +
    +
    +

    beta_max (float)

    +

    The maximum value of inverse temperature. Default to None. This corresponds to the ending temperature for annealing.
    If you do not specify anything, OpenJij will set the appropriate temperature automatically.

    +
    +
    +

    num_reads (int)

    +

    The number of iteration of annealing. Default to 1. If num_reads is specified, response has numerical results for the number of num_reads.

    +
    +
    +

    num_sweeps (int)

    +

    The number of Monte-Carlo steps (hereafter we called MCsteps) during annealing. Default to 1000.

    +
    +

    -note- MCsteps means the number of times to flip all the spins in the system. e.g., the case of N spin system, during 1 MCstep, you will have to flip these spins N times.

    +
    +
    +
    +

    schedule (list)

    +

    You can set the annealing schedule as you like. Default to None. If you want to calculate “alpha” MCsteps for a given inverse temperature “beta”, you can set it as [beta, alpha].

    +
    +
    +
    +

    Sample script 1

    +

    The following is an example of annealing with parameters beta_min=0.1, beta_max=100, num_reads=1000, num_sweeps=100.

    +
    +
    +

    Sample script 2

    +

    Here, let me show you an example how to specify an annealing schedule for user. The following figure shows an image of annealing schedule.

    +

    An example of SA schedule

    +

    At first, calculate 3 MCsteps with beta=0.5. Next, compute 5 MCsteps with beta=5. Finally, execute 6 MCsteps with beta=10.

    +

    A example of script that does this is following.

    +
    schedule = [[0.5, 3], [5, 5], [10, 6]]
     
     sampler = SASampler()
     response = sampler.sample_ising(h, J, schedule=schedule)
     
    +
    +

    SQASampler

    +

    SQASampler considers the total Hamiltonian with the following quantum terms when the Hamiltonian of the problem you want to solve is $\hat{H}_p$,

    +

    $ +\hat{H} = s\hat{H}p + (1-s) \Gamma \sum{i} \hat{\sigma}^x_i +$

    +

    and annealing is performed under the following statistical distribution,

    +

    $ +P(\hat{H}) \propto e^{-\beta \hat{H}} +$

    +

    SQASampler has arguments as follows.

    +
    +

    beta (float)

    +

    The inverse temperature. Default to 5.0.

    +
    +
    +

    Gamma (float)

    +

    The magnitude of the quantum term. Default to 1.0.

    +
    +
    +

    trotter (int)

    +

    The system Trotter decomposition number. Default to 4.

    +
    +
    +

    num_sweeps (int)

    +

    The number of MCsteps required between changing the annealing schedule parameter s from 0 to 1. Default to 1000.

    +
    +
    +

    num_reads (int)

    +

    The number of annealing iteration. Default to 1.

    +
    +
    +

    shcedule (list)

    +

    Set an annealing shcedule as you like. Default to None. For a given inverse temperature if you want to compute “alpha” MCsteps with the annealing schedule parameter “s”, you can set it as [s, alpha].
    If you want to specify the inverse temperature “beta” and compute “alpha” MCsteps with the annealing schedule parameter “s”, you can specify it as [s, beta, alpha].

    +
    +
    +
    +

    Sample script 1

    +

    The following example shows an annealing computation with beta=10, gamma=5, trotter=16, num_reads=1000, num_sweeps=100

    +
    import openjij as oj
    +
    +n = 10
    +h, J = {}, {}
    +for i in range(n-1):
    +    for j in range(i+1, n):
    +        J[i, j] = -1
    +
    +# set parameters 
    +beta = 10
    +gamma = 5
    +trotter = 16
    +nreads = 1000
    +nsweeps = 100
    +
    +sampler = SQASampler()
    +response = sampler.sample_ising(h, J, beta=beta, gamma=gamma, trotter=trotter, num_reads=nreads, num_sweeps=nsweeps)
    +
    +
    +
    +
    +

    Sample script 2

    +

    Here we introduce an example of a user-specified annealing schedule. The following figure shows an image of annealing schedule.

    +

    An example of SQA schedule with constant beta

    +

    First, 5 MCsteps with s=0.0. Next, 10 MCsteps with s=0.5. Finally, 5 MCsteps with s=1.

    +
    schedule = [[0, 5], [0.5, 10], [1, 5]]
    +
    +sampler = SQASampler()
    +response = sampler.sample_ising(h, J, schedule=schedule)
    +
    +
    +
    +
    +

    Sample script 3

    +

    In this section, we show you an example of a user-defined annealing shcedule in more detail.

    +

    An example of SQA schedule including beta

    +

    First, 5 MCsteps with s=0.0, beta=0.5. Next, 10 MCsteps with s=0.5, beta=1.0. Finally, 5 MCsteps with s=1, beta=10.

    +
    schedule = [[0, 0.5, 5], [0.5, 1.0, 10], [1, 10, 5]]
    +
    +sampler = SQASampler()
    +response = sampler.sample_ising(h, J, schedule=schedule)
    +
    +
    +
    +
    diff --git a/build/html/_images/schedule.png b/build/html/_images/schedule.png new file mode 100644 index 0000000..6022bdd Binary files /dev/null and b/build/html/_images/schedule.png differ diff --git a/build/html/_images/schedule_sqa.png b/build/html/_images/schedule_sqa.png new file mode 100644 index 0000000..1323ea4 Binary files /dev/null and b/build/html/_images/schedule_sqa.png differ diff --git a/build/html/_images/schedule_sqa_2.png b/build/html/_images/schedule_sqa_2.png new file mode 100644 index 0000000..d141bd3 Binary files /dev/null and b/build/html/_images/schedule_sqa_2.png differ diff --git a/build/html/_sources/.DS_Store b/build/html/_sources/.DS_Store new file mode 100644 index 0000000..bb77b08 Binary files /dev/null and b/build/html/_sources/.DS_Store differ diff --git a/build/html/_sources/4-Parameters_customize.md.txt b/build/html/_sources/4-Parameters_customize.md.txt index aa9851a..5dba05e 100644 --- a/build/html/_sources/4-Parameters_customize.md.txt +++ b/build/html/_sources/4-Parameters_customize.md.txt @@ -2,6 +2,40 @@ ## Customize annealing schedule +In this page, let us show you how to set the parameters for annealing. + +### SASampler + +`SASampler` has arguments as follows. + +#### beta_min (float) + +The minimum value of inverse temperature. Default to None. This corresponds to the starting temperature for annealing. +If you do not specify anything, OpenJij will set the appropriate temperature automatically. + +#### beta_max (float) + +The maximum value of inverse temperature. Default to None. This corresponds to the ending temperature for annealing. +If you do not specify anything, OpenJij will set the appropriate temperature automatically. + +#### num_reads (int) + +The number of iteration of annealing. Default to 1. If num_reads is specified, response has numerical results for the number of num_reads. + +#### num_sweeps (int) + +The number of Monte-Carlo steps (hereafter we called MCsteps) during annealing. Default to 1000. + +> -note- MCsteps means the number of times to flip all the spins in the system. e.g., the case of N spin system, during 1 MCstep, you will have to flip these spins N times. + +#### schedule (list) + +You can set the annealing schedule as you like. Default to None. If you want to calculate "alpha" MCsteps for a given inverse temperature "beta", you can set it as [beta, alpha]. + + +### Sample script 1 + +The following is an example of annealing with parameters `beta_min=0.1, beta_max=100, num_reads=1000, num_sweeps=100`. ```python import openjij as oj @@ -12,14 +46,124 @@ for i in range(n-1): for j in range(i+1, n): J[i, j] = -1 -# customized annealing schedule -# list of [beta, monte carlo steps in beta] -schedule = [ - [10, 3], - [ 5, 5], - [0.5, 10] -] +# set parameters +bmin = 0.1 +bmax = 100 +nreads = 1000 +nsweeps = 100 + +sampler = SASampler() +response = sampler.sample_ising(h, J, beta_min=bmin, beta_max=bmax, num_reads=nreads, num_sweeps=nsweeps) +``` + +### Sample script 2 + +Here, let me show you an example how to specify an annealing schedule for user. The following figure shows an image of annealing schedule. + +![An example of SA schedule](/images/4/schedule.png) + +At first, calculate 3 MCsteps with `beta=0.5`. Next, compute 5 MCsteps with `beta=5`. Finally, execute 6 MCsteps with `beta=10`. + +A example of script that does this is following. + +```python +schedule = [[0.5, 3], [5, 5], [10, 6]] sampler = SASampler() response = sampler.sample_ising(h, J, schedule=schedule) -``` \ No newline at end of file +``` + +### SQASampler + +SQASampler considers the total Hamiltonian with the following quantum terms when the Hamiltonian of the problem you want to solve is $\hat{H}_p$, + +$ +\hat{H} = s\hat{H}_p + (1-s) \Gamma \sum_{i} \hat{\sigma}^x_i +$ + +and annealing is performed under the following statistical distribution, + +$ +P(\hat{H}) \propto e^{-\beta \hat{H}} +$ + +`SQASampler` has arguments as follows. + +#### beta (float) + +The inverse temperature. Default to 5.0. + +#### Gamma (float) + +The magnitude of the quantum term. Default to 1.0. + +#### trotter (int) + +The system Trotter decomposition number. Default to 4. + +#### num_sweeps (int) + +The number of MCsteps required between changing the annealing schedule parameter `s` from 0 to 1. Default to 1000. + +#### num_reads (int) + +The number of annealing iteration. Default to 1. + +#### shcedule (list) + +Set an annealing shcedule as you like. Default to None. For a given inverse temperature if you want to compute "alpha" MCsteps with the annealing schedule parameter "s", you can set it as [s, alpha]. +If you want to specify the inverse temperature "beta" and compute "alpha" MCsteps with the annealing schedule parameter "s", you can specify it as [s, beta, alpha]. + +### Sample script 1 + +The following example shows an annealing computation with `beta=10, gamma=5, trotter=16, num_reads=1000, num_sweeps=100` + +```python +import openjij as oj + +n = 10 +h, J = {}, {} +for i in range(n-1): + for j in range(i+1, n): + J[i, j] = -1 + +# set parameters +beta = 10 +gamma = 5 +trotter = 16 +nreads = 1000 +nsweeps = 100 + +sampler = SQASampler() +response = sampler.sample_ising(h, J, beta=beta, gamma=gamma, trotter=trotter, num_reads=nreads, num_sweeps=nsweeps) +``` + +### Sample script 2 + +Here we introduce an example of a user-specified annealing schedule. The following figure shows an image of annealing schedule. + +![An example of SQA schedule with constant beta](/images/4/schedule_sqa.png) + +First, 5 MCsteps with `s=0.0`. Next, 10 MCsteps with `s=0.5`. Finally, 5 MCsteps with `s=1`. + +```python +schedule = [[0, 5], [0.5, 10], [1, 5]] + +sampler = SQASampler() +response = sampler.sample_ising(h, J, schedule=schedule) +``` + +### Sample script 3 + +In this section, we show you an example of a user-defined annealing shcedule in more detail. + +![An example of SQA schedule including beta](/images/4/schedule_sqa_2.png) + +First, 5 MCsteps with `s=0.0, beta=0.5`. Next, 10 MCsteps with `s=0.5, beta=1.0`. Finally, 5 MCsteps with `s=1, beta=10`. + +```python +schedule = [[0, 0.5, 5], [0.5, 1.0, 10], [1, 10, 5]] + +sampler = SQASampler() +response = sampler.sample_ising(h, J, schedule=schedule) +``` diff --git a/build/html/_sources/7-hogehoge.md.txt b/build/html/_sources/7-hogehoge.md.txt new file mode 100644 index 0000000..efda55f --- /dev/null +++ b/build/html/_sources/7-hogehoge.md.txt @@ -0,0 +1,34 @@ +# Higher order model + +If you want to handle higher order model as follows: + + ```math + H = \sum_{i}h_i\sigma_i + \sum_{i < j} J_{ij} \sigma_i \sigma_j + \sum_{i, j, k} K_{i,j,k} \sigma_i\sigma_j \sigma_k \cdots + ``` + +use ``.sample_hubo`` + +> HUBO: Higher order unconstraint binary optimization + +## Sample code +```python +import openjij as oj + +# Only SASampler can handle HUBO. +sampler = oj.SASampler() + +# make HUBO +h = {0: -1} +J = {(0, 1): -1} +K = {(0, 1, 2): 1} + +response = sampler.sample_hubo([h, J, K], var_type="SPIN") +response.states[0] +> [1, 1, -1] +``` + +## Note + +``.sample_hubo`` +- The first argument (``interactions``) must be in ascending order. +- Need ``var_type`` diff --git a/build/html/searchindex.js b/build/html/searchindex.js index 6547bd5..4ad3a7b 100644 --- a/build/html/searchindex.js +++ b/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["1-Introduction","2-Install","3-Minimum_sample","4-Parameters_customize","5-benchmark","6-HigherOrderModel","apis/modules","apis/openjij","apis/openjij.model","apis/openjij.sampler","apis/openjij.sampler.chimera_gpu","apis/openjij.utils","index"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":2,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,"sphinx.ext.viewcode":1,sphinx:56},filenames:["1-Introduction.md","2-Install.md","3-Minimum_sample.md","4-Parameters_customize.md","5-benchmark.md","6-HigherOrderModel.md","apis/modules.rst","apis/openjij.rst","apis/openjij.model.rst","apis/openjij.sampler.rst","apis/openjij.sampler.chimera_gpu.rst","apis/openjij.utils.rst","index.rst"],objects:{"":{openjij:[7,0,0,"-"]},"openjij.model":{chimera_model:[8,0,0,"-"],higher_order_model:[8,0,0,"-"],king_graph:[8,0,0,"-"],model:[8,0,0,"-"]},"openjij.model.chimera_model":{ChimeraModel:[8,1,1,""],make_ChimeraModel:[8,1,1,""],make_ChimeraModel_from_JSON:[8,1,1,""]},"openjij.model.higher_order_model":{BinaryHigherOrderModel:[8,2,1,""]},"openjij.model.higher_order_model.BinaryHigherOrderModel":{adj_dict:[8,3,1,""],calc_energy:[8,3,1,""],energy:[8,3,1,""]},"openjij.model.king_graph":{KingGraph:[8,1,1,""],make_KingGraph:[8,1,1,""],make_KingGraph_from_JSON:[8,1,1,""]},"openjij.model.model":{BinaryQuadraticModel:[8,1,1,""],adj:[8,4,1,""],indices:[8,4,1,""],linear:[8,4,1,""],make_BinaryQuadraticModel:[8,1,1,""],make_BinaryQuadraticModel_from_JSON:[8,1,1,""],offset:[8,4,1,""],quadratic:[8,4,1,""],var_type:[8,4,1,""]},"openjij.sampler":{chimera_gpu:[10,0,0,"-"],cmos_annealer:[9,0,0,"-"],csqa_sampler:[9,0,0,"-"],hubo_simulated_annealing:[9,0,0,"-"],response:[9,0,0,"-"],sa_sampler:[9,0,0,"-"],sampler:[9,0,0,"-"],sqa_sampler:[9,0,0,"-"]},"openjij.sampler.chimera_gpu":{base_gpu_chimera:[10,0,0,"-"],gpu_sa_sampler:[10,0,0,"-"],gpu_sqa_sampler:[10,0,0,"-"]},"openjij.sampler.chimera_gpu.base_gpu_chimera":{BaseGPUChimeraSampler:[10,2,1,""]},"openjij.sampler.chimera_gpu.base_gpu_chimera.BaseGPUChimeraSampler":{edgelist:[10,3,1,""],nodelist:[10,3,1,""],parameters:[10,3,1,""]},"openjij.sampler.chimera_gpu.gpu_sa_sampler":{GPUChimeraSASampler:[10,2,1,""]},"openjij.sampler.chimera_gpu.gpu_sa_sampler.GPUChimeraSASampler":{sample_ising:[10,3,1,""]},"openjij.sampler.chimera_gpu.gpu_sqa_sampler":{GPUChimeraSQASampler:[10,2,1,""]},"openjij.sampler.chimera_gpu.gpu_sqa_sampler.GPUChimeraSQASampler":{sample_ising:[10,3,1,""]},"openjij.sampler.cmos_annealer":{CMOSAnnealer:[9,2,1,""],NumpyEncoder:[9,2,1,""],defalut_beta_range:[9,1,1,""]},"openjij.sampler.cmos_annealer.CMOSAnnealer":{cmos_parameters:[9,4,1,""],edgelist:[9,3,1,""],make_json_request:[9,3,1,""],nodelist:[9,3,1,""],parameters:[9,3,1,""],properties:[9,3,1,""],sample_ising:[9,3,1,""]},"openjij.sampler.cmos_annealer.NumpyEncoder":{"default":[9,3,1,""]},"openjij.sampler.csqa_sampler":{CSQASampler:[9,2,1,""]},"openjij.sampler.csqa_sampler.CSQASampler":{sample_ising:[9,3,1,""]},"openjij.sampler.hubo_simulated_annealing":{default_schedule:[9,1,1,""],hubo_sa_sampling:[9,1,1,""],hubo_simulated_annealing:[9,1,1,""],measure_time:[9,1,1,""]},"openjij.sampler.response":{Response:[9,2,1,""]},"openjij.sampler.response.Response":{energies:[9,3,1,""],indices:[9,3,1,""],min_sampels:[9,3,1,""],states:[9,3,1,""],update_ising_states_energies:[9,3,1,""],update_trotter_ising_states_energies:[9,3,1,""]},"openjij.sampler.sa_sampler":{SASampler:[9,2,1,""],geometric_ising_beta_schedule:[9,1,1,""]},"openjij.sampler.sa_sampler.SASampler":{parameters:[9,3,1,""],sample_hubo:[9,3,1,""],sample_ising:[9,3,1,""]},"openjij.sampler.sampler":{BaseSampler:[9,2,1,""],measure_time:[9,1,1,""]},"openjij.sampler.sampler.BaseSampler":{parameters:[9,4,1,""],properties:[9,4,1,""],sample:[9,3,1,""],sample_ising:[9,3,1,""],sample_qubo:[9,3,1,""]},"openjij.sampler.sqa_sampler":{SQASampler:[9,2,1,""],linear_ising_schedule:[9,1,1,""]},"openjij.sampler.sqa_sampler.SQASampler":{parameters:[9,3,1,""],sample_ising:[9,3,1,""]},"openjij.utils":{benchmark:[11,0,0,"-"],decorator:[11,0,0,"-"],graph_utils:[11,0,0,"-"],res_convertor:[11,0,0,"-"],time_measure:[11,0,0,"-"]},"openjij.utils.benchmark":{residual_energy:[11,1,1,""],se_lower_tts:[11,1,1,""],se_residual_energy:[11,1,1,""],se_success_probability:[11,1,1,""],se_upper_tts:[11,1,1,""],solver_benchmark:[11,1,1,""],success_probability:[11,1,1,""],time_to_solution:[11,1,1,""]},"openjij.utils.decorator":{deprecated_alias:[11,1,1,""],disabled:[11,1,1,""],rename_kwargs:[11,1,1,""]},"openjij.utils.graph_utils":{chimera_to_ind:[11,1,1,""],qubo_to_ising:[11,1,1,""]},"openjij.utils.res_convertor":{convert_response:[11,1,1,""]},"openjij.variable_type":{cast_var_type:[7,1,1,""]},openjij:{model:[8,0,0,"-"],sampler:[9,0,0,"-"],utils:[11,0,0,"-"],variable_type:[7,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"],"2":["py","class","Python class"],"3":["py","method","Python method"],"4":["py","attribute","Python attribute"]},objtypes:{"0":"py:module","1":"py:function","2":"py:class","3":"py:method","4":"py:attribute"},terms:{"abstract":[9,10],"case":9,"class":[8,9,10],"default":[9,10],"final":9,"float":[8,9,10,11],"function":9,"import":[2,3,4,5],"int":[8,9,10,11],"new":9,"return":[8,9,10,11],"true":[8,9,10,11],"try":9,For:9,Ising:[0,8,9,10],TTS:[4,11],The:[5,8,9,11],Then:0,about:[9,10],access:9,addit:9,adj:8,adj_dict:8,adjac:8,adjgenc:[],algorithm:[9,10],alia:8,alias:11,allow:10,allow_nan:9,almost:9,also:8,although:0,amplitud:[9,10],anneal:[9,10,12],anti:12,api:[9,12],apt:1,arbitrari:9,arg:[4,11],argument:[5,9,10,11],arrai:[2,9],arrang:10,ascend:5,asic:[8,9],ask:0,attributeerror:10,automat:1,averag:[4,11],base:[8,9,10],base_gpu_chimera:9,basegpuchimerasampl:10,basesampl:[9,10],basic:8,been:1,below:[9,10,11],benchmark:[7,12],beta:[3,9,10],beta_max:[9,10],beta_min:[9,10],bhom:9,bia:[],bias:[8,9,10],binari:[5,8,9],binaryhigherordermodel:[8,9],binaryquadraticmodel:[8,9],bool:[8,9,10,11],bootstrap:1,bqm:[8,9],brew:1,calc_energi:8,calcul:[4,8,9,11],call:[4,9],callabl:11,can:[0,4,5,8,9],carlo:[3,9,10],cast_var_typ:7,cdot:5,cell:10,check_circular:9,chimera:[8,10,11],chimera_gpu:9,chimera_model:7,chimera_self:8,chimera_to_ind:11,chimeramodel:8,choos:8,classicalschedul:9,clone:1,cloud:9,cmake:12,cmo:9,cmos_anneal:7,cmos_model:9,cmos_paramet:9,cmosanneal:9,code:[8,12],coeffici:9,column:11,com:[1,9],commun:0,compil:1,compuat:11,comput:11,computation_tim:11,connect:8,constant:8,constructor:10,content:[6,12],continu:9,convert:[4,8,11],convert_respons:[4,11],cool:9,core:[0,9,10],corrdin:8,correct_st:4,correspond:[8,11],could:9,csqa:9,csqa_sampl:7,csqasampl:9,custom:12,cxxjij:[8,9],deal:8,decid:8,decor:[7,9],def:9,defalut_beta_rang:9,default_schedul:9,defin:[8,9,11],definit:9,degener:11,degre:9,deprecated_alia:11,descript:[9,11],detail:9,dict:[8,9,10,11],dictionari:[9,11],dimension:10,dimod:[4,8,9,10],disabl:11,doesn:10,dure:[1,9],dwavesampl:4,e_0:11,each:[8,9,10,11],easili:0,edg:10,edgelist:[9,10],element:8,els:9,empti:9,encod:9,energi:[2,4,8,9,11],energy_bia:[],ensure_ascii:9,error:[4,9,11],exampl:[8,9,10,12],except:9,execut:2,execution_tim:11,factori:8,fail:1,fals:[8,9,11],featur:4,ferromagnet:12,field:[9,10],file:1,first:5,flip:[9,10],fluctuat:[9,10],follow:[5,8,11],form:[8,10],found:1,fpga:[8,9],from:[4,8,9,10,11],frozenset:8,func:[9,11],func_nam:11,gamma:[9,10],gener:[8,9],geometr:9,geometric_ising_beta_schedul:9,get:[1,2,9,11],git:1,github:0,given:[8,10],going:0,gpu:[8,10],gpu_sa_sampl:9,gpu_sqa_sampl:9,gpuchimera:10,gpuchimerasasampl:10,gpuchimerasqasampl:10,graph:[8,9,10],graph_util:7,ground:11,h_i:5,h_p:9,hamiltonian:[8,9],handl:5,has:[0,1,9,11],have:9,height:11,help:0,heurist:0,higher:[8,9,12],higher_order_model:[7,9],how:8,html:9,http:[1,9],hubo:5,hubo_sa_sampl:9,hubo_simulated_ann:7,implement:[0,1,9],incompat:10,indent:9,index:[9,11,12],indic:[2,8,9],info:[9,11],inform:[9,10,11],inherit:[9,10],init_st:9,initi:[8,9,10],initial_st:[9,10],initil:[9,10],inplac:11,input:[9,10],instal:[0,12],instanc:4,integ:[8,9],interact:[5,8,9,10],interfac:0,intial:8,introduct:12,invers:[9,10],ising:[8,9,11],issu:1,iter:[4,9,10],join:0,json:[8,9],jsonencod:9,kei:[8,9,11],keyword:9,king:9,king_graph:7,king_interact:8,kinggraph:8,kinggraphmodel:8,kwarg:[8,9,10,11],label:[2,8],lambda:4,langl:11,lattic:[9,10],length:[9,10],less:9,let:[0,9],librari:0,like:9,linear:[8,9,10],linear_ising_schedul:9,list:[3,4,8,9,10,11],log:11,lower:11,machine_typ:[8,9],mai:1,make:[1,4,5,8,9],make_binaryquadraticmodel:8,make_binaryquadraticmodel_from_json:8,make_chimeramodel:8,make_chimeramodel_from_json:8,make_json_request:9,make_kinggraph:8,make_kinggraph_from_json:8,map:9,mat:11,match:8,matplotlib:4,matrix:11,max:9,maximum:[9,10],mean:[],measur:[9,11],measure_tim:9,measure_with_energi:11,method:[8,9,10],min:9,min_sampel:9,min_sampl:2,minim:[9,10],minimum:[9,10,12],minmum:9,model:[0,7,9,10,12],modul:[6,12],mont:[3,9,10],montecarlo:9,more:9,must:[5,9,11],name:9,ndarrai:11,necessari:9,need:[1,5],neq:8,newest:1,node:[9,10],nodelist:[9,10],none:[8,9,10],note:12,num_read:[2,4,9,10],num_sweep:[4,9,10],number:[4,9,10,11],numpi:[4,9,11],numpyencod:9,obj:[8,9],object:[8,9],odd:10,offset:8,old:1,one:[9,10],onli:[5,9],openjij:[1,2,3,4,5],optim:[0,5,9],option:[1,9,10],order:[8,9,12],org:1,overwrit:9,p_r:[4,11],packag:[6,12],page:12,pair:9,param:[8,9,11],paramet:[8,9,10,11,12],part:0,particip:0,pass:9,plan:1,pleas:[0,1,9],plt:4,probabl:[4,11],problem:[9,10],project:0,properti:[9,10],provid:[4,8],purg:1,pyplot:4,python:[0,1,9],q_energi:9,quadrat:[8,9,10],quantum:[9,10],quantumis:[],qubo:[0,8,9,11],qubo_to_is:11,qudrat:9,question:0,rais:[9,10,11],random:4,rang:[2,3,4,9],rangl:11,read:[9,10],recommend:1,record:9,redisu:11,ref_energi:11,refer:[9,11,12],reiniti:[9,10],reinitialize_st:[9,10],rename_kwarg:11,repositori:0,repres:[8,9,11],request:9,res:[9,10],res_convertor:7,residu:[4,11],residual_energi:11,respons:[2,3,4,5,7,10,11],result:[4,8,9,10],returen:11,row:11,run:[9,10],sa_sampl:[7,10],same:[8,9,11],sampl:[9,10,12],sample_:9,sample_hubo:[5,9],sample_is:[2,3,4,9,10],sample_qubo:9,sampler:[2,3,5,7,8,11,12],sampleset:[4,9],sasampl:[2,3,4,5,9,10],satisfi:8,schedul:[9,10,12],schedule_info:[9,10],se_lower_tt:11,se_residual_energi:11,se_success_prob:11,se_upper_tt:11,search:12,see:9,seed:[9,10],self:[8,9],separ:9,serializ:9,setup:12,show:[8,9],side:10,sigma_i:[5,8,9],sigma_j:[5,8],sigma_k:5,simul:[9,10,12],singl:[9,10],size:9,skipkei:9,slack:0,solus:11,solut:[4,11],solv:9,solver:[4,11],solver_benchmark:[4,11],sort:8,sort_kei:9,sourc:[7,8,9,10,11],specif:[8,9],specifi:9,spin:[2,5,8,9,10,11],sqa:[9,10],sqa_kwarg:[],sqa_sampl:[7,10],sqasampl:[9,10],standard:[4,11],state:[2,5,8,9,10,11],steop:9,step:[3,4,9,10],step_length:9,step_num:9,step_num_list:4,still:0,str:[8,9,10],strangth:[9,10],strength:9,string:8,structur:[9,10],subclass:9,submodul:6,subpackag:6,success:[4,11],success_prob:11,sudo:1,sum_:[5,8],sum_i:9,summari:11,support:9,sweep:[9,10],swendsenwang:9,system:[],system_class:[],take:4,tar:1,target:[9,10],tau:11,temparetur:[9,10],temperatur:[9,10],term:[8,9,10],than:9,therefor:0,thereshold:11,thi:[0,8,9,10],through:1,time:[2,4,9,11],time_list:[4,11],time_measur:7,time_nam:11,time_to_solut:11,token:9,topolog:8,total:[9,11],transvers:[9,10],trotter:[9,10],trotter_st:9,tts:11,tupl:[8,9],two:[9,10],type:[8,9,10,11],typeerror:9,unconstrain:9,unconstraint:[5,9],unit:[10,11],unit_num_l:[8,10],updat:[9,10],update_ising_states_energi:9,update_trotter_ising_states_energi:9,upper:11,usag:[8,9],use:[5,8,11],used:8,using:[1,9],usual:11,util:[7,9],valid:9,validate_chimera:8,valu:[8,9,10],valueerror:[9,10,11],var_typ:[5,7,8,9],variabl:[8,9,10],variable_typ:[6,8],vartyp:[8,9],verifi:8,version:1,vertic:9,via:9,violat:[9,10],want:[4,5,9],wave:12,web:9,wget:1,what:12,when:[8,11],where:9,whether:8,which:[9,10,11],width:11,work:10,wrapper:9,written:0,wsl:1,x_i:8,x_j:8,xvf:1,yet:1,you:[0,1,4,5,8,9],zero:9},titles:["Introduction","Install","Minimum sample code","Parameters customize","Benchmark","Higher order model","openjij","openjij package","openjij.model package","openjij.sampler package","openjij.sampler.chimera_gpu package","openjij.utils package","Welcome to OpenJij\u2019s documentation!"],titleterms:{Ising:2,anneal:[2,3],anti:4,base_gpu_chimera:10,benchmark:[4,11],chimera_gpu:10,chimera_model:8,cmake:1,cmos_anneal:9,code:[2,5],content:[7,8,9,10,11],csqa_sampl:9,cuda:1,custom:3,decor:11,document:12,enviro:1,exampl:4,ferromagnet:4,from:1,github:1,gpu:1,gpu_sa_sampl:10,gpu_sqa_sampl:10,graph_util:11,higher:5,higher_order_model:8,hubo_simulated_ann:9,indic:12,instal:1,introduct:0,king_graph:8,linux:1,maco:1,minimum:2,model:[2,4,5,8],modul:[7,8,9,10,11],note:[1,5],openjij:[0,6,7,8,9,10,11,12],order:5,packag:[7,8,9,10,11],paramet:3,pip:1,problem:1,report:1,res_convertor:11,respons:9,sa_sampl:9,sampl:[2,5],sampler:[4,9,10],schedul:3,setup:1,simul:2,sqa_sampl:9,submodul:[7,8,9,10,11],subpackag:[7,9],tabl:12,time_measur:11,ubuntu:1,util:11,variable_typ:7,wave:4,welcom:12,what:0,window:1}}) \ No newline at end of file +Search.setIndex({docnames:["1-Introduction","2-Install","3-Minimum_sample","4-Parameters_customize","5-benchmark","6-HigherOrderModel","apis/modules","apis/openjij","apis/openjij.model","apis/openjij.sampler","apis/openjij.sampler.chimera_gpu","apis/openjij.utils","index"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":2,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,"sphinx.ext.viewcode":1,sphinx:56},filenames:["1-Introduction.md","2-Install.md","3-Minimum_sample.md","4-Parameters_customize.md","5-benchmark.md","6-HigherOrderModel.md","apis/modules.rst","apis/openjij.rst","apis/openjij.model.rst","apis/openjij.sampler.rst","apis/openjij.sampler.chimera_gpu.rst","apis/openjij.utils.rst","index.rst"],objects:{"":{openjij:[7,0,0,"-"]},"openjij.model":{chimera_model:[8,0,0,"-"],higher_order_model:[8,0,0,"-"],king_graph:[8,0,0,"-"],model:[8,0,0,"-"]},"openjij.model.chimera_model":{ChimeraModel:[8,1,1,""],make_ChimeraModel:[8,1,1,""],make_ChimeraModel_from_JSON:[8,1,1,""]},"openjij.model.higher_order_model":{BinaryHigherOrderModel:[8,2,1,""]},"openjij.model.higher_order_model.BinaryHigherOrderModel":{adj_dict:[8,3,1,""],calc_energy:[8,3,1,""],energy:[8,3,1,""]},"openjij.model.king_graph":{KingGraph:[8,1,1,""],make_KingGraph:[8,1,1,""],make_KingGraph_from_JSON:[8,1,1,""]},"openjij.model.model":{BinaryQuadraticModel:[8,1,1,""],adj:[8,4,1,""],indices:[8,4,1,""],linear:[8,4,1,""],make_BinaryQuadraticModel:[8,1,1,""],make_BinaryQuadraticModel_from_JSON:[8,1,1,""],offset:[8,4,1,""],quadratic:[8,4,1,""],var_type:[8,4,1,""]},"openjij.sampler":{chimera_gpu:[10,0,0,"-"],cmos_annealer:[9,0,0,"-"],csqa_sampler:[9,0,0,"-"],hubo_simulated_annealing:[9,0,0,"-"],response:[9,0,0,"-"],sa_sampler:[9,0,0,"-"],sampler:[9,0,0,"-"],sqa_sampler:[9,0,0,"-"]},"openjij.sampler.chimera_gpu":{base_gpu_chimera:[10,0,0,"-"],gpu_sa_sampler:[10,0,0,"-"],gpu_sqa_sampler:[10,0,0,"-"]},"openjij.sampler.chimera_gpu.base_gpu_chimera":{BaseGPUChimeraSampler:[10,2,1,""]},"openjij.sampler.chimera_gpu.base_gpu_chimera.BaseGPUChimeraSampler":{edgelist:[10,3,1,""],nodelist:[10,3,1,""],parameters:[10,3,1,""]},"openjij.sampler.chimera_gpu.gpu_sa_sampler":{GPUChimeraSASampler:[10,2,1,""]},"openjij.sampler.chimera_gpu.gpu_sa_sampler.GPUChimeraSASampler":{sample_ising:[10,3,1,""]},"openjij.sampler.chimera_gpu.gpu_sqa_sampler":{GPUChimeraSQASampler:[10,2,1,""]},"openjij.sampler.chimera_gpu.gpu_sqa_sampler.GPUChimeraSQASampler":{sample_ising:[10,3,1,""]},"openjij.sampler.cmos_annealer":{CMOSAnnealer:[9,2,1,""],NumpyEncoder:[9,2,1,""],defalut_beta_range:[9,1,1,""]},"openjij.sampler.cmos_annealer.CMOSAnnealer":{cmos_parameters:[9,4,1,""],edgelist:[9,3,1,""],make_json_request:[9,3,1,""],nodelist:[9,3,1,""],parameters:[9,3,1,""],properties:[9,3,1,""],sample_ising:[9,3,1,""]},"openjij.sampler.cmos_annealer.NumpyEncoder":{"default":[9,3,1,""]},"openjij.sampler.csqa_sampler":{CSQASampler:[9,2,1,""]},"openjij.sampler.csqa_sampler.CSQASampler":{sample_ising:[9,3,1,""]},"openjij.sampler.hubo_simulated_annealing":{default_schedule:[9,1,1,""],hubo_sa_sampling:[9,1,1,""],hubo_simulated_annealing:[9,1,1,""],measure_time:[9,1,1,""]},"openjij.sampler.response":{Response:[9,2,1,""]},"openjij.sampler.response.Response":{energies:[9,3,1,""],indices:[9,3,1,""],min_sampels:[9,3,1,""],states:[9,3,1,""],update_ising_states_energies:[9,3,1,""],update_trotter_ising_states_energies:[9,3,1,""]},"openjij.sampler.sa_sampler":{SASampler:[9,2,1,""],geometric_ising_beta_schedule:[9,1,1,""]},"openjij.sampler.sa_sampler.SASampler":{parameters:[9,3,1,""],sample_hubo:[9,3,1,""],sample_ising:[9,3,1,""]},"openjij.sampler.sampler":{BaseSampler:[9,2,1,""],measure_time:[9,1,1,""]},"openjij.sampler.sampler.BaseSampler":{parameters:[9,4,1,""],properties:[9,4,1,""],sample:[9,3,1,""],sample_ising:[9,3,1,""],sample_qubo:[9,3,1,""]},"openjij.sampler.sqa_sampler":{SQASampler:[9,2,1,""],linear_ising_schedule:[9,1,1,""]},"openjij.sampler.sqa_sampler.SQASampler":{parameters:[9,3,1,""],sample_ising:[9,3,1,""]},"openjij.utils":{benchmark:[11,0,0,"-"],decorator:[11,0,0,"-"],graph_utils:[11,0,0,"-"],res_convertor:[11,0,0,"-"],time_measure:[11,0,0,"-"]},"openjij.utils.benchmark":{residual_energy:[11,1,1,""],se_lower_tts:[11,1,1,""],se_residual_energy:[11,1,1,""],se_success_probability:[11,1,1,""],se_upper_tts:[11,1,1,""],solver_benchmark:[11,1,1,""],success_probability:[11,1,1,""],time_to_solution:[11,1,1,""]},"openjij.utils.decorator":{deprecated_alias:[11,1,1,""],disabled:[11,1,1,""],rename_kwargs:[11,1,1,""]},"openjij.utils.graph_utils":{chimera_to_ind:[11,1,1,""],qubo_to_ising:[11,1,1,""]},"openjij.utils.res_convertor":{convert_response:[11,1,1,""]},"openjij.variable_type":{cast_var_type:[7,1,1,""]},openjij:{model:[8,0,0,"-"],sampler:[9,0,0,"-"],utils:[11,0,0,"-"],variable_type:[7,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"],"2":["py","class","Python class"],"3":["py","method","Python method"],"4":["py","attribute","Python attribute"]},objtypes:{"0":"py:module","1":"py:function","2":"py:class","3":"py:method","4":"py:attribute"},terms:{"abstract":[9,10],"case":[3,9],"class":[8,9,10],"default":[3,9,10],"final":[3,9],"float":[8,9,10,11],"function":9,"import":[2,3,4,5],"int":[8,9,10,11],"new":9,"return":[8,9,10,11],"true":[8,9,10,11],"try":9,For:[3,9],Ising:[0,8,9,10],TTS:[4,11],The:[3,5,8,9,11],Then:0,about:[9,10],access:9,addit:9,adj:8,adj_dict:8,adjac:8,adjgenc:[],algorithm:[9,10],alia:8,alias:11,all:3,allow:10,allow_nan:9,almost:9,alpha:3,also:8,although:0,amplitud:[9,10],anneal:[9,10,12],anti:12,anyth:3,api:[9,12],appropri:3,apt:1,arbitrari:9,arg:[4,11],argument:[3,5,9,10,11],arrai:[2,9],arrang:10,ascend:5,asic:[8,9],ask:0,attributeerror:10,automat:[1,3],averag:[4,11],base:[8,9,10],base_gpu_chimera:9,basegpuchimerasampl:10,basesampl:[9,10],basic:8,been:1,below:[9,10,11],benchmark:[7,12],beta:[9,10],beta_max:[9,10],beta_min:[9,10],between:3,bhom:9,bia:[],bias:[8,9,10],binari:[5,8,9],binaryhigherordermodel:[8,9],binaryquadraticmodel:[8,9],bmax:3,bmin:3,bool:[8,9,10,11],bootstrap:1,bqm:[8,9],brew:1,calc_energi:8,calcul:[3,4,8,9,11],call:[3,4,9],callabl:11,can:[0,3,4,5,8,9],carlo:[3,9,10],cast_var_typ:7,cdot:5,cell:10,chang:3,check_circular:9,chimera:[8,10,11],chimera_gpu:9,chimera_model:7,chimera_self:8,chimera_to_ind:11,chimeramodel:8,choos:8,classicalschedul:9,clone:1,cloud:9,cmake:12,cmo:9,cmos_anneal:7,cmos_model:9,cmos_paramet:9,cmosanneal:9,code:[8,12],coeffici:9,column:11,com:[1,9],commun:0,compil:1,compuat:11,comput:[3,11],computation_tim:11,connect:8,consid:3,constant:8,constructor:10,content:[6,12],continu:9,convert:[4,8,11],convert_respons:[4,11],cool:9,core:[0,9,10],corrdin:8,correct_st:4,correspond:[3,8,11],could:9,csqa:9,csqa_sampl:7,csqasampl:9,custom:12,cxxjij:[8,9],deal:8,decid:8,decomposit:3,decor:[7,9],def:9,defalut_beta_rang:9,default_schedul:9,defin:[3,8,9,11],definit:9,degener:11,degre:9,deprecated_alia:11,descript:[9,11],detail:[3,9],dict:[8,9,10,11],dictionari:[9,11],dimension:10,dimod:[4,8,9,10],disabl:11,distribut:3,doe:3,doesn:10,dure:[1,3,9],dwavesampl:4,e_0:11,each:[8,9,10,11],easili:0,edg:10,edgelist:[9,10],element:8,els:9,empti:9,encod:9,end:3,energi:[2,4,8,9,11],energy_bia:[],ensure_ascii:9,error:[4,9,11],exampl:[3,8,9,10,12],except:9,execut:[2,3],execution_tim:11,factori:8,fail:1,fals:[8,9,11],featur:4,ferromagnet:12,field:[9,10],figur:3,file:1,first:[3,5],flip:[3,9,10],fluctuat:[9,10],follow:[3,5,8,11],form:[8,10],found:1,fpga:[8,9],from:[3,4,8,9,10,11],frozenset:8,func:[9,11],func_nam:11,gamma:[9,10],gener:[8,9],geometr:9,geometric_ising_beta_schedul:9,get:[1,2,9,11],git:1,github:0,given:[3,8,10],going:0,gpu:[8,10],gpu_sa_sampl:9,gpu_sqa_sampl:9,gpuchimera:10,gpuchimerasasampl:10,gpuchimerasqasampl:10,graph:[8,9,10],graph_util:7,ground:11,h_i:5,h_p:9,hamiltonian:[3,8,9],handl:5,has:[0,1,3,9,11],hat:3,have:[3,9],height:11,help:0,here:3,hereaft:3,heurist:0,higher:[8,9,12],higher_order_model:[7,9],how:[3,8],html:9,http:[1,9],hubo:5,hubo_sa_sampl:9,hubo_simulated_ann:7,imag:3,implement:[0,1,9],incompat:10,indent:9,index:[9,11,12],indic:[2,8,9],info:[9,11],inform:[9,10,11],inherit:[9,10],init_st:9,initi:[8,9,10],initial_st:[9,10],initil:[9,10],inplac:11,input:[9,10],instal:[0,12],instanc:4,integ:[8,9],interact:[5,8,9,10],interfac:0,intial:8,introduc:3,introduct:12,invers:[3,9,10],ising:[8,9,11],issu:1,iter:[3,4,9,10],join:0,json:[8,9],jsonencod:9,kei:[8,9,11],keyword:9,king:9,king_graph:7,king_interact:8,kinggraph:8,kinggraphmodel:8,kwarg:[8,9,10,11],label:[2,8],lambda:4,langl:11,lattic:[9,10],length:[9,10],less:9,let:[0,3,9],librari:0,like:[3,9],linear:[8,9,10],linear_ising_schedul:9,list:[4,8,9,10,11],log:11,lower:11,machine_typ:[8,9],magnitud:3,mai:1,make:[1,4,5,8,9],make_binaryquadraticmodel:8,make_binaryquadraticmodel_from_json:8,make_chimeramodel:8,make_chimeramodel_from_json:8,make_json_request:9,make_kinggraph:8,make_kinggraph_from_json:8,map:9,mat:11,match:8,matplotlib:4,matrix:11,max:[3,9],maximum:[3,9,10],mcstep:3,mean:3,measur:[9,11],measure_tim:9,measure_with_energi:11,method:[8,9,10],min:[3,9],min_sampel:9,min_sampl:2,minim:[9,10],minimum:[3,9,10,12],minmum:9,model:[0,7,9,10,12],modul:[6,12],mont:[3,9,10],montecarlo:9,more:[3,9],must:[5,9,11],name:9,ndarrai:11,necessari:9,need:[1,5],neq:8,newest:1,next:3,node:[9,10],nodelist:[9,10],none:[3,8,9,10],note:[3,12],nread:3,nsweep:3,num:3,num_read:[2,4,9,10],num_sweep:[4,9,10],number:[3,4,9,10,11],numer:3,numpi:[4,9,11],numpyencod:9,obj:[8,9],object:[8,9],odd:10,offset:8,old:1,one:[9,10],onli:[5,9],openjij:[1,2,3,4,5],optim:[0,5,9],option:[1,9,10],order:[8,9,12],org:1,overwrit:9,p_r:[4,11],packag:[6,12],page:[3,12],pair:9,param:[8,9,11],paramet:[8,9,10,11,12],part:0,particip:0,pass:9,perform:3,plan:1,pleas:[0,1,9],plt:4,probabl:[4,11],problem:[3,9,10],project:0,properti:[9,10],propto:3,provid:[4,8],purg:1,pyplot:4,python:[0,1,9],q_energi:9,quadrat:[8,9,10],quantum:[3,9,10],quantumis:[],qubo:[0,8,9,11],qubo_to_is:11,qudrat:9,question:0,rais:[9,10,11],random:4,rang:[2,3,4,9],rangl:11,read:[3,9,10],recommend:1,record:9,redisu:11,ref_energi:11,refer:[9,11,12],reiniti:[9,10],reinitialize_st:[9,10],rename_kwarg:11,repositori:0,repres:[8,9,11],request:9,requir:3,res:[9,10],res_convertor:7,residu:[4,11],residual_energi:11,respons:[2,3,4,5,7,10,11],result:[3,4,8,9,10],returen:11,row:11,run:[9,10],sa_sampl:[7,10],same:[8,9,11],sampl:[9,10,12],sample_:9,sample_hubo:[5,9],sample_is:[2,3,4,9,10],sample_qubo:9,sampler:[2,3,5,7,8,11,12],sampleset:[4,9],sasampl:[2,4,5,9,10],satisfi:8,schedul:[9,10,12],schedule_info:[9,10],se_lower_tt:11,se_residual_energi:11,se_success_prob:11,se_upper_tt:11,search:12,section:3,see:9,seed:[9,10],self:[8,9],separ:9,serializ:9,set:3,setup:12,show:[3,8,9],side:10,sigma:3,sigma_i:[5,8,9],sigma_j:[5,8],sigma_k:5,simul:[9,10,12],singl:[9,10],size:9,skipkei:9,slack:0,solus:11,solut:[4,11],solv:[3,9],solver:[4,11],solver_benchmark:[4,11],sort:8,sort_kei:9,sourc:[7,8,9,10,11],specif:[8,9],specifi:[3,9],spin:[2,3,5,8,9,10,11],sqa:[9,10],sqa_kwarg:[],sqa_sampl:[7,10],sqasampl:[9,10],standard:[4,11],start:3,state:[2,5,8,9,10,11],statist:3,steop:9,step:[3,4,9,10],step_length:9,step_num:9,step_num_list:4,still:0,str:[8,9,10],strangth:[9,10],strength:9,string:8,structur:[9,10],subclass:9,submodul:6,subpackag:6,success:[4,11],success_prob:11,sudo:1,sum:3,sum_:[5,8],sum_i:9,summari:11,support:9,sweep:[3,9,10],swendsenwang:9,system:3,system_class:[],take:4,tar:1,target:[9,10],tau:11,temparetur:[9,10],temperatur:[3,9,10],term:[3,8,9,10],than:9,therefor:0,thereshold:11,thi:[0,3,8,9,10],through:1,time:[2,3,4,9,11],time_list:[4,11],time_measur:7,time_nam:11,time_to_solut:11,token:9,topolog:8,total:[3,9,11],transvers:[9,10],trotter:[9,10],trotter_st:9,tts:11,tupl:[8,9],two:[9,10],type:[8,9,10,11],typeerror:9,unconstrain:9,unconstraint:[5,9],under:3,unit:[10,11],unit_num_l:[8,10],updat:[9,10],update_ising_states_energi:9,update_trotter_ising_states_energi:9,upper:11,usag:[8,9],use:[5,8,11],used:8,user:3,using:[1,9],usual:11,util:[7,9],valid:9,validate_chimera:8,valu:[3,8,9,10],valueerror:[9,10,11],var_typ:[5,7,8,9],variabl:[8,9,10],variable_typ:[6,8],vartyp:[8,9],verifi:8,version:1,vertic:9,via:9,violat:[9,10],want:[3,4,5,9],wave:12,web:9,wget:1,what:12,when:[3,8,11],where:9,whether:8,which:[9,10,11],width:11,work:10,wrapper:9,written:0,wsl:1,x_i:8,x_j:8,xvf:1,yet:1,you:[0,1,3,4,5,8,9],zero:9},titles:["Introduction","Install","Minimum sample code","Parameters customize","Benchmark","Higher order model","openjij","openjij package","openjij.model package","openjij.sampler package","openjij.sampler.chimera_gpu package","openjij.utils package","Welcome to OpenJij\u2019s documentation!"],titleterms:{"float":3,"int":3,Ising:2,anneal:[2,3],anti:4,base_gpu_chimera:10,benchmark:[4,11],beta:3,beta_max:3,beta_min:3,chimera_gpu:10,chimera_model:8,cmake:1,cmos_anneal:9,code:[2,5],content:[7,8,9,10,11],csqa_sampl:9,cuda:1,custom:3,decor:11,document:12,enviro:1,exampl:4,ferromagnet:4,from:1,gamma:3,github:1,gpu:1,gpu_sa_sampl:10,gpu_sqa_sampl:10,graph_util:11,higher:5,higher_order_model:8,hubo_simulated_ann:9,indic:12,instal:1,introduct:0,king_graph:8,linux:1,list:3,maco:1,minimum:2,model:[2,4,5,8],modul:[7,8,9,10,11],note:[1,5],num_read:3,num_sweep:3,openjij:[0,6,7,8,9,10,11,12],order:5,packag:[7,8,9,10,11],paramet:3,pip:1,problem:1,report:1,res_convertor:11,respons:9,sa_sampl:9,sampl:[2,3,5],sampler:[4,9,10],sasampl:3,schedul:3,script:3,setup:1,shcedul:3,simul:2,sqa_sampl:9,sqasampl:3,submodul:[7,8,9,10,11],subpackag:[7,9],tabl:12,time_measur:11,trotter:3,ubuntu:1,util:11,variable_typ:7,wave:4,welcom:12,what:0,window:1}}) \ No newline at end of file diff --git a/source/4-Parameters_customize.md b/source/4-Parameters_customize.md index aa9851a..5dba05e 100644 --- a/source/4-Parameters_customize.md +++ b/source/4-Parameters_customize.md @@ -2,6 +2,40 @@ ## Customize annealing schedule +In this page, let us show you how to set the parameters for annealing. + +### SASampler + +`SASampler` has arguments as follows. + +#### beta_min (float) + +The minimum value of inverse temperature. Default to None. This corresponds to the starting temperature for annealing. +If you do not specify anything, OpenJij will set the appropriate temperature automatically. + +#### beta_max (float) + +The maximum value of inverse temperature. Default to None. This corresponds to the ending temperature for annealing. +If you do not specify anything, OpenJij will set the appropriate temperature automatically. + +#### num_reads (int) + +The number of iteration of annealing. Default to 1. If num_reads is specified, response has numerical results for the number of num_reads. + +#### num_sweeps (int) + +The number of Monte-Carlo steps (hereafter we called MCsteps) during annealing. Default to 1000. + +> -note- MCsteps means the number of times to flip all the spins in the system. e.g., the case of N spin system, during 1 MCstep, you will have to flip these spins N times. + +#### schedule (list) + +You can set the annealing schedule as you like. Default to None. If you want to calculate "alpha" MCsteps for a given inverse temperature "beta", you can set it as [beta, alpha]. + + +### Sample script 1 + +The following is an example of annealing with parameters `beta_min=0.1, beta_max=100, num_reads=1000, num_sweeps=100`. ```python import openjij as oj @@ -12,14 +46,124 @@ for i in range(n-1): for j in range(i+1, n): J[i, j] = -1 -# customized annealing schedule -# list of [beta, monte carlo steps in beta] -schedule = [ - [10, 3], - [ 5, 5], - [0.5, 10] -] +# set parameters +bmin = 0.1 +bmax = 100 +nreads = 1000 +nsweeps = 100 + +sampler = SASampler() +response = sampler.sample_ising(h, J, beta_min=bmin, beta_max=bmax, num_reads=nreads, num_sweeps=nsweeps) +``` + +### Sample script 2 + +Here, let me show you an example how to specify an annealing schedule for user. The following figure shows an image of annealing schedule. + +![An example of SA schedule](/images/4/schedule.png) + +At first, calculate 3 MCsteps with `beta=0.5`. Next, compute 5 MCsteps with `beta=5`. Finally, execute 6 MCsteps with `beta=10`. + +A example of script that does this is following. + +```python +schedule = [[0.5, 3], [5, 5], [10, 6]] sampler = SASampler() response = sampler.sample_ising(h, J, schedule=schedule) -``` \ No newline at end of file +``` + +### SQASampler + +SQASampler considers the total Hamiltonian with the following quantum terms when the Hamiltonian of the problem you want to solve is $\hat{H}_p$, + +$ +\hat{H} = s\hat{H}_p + (1-s) \Gamma \sum_{i} \hat{\sigma}^x_i +$ + +and annealing is performed under the following statistical distribution, + +$ +P(\hat{H}) \propto e^{-\beta \hat{H}} +$ + +`SQASampler` has arguments as follows. + +#### beta (float) + +The inverse temperature. Default to 5.0. + +#### Gamma (float) + +The magnitude of the quantum term. Default to 1.0. + +#### trotter (int) + +The system Trotter decomposition number. Default to 4. + +#### num_sweeps (int) + +The number of MCsteps required between changing the annealing schedule parameter `s` from 0 to 1. Default to 1000. + +#### num_reads (int) + +The number of annealing iteration. Default to 1. + +#### shcedule (list) + +Set an annealing shcedule as you like. Default to None. For a given inverse temperature if you want to compute "alpha" MCsteps with the annealing schedule parameter "s", you can set it as [s, alpha]. +If you want to specify the inverse temperature "beta" and compute "alpha" MCsteps with the annealing schedule parameter "s", you can specify it as [s, beta, alpha]. + +### Sample script 1 + +The following example shows an annealing computation with `beta=10, gamma=5, trotter=16, num_reads=1000, num_sweeps=100` + +```python +import openjij as oj + +n = 10 +h, J = {}, {} +for i in range(n-1): + for j in range(i+1, n): + J[i, j] = -1 + +# set parameters +beta = 10 +gamma = 5 +trotter = 16 +nreads = 1000 +nsweeps = 100 + +sampler = SQASampler() +response = sampler.sample_ising(h, J, beta=beta, gamma=gamma, trotter=trotter, num_reads=nreads, num_sweeps=nsweeps) +``` + +### Sample script 2 + +Here we introduce an example of a user-specified annealing schedule. The following figure shows an image of annealing schedule. + +![An example of SQA schedule with constant beta](/images/4/schedule_sqa.png) + +First, 5 MCsteps with `s=0.0`. Next, 10 MCsteps with `s=0.5`. Finally, 5 MCsteps with `s=1`. + +```python +schedule = [[0, 5], [0.5, 10], [1, 5]] + +sampler = SQASampler() +response = sampler.sample_ising(h, J, schedule=schedule) +``` + +### Sample script 3 + +In this section, we show you an example of a user-defined annealing shcedule in more detail. + +![An example of SQA schedule including beta](/images/4/schedule_sqa_2.png) + +First, 5 MCsteps with `s=0.0, beta=0.5`. Next, 10 MCsteps with `s=0.5, beta=1.0`. Finally, 5 MCsteps with `s=1, beta=10`. + +```python +schedule = [[0, 0.5, 5], [0.5, 1.0, 10], [1, 10, 5]] + +sampler = SQASampler() +response = sampler.sample_ising(h, J, schedule=schedule) +``` diff --git a/source/images/.DS_Store b/source/images/.DS_Store new file mode 100644 index 0000000..732f166 Binary files /dev/null and b/source/images/.DS_Store differ diff --git a/source/images/4/schedule.png b/source/images/4/schedule.png new file mode 100644 index 0000000..6022bdd Binary files /dev/null and b/source/images/4/schedule.png differ diff --git a/source/images/4/schedule_sqa.png b/source/images/4/schedule_sqa.png new file mode 100644 index 0000000..1323ea4 Binary files /dev/null and b/source/images/4/schedule_sqa.png differ diff --git a/source/images/4/schedule_sqa_2.png b/source/images/4/schedule_sqa_2.png new file mode 100644 index 0000000..d141bd3 Binary files /dev/null and b/source/images/4/schedule_sqa_2.png differ