From 328d5e76c9d1e2e83dee2d762cbef0b0d4bd1a6e Mon Sep 17 00:00:00 2001 From: cqc-melf <70640934+cqc-melf@users.noreply.github.com> Date: Tue, 9 Jul 2024 14:29:34 +0100 Subject: [PATCH] fix mypy (#101) * update mypy ini * fix mypy --- mypy.ini | 3 +++ pytket/extensions/qulacs/backends/qulacs_backend.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mypy.ini b/mypy.ini index 3daa6c7..9001fea 100644 --- a/mypy.ini +++ b/mypy.ini @@ -26,3 +26,6 @@ ignore_errors = True [mypy-lark.*] ignore_missing_imports = True ignore_errors = True + +[mypy-sympy.*] +ignore_missing_imports = True diff --git a/pytket/extensions/qulacs/backends/qulacs_backend.py b/pytket/extensions/qulacs/backends/qulacs_backend.py index dd6c096..2b40b51 100644 --- a/pytket/extensions/qulacs/backends/qulacs_backend.py +++ b/pytket/extensions/qulacs/backends/qulacs_backend.py @@ -308,9 +308,9 @@ def get_operator_expectation_value( qulacs_qps = " ".join(_items) if isinstance(coeff, Expr): - qulacs_coeff = complex(coeff.evalf()) # type: ignore + qulacs_coeff = complex(coeff.evalf()) else: - qulacs_coeff = complex(coeff) # type: ignore + qulacs_coeff = complex(coeff) observable.add_operator(qulacs_coeff, qulacs_qps) expectation_value = self._expectation_value(state_circuit, observable)