Skip to content

Commit

Permalink
Use lazy formatting in log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
declanmillar committed Sep 12, 2022
1 parent a79aaea commit 84c0ea1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions qiskit/algorithms/minimum_eigensolvers/vqe.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ def compute_minimum_eigenvalue(
result.optimizer_time = eval_time

logger.info(
f"Optimization complete in {eval_time} seconds.\nFound opt_params {result.optimal_point}."
"Optimization complete in %s seconds.\nFound opt_params %s",
eval_time,
result.optimal_point,
)

if aux_operators:
Expand Down Expand Up @@ -254,7 +256,7 @@ def _check_operator_ansatz(
if operator.num_qubits != ansatz.num_qubits:
try:
logger.info(
f"Trying to resize ansatz to match operator on {operator.num_qubits} qubits."
"Trying to resize ansatz to match operator on %s qubits.", operator.num_qubits
)
ansatz.num_qubits = operator.num_qubits
except AttributeError as error:
Expand Down

0 comments on commit 84c0ea1

Please sign in to comment.