Skip to content

Commit

Permalink
testing fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaustuvi committed Jun 3, 2019
1 parent dc6bf6e commit b6e17c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions grove/pyqaoa/maxcut_qaoa.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def maxcut_qaoa(graph, steps=1, rand_seed=None, connection=None, samples=None,
:param minimizer_kwargs: (Optional. Default=None). Minimizer optional arguments. If None set to
``{'method': 'Nelder-Mead', 'options': {'ftol': 1.0e-2, 'xtol': 1.0e-2, 'disp': False}``
:param vqe_option: (Optional. Default=None). VQE optional arguments. If None set to
``vqe_option = {'disp': print_fun, 'return_all': True, 'samples': samples}``
``vqe_option = {'disp': True, 'return_all': True, 'samples': samples}``
"""
if not isinstance(graph, nx.Graph) and isinstance(graph, list):
Expand All @@ -68,7 +68,7 @@ def maxcut_qaoa(graph, steps=1, rand_seed=None, connection=None, samples=None,
'options': {'ftol': 1.0e-2, 'xtol': 1.0e-2,
'disp': False}}
if vqe_option is None:
vqe_option = {'disp': print, 'return_all': True,
vqe_option = {'disp': True, 'return_all': True,
'samples': samples}

qaoa_inst = QAOA(connection, list(graph.nodes()), steps=steps, cost_ham=cost_operators,
Expand Down
3 changes: 2 additions & 1 deletion grove/pyvqe/vqe.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ def vqe_run(self, variational_state_evolve, hamiltonian, initial_params,
returned if 'return_all=True' is set as a
vqe_run() option.
"""
self._disp_fun = disp if disp is not None else lambda x: None
# self._disp_fun = disp if disp is not None else lambda x: None
self._disp_fun = lambda x: None if disp is not True else print
iteration_params = []
expectation_vals = []
self._current_expectation = None
Expand Down

0 comments on commit b6e17c0

Please sign in to comment.