Dynex SDK
Module contents
Dynex SDK (beta) Neuromorphic Computing Library Copyright (c) 2021-2023, Dynex Developers
All rights reserved.
- Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- class dynex.BQM(bqm, relabel=True, logging=False, formula=2)[source]
Bases:
object
Creates a model, which can be used by the sampler based on a Binary Quadratic Model (BQM) problem. The Dynex sampler needs a “model” object for sampling. Based on the problem formulation, multiple model classes are supported.
- Parameters
- bqm
The BQM to be used for this model (class:dimod.BinaryQuadraticModel)
- relabel
Defines if the BQM’s variable names should be relabeled (bool)
- logging
True to show model creation information, False to silence outputs (bool)
- Returns
class:dynex.model
- Example
Dimod’s dimod.binary.BinaryQuadraticModel (BQM) contains linear and quadratic biases for problems formulated as binary quadratic models as well as additional information such as variable labels and offset.
bqm = dimod.BinaryQuadraticModel({'x1': 1.0, 'x2': -1.5, 'x3': 2.0}, {('x1', 'x2'): 1.0, ('x2', 'x3'): -2.0}, 0.0, dimod.BINARY) model = dynex.BQM(bqm)
- class dynex.CQM(cqm, relabel=True, logging=False, formula=2)[source]
Bases:
object
Creates a model, which can be used by the sampler based on a Constraint Quadratic Model (CQM) problem. The Dynex sampler needs a “model” object for sampling. Based on the problem formulation, multiple model classes are supported.
- Parameters
- cqm
The BQM to be used for this model (class:dimod.ConstraintQuadraticModel)
- relabel
Defines if the BQM’s variable names should be relabeled (bool)
- logging
True to show model creation information, False to silence outputs (bool)
- Returns
class:dynex.model
- Example
Dimod’s dimod.ConstrainedQuadraticModel (CQM) contains linear and quadratic biases for problems formulated as constrained quadratic models as well as additional information such as variable labels, offsets, and equality and inequality constraints.
num_widget_a = dimod.Integer('num_widget_a', upper_bound=7) num_widget_b = dimod.Integer('num_widget_b', upper_bound=3) cqm = dimod.ConstrainedQuadraticModel() cqm.set_objective(-3 * num_widget_a - 4 * num_widget_b) cqm.add_constraint(num_widget_a + num_widget_b <= 5, label='total widgets') model = dynex.CQM(cqm)
- class dynex.DynexSampler(model, logging=True, mainnet=True, description='Dynex SDK Job', test=False, bnb=True)[source]
Bases:
object
Initialises the sampler object given a model.
- Parameters
- logging
Defines if the sampling process should be quiet with no terminal output (FALSE) or if process updates are to be shown (bool)
- mainnet
Defines if the mainnet (Dynex platform sampling) or the testnet (local sampling) is being used for sampling (bool)
- description
Defines the description for the sampling, which is shown in Dynex job dashboards as well as in the market place (string)
- Returns
class:dynex.samper
- Example
sampler = dynex.DynexSampler(model)
- sample(num_reads=32, annealing_time=10, clones=1, switchfraction=0.0, alpha=20, beta=20, gamma=1, delta=1, epsilon=1, zeta=1, minimum_stepsize=6e-08, debugging=False, block_fee=0)[source]
The main sampling function:
- Parameters
- num_reads
Defines the number of parallel samples to be performed (int value in the range of [32, MAX_NUM_READS] as defined in your license)
- annealing_time
Defines the number of integration steps for the sampling. Models are being converted into neuromorphic circuits, which are then simulated with ODE integration by the participating workers (int value in the range of [1, MAX_ANNEALING_TIME] as defined in your license)
- clones
Defines the number of clones being used for sampling. Default value is 1 which means that no clones are being sampled. Especially when all requested num_reads will fit on one worker, it is desired to also retrieve the optimum ground states found from more than just one worker. The number of clones runs the sampler for n clones in parallel and aggregates the samples. This ensures a broader spectrum of retrieved samples. Please note, it the number of clones is set higher than the number of available threads on your local machine, then the number of clones processed in parallel is being processed in batches. Clone sampling is only available when sampling on the mainnet. (integer value in the range of [1,128])
- switchfraction
Defines the percentage of variables which are replaced by random values during warm start samplings (double in the range of [0.0, 1.0])
- alpha
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- beta
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- gamma
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- delta
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- epsilon
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- zeta
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- minimum_stepsize
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is performig adaptive stepsizes for each ODE integration forward Euler step. This value defines the smallest step size for a single adaptive integration step (double value in the range of [0.0000000000000001, 1.0])
- debugging
Only applicable for test-net sampling. Defines if the sampling process should be quiet with no terminal output (FALSE) or if process updates are to be shown (TRUE) (bool)
- bnb
Use alternative branch-and-bound sampling when in mainnet=False (bool)
- block_fee
Computing jobs on the Dynex platform are being prioritised by the block fee which is being offered for computation. If this parameter is not specified, the current average block fee on the platform is being charged. To set an individual block fee for the sampling, specify this parameter, which is the amount of DNX in nanoDNX (1 DNX = 1,000,000,000 nanoDNX)
- Returns
Returns a dimod sampleset object class:dimod.sampleset
- Example
import dynex import dimod # Define the QUBU problem: bqmodel = dimod.BinaryQuadraticModel({0: -1, 1: -1}, {(0, 1): 2}, 0.0, dimod.BINARY) # Sample the problem: model = dynex.BQM(bqmodel) sampler = dynex.DynexSampler(model) sampleset = sampler.sample(num_reads=32, annealing_time = 100) # Output the result: print(sampleset)
╭────────────┬───────────┬───────────┬─────────┬─────┬─────────┬───────┬─────┬──────────┬──────────╮ │ DYNEXJOB │ ELAPSED │ WORKERS │ CHIPS │ ✔ │ STEPS │ LOC │ ✔ │ ENERGY │ ✔ │ ├────────────┼───────────┼───────────┼─────────┼─────┼─────────┼───────┼─────┼──────────┼──────────┤ │ 3617 │ 0.07 │ 1 │ 0 │ 32 │ 100 │ 0 │ 1 │ 0 │ 10000.00 │ ╰────────────┴───────────┴───────────┴─────────┴─────┴─────────┴───────┴─────┴──────────┴──────────╯ ╭─────────────────────────────┬───────────┬─────────┬───────┬──────────┬───────────┬───────────────┬──────────╮ │ WORKER │ VERSION │ CHIPS │ LOC │ ENERGY │ RUNTIME │ LAST UPDATE │ STATUS │ ├─────────────────────────────┼───────────┼─────────┼───────┼──────────┼───────────┼───────────────┼──────────┤ │ *** WAITING FOR WORKERS *** │ │ │ │ │ │ │ │ ╰─────────────────────────────┴───────────┴─────────┴───────┴──────────┴───────────┴───────────────┴──────────╯ [DYNEX] FINISHED READ AFTER 0.07 SECONDS [DYNEX] PARSING 1 VOLTAGE ASSIGNMENT FILES... progress: 100% 1/1 [00:05<00:00, 5.14s/it] [DYNEX] SAMPLESET LOADED [DYNEX] MALLOB: JOB UPDATED: 3617 STATUS: 2 0 1 energy num_oc. 0 0 1 -1.0 1 ['BINARY', 1 rows, 1 samples, 2 variables]
- class dynex.SAT(clauses, logging=False)[source]
Bases:
object
Creates a model, which can be used by the sampler based on a SAT problem. The Dynex sampler needs a “model” object for sampling. Based on the problem formulation, multiple model classes are supported.
- Parameters
- clauses
List of sat caluses for this model (list)
- logging
True to show model creation information, False to silence outputs (bool)
- Returns
class:dynex.model
- Example
Dimod’s dimod.binary.BinaryQuadraticModel (BQM) contains linear and quadratic biases for problems formulated as binary quadratic models as well as additional information such as variable labels and offset.
clauses = [[1, -2, 3], [-1, 4, 5], [6, 7, -8], [-9, -10, 11], [12, 13, -14], [-1, 15, -16], [17, -18, 19], [-20, 2, 3], [4, -5, 6], [-7, 8, 9], [10, 11, -12], [-13, -14, 15], [16, 17, -18], [-19, 20, 1], [2, -3, 4], [-5, 6, 7], [8, 9, -10], [-11, -12, 13], [14, 15, -16], [-17, 18, 19]] model = dynex.SAT(clauses)
- dynex.account_status()[source]
Shows the status of the Dynex SDK account as well as subscription information:
ACCOUNT: <YOUR ACCOUNT IDENTIFICATION> API SUCCESSFULLY CONNECTED TO DYNEX ----------------------------------- MAXIMUM NUM_READS: 100,000 MAXIMUM ANNEALING_TIME: 10,000 MAXIMUM JOB DURATION: 60 MINUTES COMPUTE: CURRENT AVG BLOCK FEE: 31.250005004 DNX USAGE: AVAILABLE BALANCE: 90.0 DNX USAGE TOTAL: 0.0 DNX
- dynex.estimate_costs(model, num_reads, block_fee=0)[source]
Dynex API call to estimate costs for a given job by analysing its complexity, given the number of Dynex chips (num_reads) to be used by calculating its network participation.
- Parameters
- x
- model
Model to compute
- num_reads
Number of Dynex chips to use
- block_fee
(optional) block fee to override current network average fee
- Returns
- price_per_block
Effective price in nanoDNX (/1e9 for DNX) per block
- price_per_minute
Effective price in nanoDNX (/1e9 for DNX) per minute
- job_type
1 = SAT, 3 = MAXSAT, 5 = ISING/QUBO
- Example
model = dynex.BQM(bqm); dynex.estimate_costs(model, num_reads=10000); [DYNEX] AVERAGE BLOCK FEE: 282.59 DNX [DYNEX] SUBMITTING COMPUTE FILE FOR COST ESTIMATION... [DYNEX] COST OF COMPUTE: 0.537993485 DNX PER BLOCK [DYNEX] COST OF COMPUTE: 0.268996742 DNX PER MINUTE
- dynex.sample(bqm, logging=True, formula=2, mainnet=False, description='Dynex SDK Job', test=False, bnb=True, num_reads=32, annealing_time=10, clones=1, switchfraction=0.0, alpha=20, beta=20, gamma=1, delta=1, epsilon=1, zeta=1, minimum_stepsize=6e-08, debugging=False, block_fee=0)[source]
Samples a Binary Quadratic Model (bqm).
- Parameters
- bqm
Binary quadratic model to sample
- logging
Defines if the sampling process should be quiet with no terminal output (FALSE) or if process updates are to be shown (bool)
- mainnet
Defines if the mainnet (Dynex platform sampling) or the testnet (local sampling) is being used for sampling (bool)
- description
Defines the description for the sampling, which is shown in Dynex job dashboards as well as in the market place (string)
- num_reads
Defines the number of parallel samples to be performed (int value in the range of [32, MAX_NUM_READS] as defined in your license)
- annealing_time
Defines the number of integration steps for the sampling. Models are being converted into neuromorphic circuits, which are then simulated with ODE integration by the participating workers (int value in the range of [1, MAX_ANNEALING_TIME] as defined in your license)
- clones
Defines the number of clones being used for sampling. Default value is 1 which means that no clones are being sampled. Especially when all requested num_reads will fit on one worker, it is desired to also retrieve the optimum ground states found from more than just one worker. The number of clones runs the sampler for n clones in parallel and aggregates the samples. This ensures a broader spectrum of retrieved samples. Please note, it the number of clones is set higher than the number of available threads on your local machine, then the number of clones processed in parallel is being processed in batches. Clone sampling is only available when sampling on the mainnet. (integer value in the range of [1,128])
- switchfraction
Defines the percentage of variables which are replaced by random values during warm start samplings (double in the range of [0.0, 1.0])
- alpha
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- beta
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- gamma
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- delta
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- epsilon
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- zeta
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- minimum_stepsize
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is performig adaptive stepsizes for each ODE integration forward Euler step. This value defines the smallest step size for a single adaptive integration step (double value in the range of [0.0000000000000001, 1.0])
- debugging
Only applicable for test-net sampling. Defines if the sampling process should be quiet with no terminal output (FALSE) or if process updates are to be shown (TRUE) (bool)
- bnb
Use alternative branch-and-bound sampling when in mainnet=False (bool)
- block_fee
Computing jobs on the Dynex platform are being prioritised by the block fee which is being offered for computation. If this parameter is not specified, the current average block fee on the platform is being charged. To set an individual block fee for the sampling, specify this parameter, which is the amount of DNX in nanoDNX (1 DNX = 1,000,000,000 nanoDNX)
- Returns
Returns a dimod sampleset object class:dimod.sampleset
- Example
from pyqubo import Array N = 15 K = 3 numbers = [4.8097315016016315, 4.325157567810298, 2.9877429101815127, 3.199880179616316, 0.5787939511978596, 1.2520928214246918, 2.262867466401502, 1.2300003067401255, 2.1601079352817925, 3.63753899583021, 4.598232793833491, 2.6215815162575646, 3.4227134835783364, 0.28254151584552023, 4.2548151473817075] q = Array.create('q', N, 'BINARY') H = sum(numbers[i] * q[i] for i in range(N)) + 5.0 * (sum(q) - K)**2 model = H.compile() Q, offset = model.to_qubo(index_label=True) bqm = dimod.BinaryQuadraticModel.from_qubo(Q, offset) sampleset = dynex.sample(bqm, offset, formula=2, annealing_time=200, bnb=True) print(sampleset) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 energy num_oc. 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 2.091336 1 ['BINARY', 1 rows, 1 samples, 15 variables]
- dynex.sample_ising(h, j, logging=True, formula=2, mainnet=False, description='Dynex SDK Job', test=False, bnb=True, num_reads=32, annealing_time=10, clones=1, switchfraction=0.0, alpha=20, beta=20, gamma=1, delta=1, epsilon=1, zeta=1, minimum_stepsize=6e-08, debugging=False, block_fee=0)[source]
Samples an Ising problem.
- Parameters
- h
Linear biases of the Ising problem
- j
Quadratic biases of the Ising problem
- logging
Defines if the sampling process should be quiet with no terminal output (FALSE) or if process updates are to be shown (bool)
- mainnet
Defines if the mainnet (Dynex platform sampling) or the testnet (local sampling) is being used for sampling (bool)
- description
Defines the description for the sampling, which is shown in Dynex job dashboards as well as in the market place (string)
- num_reads
Defines the number of parallel samples to be performed (int value in the range of [32, MAX_NUM_READS] as defined in your license)
- annealing_time
Defines the number of integration steps for the sampling. Models are being converted into neuromorphic circuits, which are then simulated with ODE integration by the participating workers (int value in the range of [1, MAX_ANNEALING_TIME] as defined in your license)
- clones
Defines the number of clones being used for sampling. Default value is 1 which means that no clones are being sampled. Especially when all requested num_reads will fit on one worker, it is desired to also retrieve the optimum ground states found from more than just one worker. The number of clones runs the sampler for n clones in parallel and aggregates the samples. This ensures a broader spectrum of retrieved samples. Please note, it the number of clones is set higher than the number of available threads on your local machine, then the number of clones processed in parallel is being processed in batches. Clone sampling is only available when sampling on the mainnet. (integer value in the range of [1,128])
- switchfraction
Defines the percentage of variables which are replaced by random values during warm start samplings (double in the range of [0.0, 1.0])
- alpha
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- beta
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- gamma
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- delta
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- epsilon
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- zeta
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- minimum_stepsize
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is performig adaptive stepsizes for each ODE integration forward Euler step. This value defines the smallest step size for a single adaptive integration step (double value in the range of [0.0000000000000001, 1.0])
- debugging
Only applicable for test-net sampling. Defines if the sampling process should be quiet with no terminal output (FALSE) or if process updates are to be shown (TRUE) (bool)
- bnb
Use alternative branch-and-bound sampling when in mainnet=False (bool)
- block_fee
Computing jobs on the Dynex platform are being prioritised by the block fee which is being offered for computation. If this parameter is not specified, the current average block fee on the platform is being charged. To set an individual block fee for the sampling, specify this parameter, which is the amount of DNX in nanoDNX (1 DNX = 1,000,000,000 nanoDNX)
- Returns
Returns a dimod sampleset object class:dimod.sampleset
- dynex.sample_qubo(Q, offset=0.0, logging=True, formula=2, mainnet=False, description='Dynex SDK Job', test=False, bnb=True, num_reads=32, annealing_time=10, clones=1, switchfraction=0.0, alpha=20, beta=20, gamma=1, delta=1, epsilon=1, zeta=1, minimum_stepsize=6e-08, debugging=False, block_fee=0)[source]
Samples a Qubo problem.
- Parameters
- Q
The Qubo problem
- offset
The offset value of the Qubo problem
- logging
Defines if the sampling process should be quiet with no terminal output (FALSE) or if process updates are to be shown (bool)
- mainnet
Defines if the mainnet (Dynex platform sampling) or the testnet (local sampling) is being used for sampling (bool)
- description
Defines the description for the sampling, which is shown in Dynex job dashboards as well as in the market place (string)
- num_reads
Defines the number of parallel samples to be performed (int value in the range of [32, MAX_NUM_READS] as defined in your license)
- annealing_time
Defines the number of integration steps for the sampling. Models are being converted into neuromorphic circuits, which are then simulated with ODE integration by the participating workers (int value in the range of [1, MAX_ANNEALING_TIME] as defined in your license)
- clones
Defines the number of clones being used for sampling. Default value is 1 which means that no clones are being sampled. Especially when all requested num_reads will fit on one worker, it is desired to also retrieve the optimum ground states found from more than just one worker. The number of clones runs the sampler for n clones in parallel and aggregates the samples. This ensures a broader spectrum of retrieved samples. Please note, it the number of clones is set higher than the number of available threads on your local machine, then the number of clones processed in parallel is being processed in batches. Clone sampling is only available when sampling on the mainnet. (integer value in the range of [1,128])
- switchfraction
Defines the percentage of variables which are replaced by random values during warm start samplings (double in the range of [0.0, 1.0])
- alpha
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- beta
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- gamma
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- delta
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- epsilon
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- zeta
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is using automatic tuning of these parameters for the ODE integration. Setting values defines the upper bound for the automated parameter tuning (double value in the range of [0.00000001, 100.0] for alpha and beta, and [0.0 and 1.0] for gamma, delta and epsilon)
- minimum_stepsize
The ODE integration of the QUBU/Ising or SAT model based neuromorphic circuits is performig adaptive stepsizes for each ODE integration forward Euler step. This value defines the smallest step size for a single adaptive integration step (double value in the range of [0.0000000000000001, 1.0])
- debugging
Only applicable for test-net sampling. Defines if the sampling process should be quiet with no terminal output (FALSE) or if process updates are to be shown (TRUE) (bool)
- bnb
Use alternative branch-and-bound sampling when in mainnet=False (bool)
- block_fee
Computing jobs on the Dynex platform are being prioritised by the block fee which is being offered for computation. If this parameter is not specified, the current average block fee on the platform is being charged. To set an individual block fee for the sampling, specify this parameter, which is the amount of DNX in nanoDNX (1 DNX = 1,000,000,000 nanoDNX)
- Returns
Returns a dimod sampleset object class:dimod.sampleset
- Example
from pyqubo import Array N = 15 K = 3 numbers = [4.8097315016016315, 4.325157567810298, 2.9877429101815127, 3.199880179616316, 0.5787939511978596, 1.2520928214246918, 2.262867466401502, 1.2300003067401255, 2.1601079352817925, 3.63753899583021, 4.598232793833491, 2.6215815162575646, 3.4227134835783364, 0.28254151584552023, 4.2548151473817075] q = Array.create('q', N, 'BINARY') H = sum(numbers[i] * q[i] for i in range(N)) + 5.0 * (sum(q) - K)**2 model = H.compile() Q, offset = model.to_qubo(index_label=True) sampleset = dynex.sample_qubo(Q, offset, formula=2, annealing_time=200, bnb=True) print(sampleset) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 energy num_oc. 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 2.091336 1 ['BINARY', 1 rows, 1 samples, 15 variables]