quast_decisiontree.algorithms.classical.tabu
quast_decisiontree.algorithms.classical.tabu
tabu solver from dwave-tabu
TabuSolver
Bases: ClassicalAlgorithm
wrapper for the dwave tabu sampler
Source code in src/quast_decisiontree/algorithms/classical/tabu.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
num_reads
instance-attribute
num_reads = num_reads
sampler
instance-attribute
sampler = TabuSampler()
seed
instance-attribute
seed = seed
__init__
__init__(num_reads=1, seed=None)
initializes the TabuSolver
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_reads
|
int
|
How many samples to generate. Defaults to 1. |
1
|
Source code in src/quast_decisiontree/algorithms/classical/tabu.py
24 25 26 27 28 29 30 31 32 | |
build_fake_eigenstate
classmethod
build_fake_eigenstate(tabu_result, probabilities=False)
generate a fake eigenstate from a Tabu sampling result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tabu_result
|
SampleSet
|
the sampling results |
required |
probabilities
|
bool
|
whether to convert the shot counts to probabilities." |
False
|
Source code in src/quast_decisiontree/algorithms/classical/tabu.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
build_fake_eigenvalue
classmethod
build_fake_eigenvalue(tabu_result)
generates a fake eigenvalue from a Tabu sampling result
Source code in src/quast_decisiontree/algorithms/classical/tabu.py
58 59 60 61 62 63 64 65 66 67 | |
check_input
classmethod
check_input(opt_problem)
Check whether opt_problem is a valid QUBO input.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
opt_problem
|
Any
|
The problem description to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if |
Source code in src/quast_decisiontree/algorithms/classical/tabu.py
69 70 71 72 73 74 75 76 77 78 79 | |
execute
execute(opt_problem, classical_args=None)
Sample the QUBO with the tabu sampler and return aggregated results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
opt_problem
|
Any
|
A QUBO matrix whose bilinear form is minimized. |
required |
classical_args
|
Any
|
Present for signature compatibility; unused. |
None
|
Returns:
| Type | Description |
|---|---|
SampleSet
|
An aggregated :class: |
Raises:
| Type | Description |
|---|---|
TypeError
|
If |
Source code in src/quast_decisiontree/algorithms/classical/tabu.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |