From 84c0ea13d00a68f27f4f7a08c45d2a542c5ea11f Mon Sep 17 00:00:00 2001 From: Declan Millar Date: Mon, 12 Sep 2022 21:11:27 +0100 Subject: [PATCH] Use lazy formatting in log messages --- qiskit/algorithms/minimum_eigensolvers/vqe.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qiskit/algorithms/minimum_eigensolvers/vqe.py b/qiskit/algorithms/minimum_eigensolvers/vqe.py index 47135b596d2d..eee636aefd28 100644 --- a/qiskit/algorithms/minimum_eigensolvers/vqe.py +++ b/qiskit/algorithms/minimum_eigensolvers/vqe.py @@ -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: @@ -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: