quast_decisiontree.nodes.algorithm_select
quast_decisiontree.nodes.algorithm_select
map_algo_to_next_node
module-attribute
map_algo_to_next_node = dict(
BruteForce="BruteForceSetupNode",
TabuSolver="TabuSetupNode",
LRQAOA="SelectLayersNode",
QrispQAOA="SelectLayersNode",
QrispVQE="QrispAnsatzNode",
BaseQAOA="SelectLayersNode",
QAOA="SelectLayersNode",
VQE="QrispAnsatzNode",
)
map_algo_to_setup_node
module-attribute
map_algo_to_setup_node = dict(
BruteForce="BruteForceSetupNode",
TabuSolver="TabuSetupNode",
LRQAOA="LRQAOASetupNode",
QrispQAOA="QrispQAOASetupNode",
QrispVQE="QrispVQESetupNode",
BaseQAOA="QrispQAOASetupNode",
QAOA="QrispQAOASetupNode",
VQE="QrispVQESetupNode",
)
logger
module-attribute
logger = logging.getLogger('dt_logger')
AlgorithmSelectionNode
Bases: Node
allows the user to select an algorithm
Modifications at runtime: - algorithm - {algorithm_name} : name of the algorithm to run
Source code in src/quast_decisiontree/nodes/algorithm_select.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
options
instance-attribute
options = {
key: val
for key, val in (self.options.items())
if key in options
}
query
instance-attribute
query = MultiChoiceQuery(
question="Which algorithm do you want to use?",
answers=dict(self.options),
name="algorithm",
)
__init__
__init__(children, options=None)
Source code in src/quast_decisiontree/nodes/algorithm_select.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
execute
execute(problem_data, path_info)
prompts for an algorithm to run
Source code in src/quast_decisiontree/nodes/algorithm_select.py
94 95 96 97 98 99 100 101 102 103 104 105 106 | |
next_node
next_node(next_node_info)
Source code in src/quast_decisiontree/nodes/algorithm_select.py
108 109 110 111 112 | |
SelectLayersNode
Bases: Node
Select the number of layers of the algorithm.
Modifications at runtime: - reps : - {int} : number of layers
Source code in src/quast_decisiontree/nodes/algorithm_select.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | |
query
instance-attribute
query = IntQuery(
"How many layers should the algorithm have?",
name="reps",
default=3,
)
__init__
__init__(children)
Source code in src/quast_decisiontree/nodes/algorithm_select.py
126 127 128 | |
execute
execute(problem_data, path_info)
Source code in src/quast_decisiontree/nodes/algorithm_select.py
130 131 132 133 134 135 136 137 | |
next_node
next_node(next_node_info)
Source code in src/quast_decisiontree/nodes/algorithm_select.py
139 140 141 142 143 144 145 146 147 148 | |
LRSetDeltaNode
Bases: Node
sets the delta for a LR circuit
Modifications at runtime: - "delta_gamma" (float): sets the delta_gamma of LR-QAOA - "delta_beta" (float): sets the delta_beta of LR-QAOA
Source code in src/quast_decisiontree/nodes/algorithm_select.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | |
query_gamma
instance-attribute
query_gamma = FloatQuery(
"How large should the delta_gamma parameter of LR-QAOA be?",
name="delta_gamma",
default=0.5,
)
query_beta
instance-attribute
query_beta = FloatQuery(
"How large should the delta_beta parameter of LR-QAOA be?",
name="delta_beta",
default=0.5,
)
queries
instance-attribute
queries = QueryTree(
queries=[self.query_gamma, self.query_beta]
)
__init__
__init__(children)
Source code in src/quast_decisiontree/nodes/algorithm_select.py
161 162 163 164 165 166 167 168 169 170 171 172 173 | |
execute
execute(problem_data, path_info)
Source code in src/quast_decisiontree/nodes/algorithm_select.py
175 176 177 178 179 180 181 182 183 184 185 186 | |
recommend_algorithm
recommend_algorithm(problem_data)
recommends an algorithm based on the problem_data and configuration
currently recommends QAOA for MaxCut and VQE for TSP
Source code in src/quast_decisiontree/nodes/algorithm_select.py
46 47 48 49 50 51 52 53 54 55 56 | |