Skip to content

Commit

Permalink
correct tsp docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
WanderingMike committed Dec 13, 2023
1 parent 917df00 commit 40b7526
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/qibo/models/tsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@ def qaoa_function_of_layer(layer, distance_matrix):
from QAOA
'''
from qibo.oprtimizers.minimizers import ScipyMinimizer
small_tsp = TSP(distance_matrix)
obj_hamil, mixer = small_tsp.hamiltonians()
qaoa = QAOA(obj_hamil, mixer=mixer)
best_energy, final_parameters, extra = qaoa.minimize(initial_p=[0.1] * layer,
initial_state=initial_state, method='BFGS')
opt = ScipyMinimizer({'method': 'BFGS'})
best_energy, final_parameters, extra = qaoa.minimize(opt, initial_parameters=[0.1] * layer,
initial_state=initial_state)
qaoa.set_parameters(final_parameters)
quantum_state = qaoa.execute(initial_state)
circuit = Circuit(9)
Expand Down
2 changes: 1 addition & 1 deletion src/qibo/models/variational.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def minimize(
from qibo import hamiltonians
from qibo.models.utils import cvar, gibbs
from qibo.optimizer.minimizers import ScipyMinimizer
from qibo.optimizers.minimizers import ScipyMinimizer
h = hamiltonians.XXZ(3)
qaoa = models.QAOA(h)
Expand Down

0 comments on commit 40b7526

Please sign in to comment.