Skip to content

Commit

Permalink
CR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
orsa-classiq committed Feb 5, 2025
1 parent 464b9d8 commit b773cf7
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 112 deletions.
147 changes: 62 additions & 85 deletions algorithms/qaoa/knapsack/qaoa_knapsack.ipynb

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions algorithms/qaoa/knapsack/qaoa_knapsack.qmod
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,10 @@ qstruct KnapsackVars {
b: qnum<2>;
}



qfunc eval_constraint(v: KnapsackVars, output aux: qbit) {
aux = ((v.a * 2) + (v.b * 3)) <= 12;
}

qfunc apply_cost(gamma: real, v: KnapsackVars) {
aux: qbit;
within {
eval_constraint(v, aux);
aux = ((v.a * 2) + (v.b * 3)) <= 12;
} apply {
control (aux) {
phase (-((v.a * 3) + (v.b * 5)), gamma);
Expand Down
37 changes: 19 additions & 18 deletions algorithms/qaoa/knapsack/qaoa_knapsack.synthesis_options.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,38 @@
"machine_precision": 8,
"custom_hardware_settings": {
"basis_gates": [
"x",
"p",
"tdg",
"sx",
"rz",
"sxdg",
"sdg",
"ry",
"id",
"cy",
"t",
"sx",
"z",
"cx",
"u",
"rx",
"y",
"s",
"r",
"t",
"u1",
"tdg",
"rz",
"cz",
"z",
"rx",
"u2",
"x",
"s",
"sxdg",
"h",
"u",
"r",
"id",
"cx"
"u2",
"sdg",
"ry",
"p"
],
"is_symmetric_connectivity": true
},
"debug_mode": true,
"synthesize_all_separately": false,
"optimization_level": 3,
"output_format": ["qasm"],
"pretty_qasm": true,
"transpilation_option": "auto optimize",
"timeout_seconds": 300,
"random_seed": 3016072189
"random_seed": 695440439
}
}
4 changes: 2 additions & 2 deletions tests/resources/timeouts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ integer_linear_programming.ipynb: 400
integer_linear_programming.qmod: 400
ising_model.ipynb: 300
ising_model.qmod: 300
knapsack_integer.ipynb: 116
knapsack_integer.qmod: 116
qaoa_knapsack.ipynb: 300
qaoa_knapsack.qmod: 300
learning_optimization.ipynb: 80
linear_combination_of_unitaries.ipynb: 20
linear_combination_of_unitaries.qmod: 10
Expand Down

0 comments on commit b773cf7

Please sign in to comment.