change print to log
@@ -42,7 +42,7 @@ class WeightedSumOperator(CircuitFactory):
# check weights
for i, w in enumerate(weights):
if not np.isclose(w, np.round(w)):
- print('Warning: non-integer weights are rounded to the nearest integer! (%s, %s)' % (i, w))
+ logger.warning(f'Non-integer weights are rounded to the nearest integer! ({i}, {w}).')
self._num_state_qubits = num_state_qubits
self._num_sum_qubits = self.get_required_sum_qubits(weights)
