This is an automated email from the ASF dual-hosted git repository.

hcr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/mahout.git


The following commit(s) were added to refs/heads/main by this push:
     new f928fde3f enable important ruff rules that can be fixed easily (#1143)
f928fde3f is described below

commit f928fde3fbc3db5688eeec6f551f25d16d30558e
Author: Tim Hsiung <[email protected]>
AuthorDate: Sun Mar 8 16:08:43 2026 +0800

    enable important ruff rules that can be fixed easily (#1143)
    
    Co-authored-by: Ryan Huang <[email protected]>
---
 .github/scripts/review_pr.py                       |  1 +
 .pre-commit-config.yaml                            | 14 +++----
 pyproject.toml                                     | 28 ++++++++++++++
 qdp/qdp-python/benchmark/benchmark_e2e.py          | 15 ++++----
 qdp/qdp-python/benchmark/benchmark_latency.py      |  4 +-
 .../benchmark/benchmark_latency_pytorch.py         |  1 -
 .../benchmark/benchmark_loader_throughput.py       |  2 +-
 qdp/qdp-python/benchmark/benchmark_numpy_io.py     |  1 -
 qdp/qdp-python/benchmark/benchmark_throughput.py   |  2 +-
 .../pennylane_baseline/iris_amplitude.py           |  3 +-
 .../qdp_pipeline/iris_amplitude.py                 |  6 +--
 qdp/qdp-python/benchmark/run_pipeline_baseline.py  |  2 +-
 qdp/qdp-python/qumat_qdp/api.py                    | 17 ++++-----
 qdp/qdp-python/qumat_qdp/loader.py                 | 17 +++++----
 qdp/qdp-python/tests/test_dlpack_validation.py     |  6 ++-
 qdp/qdp-python/tests/test_quantum_data_loader.py   |  3 +-
 qumat/__init__.py                                  |  2 +-
 qumat/amazon_braket_backend.py                     |  2 +-
 qumat/cirq_backend.py                              |  1 +
 testing/conftest.py                                | 12 +++---
 testing/qdp/test_benchmark_api.py                  |  2 +-
 testing/qdp/test_bindings.py                       | 32 ++++++++--------
 testing/qdp/test_high_fidelity.py                  |  7 ++--
 testing/qdp/test_numpy.py                          | 10 ++---
 testing/qumat/test_amazon_braket_backend.py        | 17 +++++----
 testing/qumat/test_create_circuit.py               |  3 +-
 testing/qumat/test_final_quantum_states.py         |  5 ++-
 testing/qumat/test_multi_qubit_gates.py            | 32 ++++++++--------
 testing/qumat/test_overlap_measurement.py          |  5 ++-
 testing/qumat/test_qdp_module.py                   |  5 ++-
 testing/qumat/test_rotation_gates.py               | 10 ++---
 testing/qumat/test_single_qubit_gates.py           | 29 +++++++++------
 testing/qumat/test_swap_test.py                    |  3 +-
 testing/utils/amazon_braket_helpers.py             |  4 +-
 testing/utils/qumat_helpers.py                     |  4 +-
 uv.lock                                            | 43 +++++++++++-----------
 36 files changed, 196 insertions(+), 154 deletions(-)

diff --git a/.github/scripts/review_pr.py b/.github/scripts/review_pr.py
index a74e86086..1d2596b18 100644
--- a/.github/scripts/review_pr.py
+++ b/.github/scripts/review_pr.py
@@ -17,6 +17,7 @@
 #
 import os
 import sys
+
 from github import Github
 from gofannon.github.pr_review_tool import PRReviewTool
 
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 8c93795ed..77ff509f8 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -10,17 +10,15 @@ repos:
       - id: trailing-whitespace
         name: trim trailing whitespace
 
-  # Ruff linter and formatter
+  # Python linter and formatter
   - repo: https://github.com/astral-sh/ruff-pre-commit
-    rev: v0.14.5
+    rev: v0.15.5
     hooks:
-      - id: ruff
-        name: ruff linting
-        files: \.py$
+      - id: ruff-check
+        name: Lint and fix Python code
         args: [--fix]
       - id: ruff-format
-        name: ruff formatting
-        files: \.py$
+        name: Format Python code
 
   # Static type checking
   - repo: local
@@ -61,7 +59,7 @@ repos:
           - --comment-style
           - "//"
 
-# Rust Linter
+  # Rust Linter
   - repo: https://github.com/doublify/pre-commit-rust
     rev: v1.0
     hooks:
diff --git a/pyproject.toml b/pyproject.toml
index 5c4067ce1..8e6dd3c81 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -97,6 +97,34 @@ exclude = [
 # api: benchmark module loaded via sys.path in tests
 allowed-unresolved-imports = ["_qdp", "_qdp.*", "api", "api.*"]
 
+[tool.ruff]
+extend-exclude = ["**/*.ipynb"]
+target-version = "py310"
+
+[tool.ruff.lint]
+select = [
+    # Pyflakes
+    "F",
+    # pyupgrade
+    "UP",
+    # isort
+    "I",
+    # pygrep-hooks
+    "PGH003",
+    "PGH004",
+    # unsorted-dunder-all
+    "RUF022",
+    # unused-noqa
+    "RUF100",
+    # flake8-pytest-style
+    "PT",
+]
+
+ignore = ["PT011"]
+
+[tool.ruff.lint.pyflakes]
+allowed-unused-imports = ["_qdp"]
+
 [build-system]
 requires = ["hatchling"]
 build-backend = "hatchling.build"
diff --git a/qdp/qdp-python/benchmark/benchmark_e2e.py 
b/qdp/qdp-python/benchmark/benchmark_e2e.py
index 689ab28a7..7a6cd971a 100644
--- a/qdp/qdp-python/benchmark/benchmark_e2e.py
+++ b/qdp/qdp-python/benchmark/benchmark_e2e.py
@@ -28,17 +28,18 @@ Scope:
 This is the most realistic comparison for a "Cold Start" Training Epoch.
 """
 
-import time
 import argparse
-import torch
-import torch.nn as nn
-import numpy as np
-import os
-import itertools
 import gc
+import itertools
+import os
+import time
+
+import numpy as np
 import pyarrow as pa
-import pyarrow.parquet as pq
 import pyarrow.ipc as ipc
+import pyarrow.parquet as pq
+import torch
+import torch.nn as nn
 from _qdp import QdpEngine
 from utils import generate_batch_data, normalize_batch
 
diff --git a/qdp/qdp-python/benchmark/benchmark_latency.py 
b/qdp/qdp-python/benchmark/benchmark_latency.py
index c22ad774e..38adf269c 100644
--- a/qdp/qdp-python/benchmark/benchmark_latency.py
+++ b/qdp/qdp-python/benchmark/benchmark_latency.py
@@ -29,9 +29,9 @@ import argparse
 import time
 
 import torch
+from qumat_qdp import QdpBenchmark
 
 from benchmark.utils import normalize_batch, prefetched_batches
-from qumat_qdp import QdpBenchmark
 
 BAR = "=" * 70
 SEP = "-" * 70
@@ -52,8 +52,8 @@ except ImportError:
 
 try:
     from qiskit import QuantumCircuit, transpile
-    from qiskit_aer import AerSimulator
     from qiskit.quantum_info import Statevector
+    from qiskit_aer import AerSimulator
 
     HAS_QISKIT = True
 except ImportError:
diff --git a/qdp/qdp-python/benchmark/benchmark_latency_pytorch.py 
b/qdp/qdp-python/benchmark/benchmark_latency_pytorch.py
index 7fbc87a63..5f92139b1 100755
--- a/qdp/qdp-python/benchmark/benchmark_latency_pytorch.py
+++ b/qdp/qdp-python/benchmark/benchmark_latency_pytorch.py
@@ -29,7 +29,6 @@ import time
 
 import numpy as np
 import torch
-
 from _qdp import QdpEngine
 from utils import build_sample, normalize_batch_torch, prefetched_batches_torch
 
diff --git a/qdp/qdp-python/benchmark/benchmark_loader_throughput.py 
b/qdp/qdp-python/benchmark/benchmark_loader_throughput.py
index 223e68555..ac044ab6e 100644
--- a/qdp/qdp-python/benchmark/benchmark_loader_throughput.py
+++ b/qdp/qdp-python/benchmark/benchmark_loader_throughput.py
@@ -30,7 +30,7 @@ from __future__ import annotations
 import argparse
 import time
 
-from qumat_qdp import QuantumDataLoader, QdpBenchmark
+from qumat_qdp import QdpBenchmark, QuantumDataLoader
 
 
 def run_loader_throughput(
diff --git a/qdp/qdp-python/benchmark/benchmark_numpy_io.py 
b/qdp/qdp-python/benchmark/benchmark_numpy_io.py
index 31dd08b45..4a563f00f 100644
--- a/qdp/qdp-python/benchmark/benchmark_numpy_io.py
+++ b/qdp/qdp-python/benchmark/benchmark_numpy_io.py
@@ -38,7 +38,6 @@ import time
 
 import numpy as np
 import torch
-
 from _qdp import QdpEngine
 from utils import normalize_batch
 
diff --git a/qdp/qdp-python/benchmark/benchmark_throughput.py 
b/qdp/qdp-python/benchmark/benchmark_throughput.py
index acb7e067d..414ce06c5 100644
--- a/qdp/qdp-python/benchmark/benchmark_throughput.py
+++ b/qdp/qdp-python/benchmark/benchmark_throughput.py
@@ -32,9 +32,9 @@ import time
 
 import numpy as np
 import torch
+from qumat_qdp import QdpBenchmark
 
 from benchmark.utils import normalize_batch, prefetched_batches
-from qumat_qdp import QdpBenchmark
 
 BAR = "=" * 70
 SEP = "-" * 70
diff --git 
a/qdp/qdp-python/benchmark/encoding_benchmarks/pennylane_baseline/iris_amplitude.py
 
b/qdp/qdp-python/benchmark/encoding_benchmarks/pennylane_baseline/iris_amplitude.py
index ee6b8f4d6..730e96799 100644
--- 
a/qdp/qdp-python/benchmark/encoding_benchmarks/pennylane_baseline/iris_amplitude.py
+++ 
b/qdp/qdp-python/benchmark/encoding_benchmarks/pennylane_baseline/iris_amplitude.py
@@ -33,7 +33,6 @@ Pipeline: state prep (Möttönen angles) → Rot layers + CNOT → 
expval(PauliZ
 from __future__ import annotations
 
 # --- Imports ---
-
 import argparse
 import time
 from typing import Any
@@ -43,7 +42,7 @@ import numpy as np
 try:
     import pennylane as qml
     from pennylane import numpy as pnp
-    from pennylane.optimize import NesterovMomentumOptimizer, AdamOptimizer
+    from pennylane.optimize import AdamOptimizer, NesterovMomentumOptimizer
 except ImportError as e:
     raise SystemExit(
         "PennyLane is required. Install with: uv sync --group benchmark"
diff --git 
a/qdp/qdp-python/benchmark/encoding_benchmarks/qdp_pipeline/iris_amplitude.py 
b/qdp/qdp-python/benchmark/encoding_benchmarks/qdp_pipeline/iris_amplitude.py
index fd0e97fc4..a830da7a9 100644
--- 
a/qdp/qdp-python/benchmark/encoding_benchmarks/qdp_pipeline/iris_amplitude.py
+++ 
b/qdp/qdp-python/benchmark/encoding_benchmarks/qdp_pipeline/iris_amplitude.py
@@ -34,7 +34,6 @@ baseline uses get_angles → state_preparation(angles). Rest: 
same circuit (Rot
 from __future__ import annotations
 
 # --- Imports ---
-
 import argparse
 import time
 from typing import Any
@@ -44,7 +43,7 @@ import numpy as np
 try:
     import pennylane as qml
     from pennylane import numpy as pnp
-    from pennylane.optimize import NesterovMomentumOptimizer, AdamOptimizer
+    from pennylane.optimize import AdamOptimizer, NesterovMomentumOptimizer
 except ImportError as e:
     raise SystemExit(
         "PennyLane is required. Install with: uv sync --group benchmark"
@@ -58,9 +57,8 @@ except ImportError as e:
         "scikit-learn is required. Install with: uv sync --group benchmark"
     ) from e
 
-from qumat_qdp import QdpEngine
 import torch
-
+from qumat_qdp import QdpEngine
 
 NUM_QUBITS = 2
 STATE_DIM = 2**NUM_QUBITS  # 4
diff --git a/qdp/qdp-python/benchmark/run_pipeline_baseline.py 
b/qdp/qdp-python/benchmark/run_pipeline_baseline.py
index e6466c901..552a524d0 100644
--- a/qdp/qdp-python/benchmark/run_pipeline_baseline.py
+++ b/qdp/qdp-python/benchmark/run_pipeline_baseline.py
@@ -66,7 +66,7 @@ _project_root = _benchmark_dir.parent
 if str(_project_root) not in sys.path:
     sys.path.insert(0, str(_project_root))
 
-from qumat_qdp import QdpBenchmark  # noqa: E402
+from qumat_qdp import QdpBenchmark
 
 
 def _repo_root() -> Path:
diff --git a/qdp/qdp-python/qumat_qdp/api.py b/qdp/qdp-python/qumat_qdp/api.py
index 2fffbbc09..ae2e44c69 100644
--- a/qdp/qdp-python/qumat_qdp/api.py
+++ b/qdp/qdp-python/qumat_qdp/api.py
@@ -32,7 +32,6 @@ Usage:
 from __future__ import annotations
 
 from dataclasses import dataclass
-from typing import Optional
 
 
 @dataclass
@@ -52,7 +51,7 @@ class LatencyResult:
 
 
 # Cached reference to Rust pipeline (avoids repeated import).
-_run_throughput_pipeline_py: Optional[object] = None
+_run_throughput_pipeline_py: object | None = None
 
 
 def _get_run_throughput_pipeline_py():
@@ -85,30 +84,30 @@ class QdpBenchmark:
 
     def __init__(self, device_id: int = 0):
         self._device_id = device_id
-        self._num_qubits: Optional[int] = None
+        self._num_qubits: int | None = None
         self._encoding_method: str = "amplitude"
-        self._total_batches: Optional[int] = None
+        self._total_batches: int | None = None
         self._batch_size: int = 64
         self._warmup_batches: int = 0
 
-    def qubits(self, n: int) -> "QdpBenchmark":
+    def qubits(self, n: int) -> QdpBenchmark:
         self._num_qubits = n
         return self
 
-    def encoding(self, method: str) -> "QdpBenchmark":
+    def encoding(self, method: str) -> QdpBenchmark:
         self._encoding_method = method
         return self
 
-    def batches(self, total: int, size: int = 64) -> "QdpBenchmark":
+    def batches(self, total: int, size: int = 64) -> QdpBenchmark:
         self._total_batches = total
         self._batch_size = size
         return self
 
-    def prefetch(self, n: int) -> "QdpBenchmark":
+    def prefetch(self, n: int) -> QdpBenchmark:
         """No-op for API compatibility; Rust pipeline does not use prefetch 
from Python."""
         return self
 
-    def warmup(self, n: int) -> "QdpBenchmark":
+    def warmup(self, n: int) -> QdpBenchmark:
         self._warmup_batches = n
         return self
 
diff --git a/qdp/qdp-python/qumat_qdp/loader.py 
b/qdp/qdp-python/qumat_qdp/loader.py
index 29d01863b..4ed61f882 100644
--- a/qdp/qdp-python/qumat_qdp/loader.py
+++ b/qdp/qdp-python/qumat_qdp/loader.py
@@ -29,11 +29,12 @@ Usage:
 
 from __future__ import annotations
 
+from collections.abc import Iterator
 from functools import lru_cache
-from typing import TYPE_CHECKING, Iterator, Optional
+from typing import TYPE_CHECKING
 
 if TYPE_CHECKING:
-    import _qdp  # noqa: F401 -- for type checkers only
+    import _qdp
 
 # Seed must fit Rust u64: 0 <= seed <= 2^64 - 1.
 _U64_MAX = 2**64 - 1
@@ -53,7 +54,7 @@ def _validate_loader_args(
     batch_size: int,
     total_batches: int,
     encoding_method: str,
-    seed: Optional[int],
+    seed: int | None,
 ) -> None:
     """Validate arguments before passing to Rust (PipelineConfig / 
create_synthetic_loader)."""
     if device_id < 0:
@@ -96,7 +97,7 @@ class QuantumDataLoader:
         batch_size: int = 64,
         total_batches: int = 100,
         encoding_method: str = "amplitude",
-        seed: Optional[int] = None,
+        seed: int | None = None,
     ) -> None:
         _validate_loader_args(
             device_id=device_id,
@@ -112,13 +113,13 @@ class QuantumDataLoader:
         self._total_batches = total_batches
         self._encoding_method = encoding_method
         self._seed = seed
-        self._file_path: Optional[str] = None
+        self._file_path: str | None = None
         self._streaming_requested = (
             False  # set True by source_file(streaming=True); Phase 2b
         )
         self._synthetic_requested = False  # set True only by 
source_synthetic()
         self._file_requested = False
-        self._null_handling: Optional[str] = None
+        self._null_handling: str | None = None
 
     def qubits(self, n: int) -> QuantumDataLoader:
         """Set number of qubits. Returns self for chaining."""
@@ -148,7 +149,7 @@ class QuantumDataLoader:
 
     def source_synthetic(
         self,
-        total_batches: Optional[int] = None,
+        total_batches: int | None = None,
     ) -> QuantumDataLoader:
         """Use synthetic data source (default). Optionally override 
total_batches. Returns self."""
         self._synthetic_requested = True
@@ -177,7 +178,7 @@ class QuantumDataLoader:
         self._streaming_requested = streaming
         return self
 
-    def seed(self, s: Optional[int] = None) -> QuantumDataLoader:
+    def seed(self, s: int | None = None) -> QuantumDataLoader:
         """Set RNG seed for reproducible synthetic data (must fit Rust u64: 0 
<= seed <= 2^64-1). Returns self."""
         if s is not None:
             if not isinstance(s, int):
diff --git a/qdp/qdp-python/tests/test_dlpack_validation.py 
b/qdp/qdp-python/tests/test_dlpack_validation.py
index a612efbca..42c0a8a6e 100644
--- a/qdp/qdp-python/tests/test_dlpack_validation.py
+++ b/qdp/qdp-python/tests/test_dlpack_validation.py
@@ -136,9 +136,11 @@ def test_stride_2d_non_contiguous_rejected():
     engine = _engine()
     # (4, 2) with strides (3, 2) -> not C-contiguous; expected for (4,2) is 
(2, 1)
     t = torch.randn(4, 3, dtype=torch.float64, device="cuda")[:, ::2]
-    assert t.dim() == 2 and t.shape == (4, 2)
+    assert t.dim() == 2
+    assert t.shape == (4, 2)
     # Strides should be (3, 2) not (2, 1)
-    assert t.stride(0) == 3 and t.stride(1) == 2
+    assert t.stride(0) == 3
+    assert t.stride(1) == 2
     with pytest.raises(RuntimeError) as exc_info:
         engine.encode(t, num_qubits=1, encoding_method="amplitude")
     msg = str(exc_info.value).lower()
diff --git a/qdp/qdp-python/tests/test_quantum_data_loader.py 
b/qdp/qdp-python/tests/test_quantum_data_loader.py
index e636489ed..9eb4fb30e 100644
--- a/qdp/qdp-python/tests/test_quantum_data_loader.py
+++ b/qdp/qdp-python/tests/test_quantum_data_loader.py
@@ -42,7 +42,8 @@ def test_mutual_exclusion_both_sources_raises():
         list(loader)
     msg = str(exc_info.value)
     assert "Cannot set both synthetic and file sources" in msg
-    assert "source_synthetic" in msg and "source_file" in msg
+    assert "source_synthetic" in msg
+    assert "source_file" in msg
 
 
 @pytest.mark.skipif(not _loader_available(), reason="QuantumDataLoader not 
available")
diff --git a/qumat/__init__.py b/qumat/__init__.py
index 633d003d9..0417cf21a 100644
--- a/qumat/__init__.py
+++ b/qumat/__init__.py
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from .qumat import QuMat
 from . import qdp
+from .qumat import QuMat
 
 __all__ = ["QuMat", "qdp"]
diff --git a/qumat/amazon_braket_backend.py b/qumat/amazon_braket_backend.py
index 57a086fb6..d568b7770 100644
--- a/qumat/amazon_braket_backend.py
+++ b/qumat/amazon_braket_backend.py
@@ -16,8 +16,8 @@
 #
 import boto3
 from braket.aws import AwsDevice, AwsSession
-from braket.devices import LocalSimulator
 from braket.circuits import Circuit, FreeParameter
+from braket.devices import LocalSimulator
 
 
 def initialize_backend(backend_config):
diff --git a/qumat/cirq_backend.py b/qumat/cirq_backend.py
index bb89a4bcc..36c37d5cb 100644
--- a/qumat/cirq_backend.py
+++ b/qumat/cirq_backend.py
@@ -15,6 +15,7 @@
 # limitations under the License.
 #
 import copy
+
 import cirq
 import sympy
 
diff --git a/testing/conftest.py b/testing/conftest.py
index 2099a28a1..39a1cb7fa 100644
--- a/testing/conftest.py
+++ b/testing/conftest.py
@@ -26,15 +26,13 @@ QDP tests are automatically skipped if the _qdp extension 
is not available,
 allowing contributors without CUDA to run the qumat test suite.
 """
 
-from typing import Optional
-
 import pytest
 
 # Check if QDP extension is available at module load time
 _QDP_AVAILABLE = False
-_QDP_IMPORT_ERROR: Optional[str] = "No module named '_qdp'"
+_QDP_IMPORT_ERROR: str | None = "No module named '_qdp'"
 try:
-    import _qdp  # noqa: F401, PLC0415
+    import _qdp
 
     _QDP_AVAILABLE = True
     _QDP_IMPORT_ERROR = None
@@ -42,7 +40,7 @@ except ImportError as e:
     _QDP_IMPORT_ERROR = str(e)
 
 
-def pytest_configure(config):  # noqa: ARG001
+def pytest_configure(config):
     """Register custom pytest markers."""
     config.addinivalue_line(
         "markers", "gpu: marks tests as requiring GPU and _qdp extension"
@@ -50,7 +48,7 @@ def pytest_configure(config):  # noqa: ARG001
     config.addinivalue_line("markers", "slow: marks tests as slow running")
 
 
-def pytest_collection_modifyitems(config, items):  # noqa: ARG001
+def pytest_collection_modifyitems(config, items):
     """Auto-skip GPU/QDP tests if the _qdp extension is not available."""
     if _QDP_AVAILABLE:
         return
@@ -88,7 +86,7 @@ def qdp_available():
 
 
 @pytest.fixture
-def qdp_engine(qdp_available):  # noqa: ARG001
+def qdp_engine(qdp_available):
     """
     Fixture that provides a QDP engine instance.
 
diff --git a/testing/qdp/test_benchmark_api.py 
b/testing/qdp/test_benchmark_api.py
index d75f3a499..a8238e7f3 100644
--- a/testing/qdp/test_benchmark_api.py
+++ b/testing/qdp/test_benchmark_api.py
@@ -29,7 +29,7 @@ if _qdp_python.exists() and str(_qdp_python) not in _sys.path:
 if _bench_dir.exists() and str(_bench_dir) not in _sys.path:
     _sys.path.insert(0, str(_bench_dir))
 
-from .qdp_test_utils import requires_qdp  # noqa: E402
+from .qdp_test_utils import requires_qdp
 
 
 @requires_qdp
diff --git a/testing/qdp/test_bindings.py b/testing/qdp/test_bindings.py
index 13916e6d7..c21ad12f7 100644
--- a/testing/qdp/test_bindings.py
+++ b/testing/qdp/test_bindings.py
@@ -163,7 +163,7 @@ def test_pytorch_integration():
 @requires_qdp
 @pytest.mark.gpu
 @pytest.mark.parametrize(
-    "precision,expected_dtype",
+    ("precision", "expected_dtype"),
     [
         ("float32", "complex64"),
         ("float64", "complex128"),
@@ -188,7 +188,7 @@ def test_precision(precision, expected_dtype):
 @requires_qdp
 @pytest.mark.gpu
 @pytest.mark.parametrize(
-    "data_shape,expected_shape",
+    ("data_shape", "expected_shape"),
     [
         ([1.0, 2.0, 3.0, 4.0], (1, 4)),  # 1D tensor -> single sample
         (
@@ -224,11 +224,12 @@ def test_encode_from_tensorflow_binding():
     """Test TensorFlow TensorProto binding path (requires GPU and 
TensorFlow)."""
     pytest.importorskip("torch")
     tf = pytest.importorskip("tensorflow")
-    import numpy as np
-    from _qdp import QdpEngine
     import os
     import tempfile
 
+    import numpy as np
+    from _qdp import QdpEngine
+
     if not torch.cuda.is_available():
         pytest.skip("GPU required for QdpEngine")
 
@@ -277,7 +278,7 @@ def test_encode_errors():
 @requires_qdp
 @pytest.mark.gpu
 @pytest.mark.parametrize(
-    "data_shape,expected_shape,expected_batch_size",
+    ("data_shape", "expected_shape", "expected_batch_size"),
     [
         ([1.0, 2.0, 3.0, 4.0], (1, 4), 1),  # 1D tensor -> single sample
         (
@@ -392,7 +393,7 @@ def test_encode_cuda_tensor_empty():
 @requires_qdp
 @pytest.mark.gpu
 @pytest.mark.parametrize(
-    "data_shape,is_batch",
+    ("data_shape", "is_batch"),
     [
         ([1.0, 2.0, 3.0, 4.0], False),  # 1D tensor
         ([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]], True),  # 2D tensor 
(batch)
@@ -423,7 +424,7 @@ def test_encode_cuda_tensor_preserves_input(data_shape, 
is_batch):
 @requires_qdp
 @pytest.mark.gpu
 @pytest.mark.parametrize(
-    "encoding_method,data",
+    ("encoding_method", "data"),
     [
         ("iqp-z", [0.1, -0.2]),
         ("iqp", [0.1, -0.2, 0.3]),
@@ -471,7 +472,7 @@ def test_encode_cuda_tensor_invalid_encoding_method():
 @requires_qdp
 @pytest.mark.gpu
 @pytest.mark.parametrize(
-    "input_type,error_match",
+    ("input_type", "error_match"),
     [
         ("cuda_tensor", "Unsupported CUDA tensor shape: 3D"),
         ("cpu_tensor", "Unsupported tensor shape: 3D"),
@@ -506,7 +507,7 @@ def test_encode_3d_rejected(input_type, error_match):
 @requires_qdp
 @pytest.mark.gpu
 @pytest.mark.parametrize(
-    "tensor_factory,description",
+    ("tensor_factory", "description"),
     [
         (lambda: torch.zeros(4, dtype=torch.float64, device="cuda:0"), 
"zeros"),
         (
@@ -541,7 +542,7 @@ def 
test_encode_cuda_tensor_non_finite_values(tensor_factory, description):
 @requires_qdp
 @pytest.mark.gpu
 @pytest.mark.parametrize(
-    "precision,expected_dtype",
+    ("precision", "expected_dtype"),
     [
         ("float32", torch.complex64),
         ("float64", torch.complex128),
@@ -566,7 +567,7 @@ def test_encode_cuda_tensor_output_dtype(precision, 
expected_dtype):
 @requires_qdp
 @pytest.mark.gpu
 @pytest.mark.parametrize(
-    "precision,expected_dtype",
+    ("precision", "expected_dtype"),
     [
         ("float32", torch.complex64),
         ("float64", torch.complex128),
@@ -794,7 +795,7 @@ def test_angle_encode_errors():
 @requires_qdp
 @pytest.mark.gpu
 @pytest.mark.parametrize(
-    "data_shape,expected_shape",
+    ("data_shape", "expected_shape"),
     [
         ([1.0, 2.0, 3.0, 4.0], (1, 4)),  # 1D array -> single sample
         (
@@ -827,10 +828,11 @@ def test_encode_numpy_array(data_shape, expected_shape):
 def test_encode_pathlib_path():
     """Test encoding from pathlib.Path object."""
     pytest.importorskip("torch")
-    import numpy as np
-    from pathlib import Path
-    import tempfile
     import os
+    import tempfile
+    from pathlib import Path
+
+    import numpy as np
     from _qdp import QdpEngine
 
     if not torch.cuda.is_available():
diff --git a/testing/qdp/test_high_fidelity.py 
b/testing/qdp/test_high_fidelity.py
index a4641e809..448883149 100644
--- a/testing/qdp/test_high_fidelity.py
+++ b/testing/qdp/test_high_fidelity.py
@@ -19,10 +19,11 @@ Tests include: full-stack verification, async pipeline, 
fidelity metrics,
 zero-copy validation, and edge cases (boundaries, stability, memory, threads).
 """
 
+import concurrent.futures
+
+import numpy as np
 import pytest
 import torch
-import numpy as np
-import concurrent.futures
 
 from .qdp_test_utils import requires_qdp
 
@@ -81,7 +82,7 @@ def engine_float64():
 @requires_qdp
 @pytest.mark.gpu
 @pytest.mark.parametrize(
-    "num_qubits, data_size, desc",
+    ("num_qubits", "data_size", "desc"),
     [
         (4, 16, "Small - Sync Path"),
         (10, 1000, "Medium - Padding Logic"),
diff --git a/testing/qdp/test_numpy.py b/testing/qdp/test_numpy.py
index b354bb5f3..40e3c2559 100644
--- a/testing/qdp/test_numpy.py
+++ b/testing/qdp/test_numpy.py
@@ -16,8 +16,8 @@
 
 """Test NumPy file format and array input support in Mahout QDP Python 
bindings"""
 
-import tempfile
 import os
+import tempfile
 
 import numpy as np
 import pytest
@@ -43,7 +43,7 @@ def _verify_tensor(tensor, expected_shape, 
check_normalization=False):
 @requires_qdp
 @pytest.mark.gpu
 @pytest.mark.parametrize(
-    "num_samples,num_qubits,check_norm",
+    ("num_samples", "num_qubits", "check_norm"),
     [
         (10, 3, True),  # Basic: 10 samples, 3 qubits, check normalization
         (100, 6, False),  # Large: 100 samples, 6 qubits
@@ -105,7 +105,7 @@ def test_encode_numpy_array_1d(num_qubits):
 
 @requires_qdp
 @pytest.mark.gpu
[email protected]("num_samples,num_qubits", [(5, 2), (10, 3)])
[email protected](("num_samples", "num_qubits"), [(5, 2), (10, 3)])
 def test_encode_numpy_array_2d(num_samples, num_qubits):
     """Test 2D NumPy array encoding (batch)"""
     from _qdp import QdpEngine
@@ -150,7 +150,7 @@ def test_encode_numpy_encoding_methods(encoding_method):
 @requires_qdp
 @pytest.mark.gpu
 @pytest.mark.parametrize(
-    "precision,expected_dtype",
+    ("precision", "expected_dtype"),
     [
         ("float32", torch.complex64),
         ("float64", torch.complex128),
@@ -178,7 +178,7 @@ def test_encode_numpy_precision(precision, expected_dtype):
 @requires_qdp
 @pytest.mark.gpu
 @pytest.mark.parametrize(
-    "data,error_match",
+    ("data", "error_match"),
     [
         (
             np.array([1.0, 2.0, 3.0, 4.0], dtype=np.float32),
diff --git a/testing/qumat/test_amazon_braket_backend.py 
b/testing/qumat/test_amazon_braket_backend.py
index 34feb2d7d..f78383676 100644
--- a/testing/qumat/test_amazon_braket_backend.py
+++ b/testing/qumat/test_amazon_braket_backend.py
@@ -15,28 +15,29 @@
 # limitations under the License.
 
 from unittest.mock import MagicMock, patch
+
 from braket.circuits import FreeParameter
 
 from qumat.amazon_braket_backend import (
-    initialize_backend,
-    create_empty_circuit,
-    apply_not_gate,
-    apply_hadamard_gate,
     apply_cnot_gate,
-    apply_toffoli_gate,
-    apply_swap_gate,
     apply_cswap_gate,
+    apply_hadamard_gate,
+    apply_not_gate,
     apply_pauli_x_gate,
     apply_pauli_y_gate,
     apply_pauli_z_gate,
-    apply_t_gate,
     apply_rx_gate,
     apply_ry_gate,
     apply_rz_gate,
+    apply_swap_gate,
+    apply_t_gate,
+    apply_toffoli_gate,
     apply_u_gate,
+    calculate_prob_zero,
+    create_empty_circuit,
     execute_circuit,
     get_final_state_vector,
-    calculate_prob_zero,
+    initialize_backend,
 )
 
 # initialize_backend
diff --git a/testing/qumat/test_create_circuit.py 
b/testing/qumat/test_create_circuit.py
index 1f8eaa82f..3c37f2065 100644
--- a/testing/qumat/test_create_circuit.py
+++ b/testing/qumat/test_create_circuit.py
@@ -17,9 +17,10 @@
 
 import pytest
 
-from ..utils import TESTING_BACKENDS, get_backend_config
 from qumat import QuMat
 
+from ..utils import TESTING_BACKENDS, get_backend_config
+
 
 @pytest.mark.parametrize("backend_name", TESTING_BACKENDS)
 class TestCreateCircuit:
diff --git a/testing/qumat/test_final_quantum_states.py 
b/testing/qumat/test_final_quantum_states.py
index dba8b9d74..8c3a0ef93 100644
--- a/testing/qumat/test_final_quantum_states.py
+++ b/testing/qumat/test_final_quantum_states.py
@@ -15,10 +15,11 @@
 # limitations under the License.
 #
 
-import pytest
-import numpy as np
 from importlib import import_module
 
+import numpy as np
+import pytest
+
 from ..utils import TESTING_BACKENDS
 from ..utils.qumat_helpers import get_qumat_example_final_state_vector
 
diff --git a/testing/qumat/test_multi_qubit_gates.py 
b/testing/qumat/test_multi_qubit_gates.py
index 78a2b4c69..6bf5670d6 100644
--- a/testing/qumat/test_multi_qubit_gates.py
+++ b/testing/qumat/test_multi_qubit_gates.py
@@ -17,9 +17,10 @@
 
 import pytest
 
-from ..utils import TESTING_BACKENDS, get_backend_config, get_state_probability
 from qumat import QuMat
 
+from ..utils import TESTING_BACKENDS, get_backend_config, get_state_probability
+
 
 def create_qumat_instance(backend_name, num_qubits):
     """Create and initialize a QuMat instance with a circuit."""
@@ -70,7 +71,7 @@ class TestCNOTGate:
     """Test class for CNOT gate functionality."""
 
     @pytest.mark.parametrize(
-        "initial_state, control_qubit, target_qubit, expected_state",
+        ("initial_state", "control_qubit", "target_qubit", "expected_state"),
         [
             ("00", 0, 1, "00"),  # |00⟩ -> CNOT(0,1) -> |00⟩ (control=0, no 
flip)
             ("01", 0, 1, "01"),  # |01⟩ -> CNOT(0,1) -> |01⟩ (control=0, no 
flip)
@@ -101,7 +102,7 @@ class TestCNOTGate:
         )
 
     @pytest.mark.parametrize(
-        "initial_state, num_applications, expected_state",
+        ("initial_state", "num_applications", "expected_state"),
         [
             ("00", 1, "00"),  # |00⟩ -> CNOT -> |00⟩
             ("00", 2, "00"),  # |00⟩ -> CNOT -> CNOT -> |00⟩ (CNOT² = I)
@@ -131,7 +132,7 @@ class TestCNOTGate:
         )
 
     @pytest.mark.parametrize(
-        "control_qubit, target_qubit, num_qubits",
+        ("control_qubit", "target_qubit", "num_qubits"),
         [
             # 3-qubit circuits
             (0, 1, 3),  # CNOT on qubits 0 and 1 in 3-qubit circuit
@@ -171,7 +172,7 @@ class TestCNOTGate:
         )
 
     @pytest.mark.parametrize(
-        "control_qubit, target_qubit, expected_states",
+        ("control_qubit", "target_qubit", "expected_states"),
         [
             # Standard Bell state: |00⟩ + |11⟩
             (0, 1, ["00", "11"]),
@@ -204,7 +205,7 @@ class TestToffoliGate:
     """Test class for Toffoli gate functionality."""
 
     @pytest.mark.parametrize(
-        "initial_state, control1, control2, target, expected_state",
+        ("initial_state", "control1", "control2", "target", "expected_state"),
         [
             # Toffoli(0,1,2): flip target only if both controls are |1⟩
             ("000", 0, 1, 2, "000"),  # |000⟩ -> Toffoli -> |000⟩
@@ -286,7 +287,7 @@ class TestToffoliGate:
         )
 
     @pytest.mark.parametrize(
-        "initial_state, num_applications, expected_state",
+        ("initial_state", "num_applications", "expected_state"),
         [
             ("000", 1, "000"),  # |000⟩ -> Toffoli -> |000⟩
             ("000", 2, "000"),  # |000⟩ -> Toffoli -> Toffoli -> |000⟩ 
(Toffoli² = I)
@@ -324,7 +325,7 @@ class TestToffoliGate:
         )
 
     @pytest.mark.parametrize(
-        "control1, control2, target, num_qubits",
+        ("control1", "control2", "target", "num_qubits"),
         [
             # 4-qubit circuits
             (0, 1, 2, 4),  # Toffoli on qubits 0, 1, 2 in 4-qubit circuit
@@ -361,7 +362,7 @@ class TestToffoliGate:
         )
 
     @pytest.mark.parametrize(
-        "initial_state, expected_state, control1, control2, target",
+        ("initial_state", "expected_state", "control1", "control2", "target"),
         [
             # Toffoli(0,1,2): target = control0 AND control1
             ("000", "000", 0, 1, 2),  # 0 AND 0 = 0
@@ -404,7 +405,7 @@ class TestMultiQubitGatesEdgeCases:
     """Test class for edge cases of multi-qubit gates."""
 
     @pytest.mark.parametrize(
-        "gate_name, gate_args",
+        ("gate_name", "gate_args"),
         [
             ("cnot", (0, 1)),
             ("toffoli", (0, 1, 2)),
@@ -414,14 +415,15 @@ class TestMultiQubitGatesEdgeCases:
         """Test that gates raise error on uninitialized circuit."""
         backend_config = get_backend_config(backend_name)
         qumat = QuMat(backend_config)
-        with pytest.raises(RuntimeError, match="circuit not initialized"):
-            if gate_name == "cnot":
+        if gate_name == "cnot":
+            with pytest.raises(RuntimeError, match="circuit not initialized"):
                 qumat.apply_cnot_gate(*gate_args)
-            else:
+        else:
+            with pytest.raises(RuntimeError, match="circuit not initialized"):
                 qumat.apply_toffoli_gate(*gate_args)
 
     @pytest.mark.parametrize(
-        "num_qubits, gate_name, gate_args",
+        ("num_qubits", "gate_name", "gate_args"),
         [
             (2, "cnot", (5, 6)),
             (3, "cnot", (10, 11)),
@@ -445,7 +447,7 @@ class TestMultiQubitGatesEdgeCases:
             pass
 
     @pytest.mark.parametrize(
-        "num_qubits, gate_name, gate_args",
+        ("num_qubits", "gate_name", "gate_args"),
         [
             (2, "cnot", (0, 0)),
             (3, "cnot", (1, 1)),
diff --git a/testing/qumat/test_overlap_measurement.py 
b/testing/qumat/test_overlap_measurement.py
index 4dbc45b99..feb3aac21 100644
--- a/testing/qumat/test_overlap_measurement.py
+++ b/testing/qumat/test_overlap_measurement.py
@@ -15,12 +15,13 @@
 # limitations under the License.
 #
 
-import pytest
 import numpy as np
+import pytest
 
-from ..utils import TESTING_BACKENDS, get_backend_config
 from qumat import QuMat
 
+from ..utils import TESTING_BACKENDS, get_backend_config
+
 
 @pytest.mark.parametrize("backend_name", TESTING_BACKENDS)
 class TestOverlapMeasurement:
diff --git a/testing/qumat/test_qdp_module.py b/testing/qumat/test_qdp_module.py
index caf28eee0..e249c12cc 100644
--- a/testing/qumat/test_qdp_module.py
+++ b/testing/qumat/test_qdp_module.py
@@ -14,11 +14,12 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import sys
 import importlib
-import pytest
+import sys
 from unittest.mock import patch
 
+import pytest
+
 
 def _reload_qdp_without_extension():
     """
diff --git a/testing/qumat/test_rotation_gates.py 
b/testing/qumat/test_rotation_gates.py
index 70f8d0c30..180dbb05c 100644
--- a/testing/qumat/test_rotation_gates.py
+++ b/testing/qumat/test_rotation_gates.py
@@ -86,7 +86,7 @@ class TestRXGate:
     """Test class for RX gate functionality."""
 
     @pytest.mark.parametrize(
-        "angle, expected_behavior",
+        ("angle", "expected_behavior"),
         [
             (0, "identity"),  # RX(0) = I
             (math.pi, "pauli_x"),  # RX(π) = X
@@ -134,7 +134,7 @@ class TestRYGate:
     """Test class for RY gate functionality."""
 
     @pytest.mark.parametrize(
-        "angle, expected_behavior",
+        ("angle", "expected_behavior"),
         [
             (0, "identity"),  # RY(0) = I
             (math.pi, "pauli_y"),  # RY(π) ≈ Y (phase doesn't affect 
measurement)
@@ -183,7 +183,7 @@ class TestRZGate:
     """Test class for RZ gate functionality."""
 
     @pytest.mark.parametrize(
-        "angle, expected_state",
+        ("angle", "expected_state"),
         [
             (0, "0"),  # RZ(0) = I, |0⟩ -> |0⟩
             (math.pi, "0"),  # RZ(π) adds phase, but |0⟩ measurement unchanged
@@ -231,7 +231,7 @@ class TestParameterizedRotationGates:
     """Test class for parameterized rotation gates using string parameters."""
 
     @pytest.mark.parametrize(
-        "gate_type, param_name",
+        ("gate_type", "param_name"),
         [
             ("rx", "theta"),
             ("ry", "phi"),
@@ -263,7 +263,7 @@ class TestParameterBinding:
     """Test class for parameter binding in rotation gates."""
 
     @pytest.mark.parametrize(
-        "gate_type, param_name, bound_value, expected_behavior",
+        ("gate_type", "param_name", "bound_value", "expected_behavior"),
         [
             ("rx", "theta", math.pi, "pauli_x"),  # RX(π) = X
             (
diff --git a/testing/qumat/test_single_qubit_gates.py 
b/testing/qumat/test_single_qubit_gates.py
index 6bf7f5b60..905c390ad 100644
--- a/testing/qumat/test_single_qubit_gates.py
+++ b/testing/qumat/test_single_qubit_gates.py
@@ -16,11 +16,13 @@
 #
 
 import math
+
 import pytest
 
-from ..utils import TESTING_BACKENDS, get_backend_config, get_state_probability
 from qumat import QuMat
 
+from ..utils import TESTING_BACKENDS, get_backend_config, get_state_probability
+
 
 def get_superposition_probabilities(results, num_qubits=1):
     """
@@ -63,7 +65,7 @@ class TestPauliXGate:
     """Test class for Pauli X gate functionality."""
 
     @pytest.mark.parametrize(
-        "initial_state, num_applications, expected_state",
+        ("initial_state", "num_applications", "expected_state"),
         [
             ("0", 1, "1"),  # |0⟩ -> X -> |1⟩
             ("1", 1, "0"),  # |1⟩ -> X -> |0⟩
@@ -105,7 +107,7 @@ class TestPauliXGate:
         )
 
     @pytest.mark.parametrize(
-        "qubits_to_flip, num_qubits, expected_state",
+        ("qubits_to_flip", "num_qubits", "expected_state"),
         [
             ([0], 1, "1"),  # Single qubit: flip qubit 0 -> |1⟩
             ([0, 2], 3, "101"),  # Three qubits: flip qubits 0 and 2 -> |101⟩
@@ -145,7 +147,7 @@ class TestPauliYGate:
     """Test class for Pauli Y gate functionality."""
 
     @pytest.mark.parametrize(
-        "initial_state, num_applications, expected_state",
+        ("initial_state", "num_applications", "expected_state"),
         [
             ("0", 1, "1"),  # |0⟩ -> Y -> i|1⟩ (phase doesn't affect 
measurement)
             ("1", 1, "0"),  # |1⟩ -> Y -> -i|0⟩
@@ -192,7 +194,7 @@ class TestHadamardGate:
     """Test class for Hadamard gate functionality."""
 
     @pytest.mark.parametrize(
-        "initial_state, num_applications",
+        ("initial_state", "num_applications"),
         [
             ("0", 1),  # |0⟩ -> H -> |+⟩ (superposition)
             ("1", 1),  # |1⟩ -> H -> |-⟩ (superposition)
@@ -250,7 +252,7 @@ class TestNOTGate:
     """Test class for NOT gate functionality."""
 
     @pytest.mark.parametrize(
-        "initial_state, num_applications, expected_state",
+        ("initial_state", "num_applications", "expected_state"),
         [
             ("0", 1, "1"),  # |0⟩ -> NOT -> |1⟩ (equivalent to Pauli X)
             ("1", 1, "0"),  # |1⟩ -> NOT -> |0⟩
@@ -297,7 +299,7 @@ class TestUGate:
     """Test class for U gate (universal single-qubit gate) functionality."""
 
     @pytest.mark.parametrize(
-        "theta, phi, lambd, expected_behavior",
+        ("theta", "phi", "lambd", "expected_behavior"),
         [
             (0, 0, 0, "identity"),  # U(0, 0, 0) should be identity
             (
@@ -396,13 +398,16 @@ class TestUGate:
             assert prob_zero > 0.1 or prob_one > 0.1, (
                 f"Expected superposition after U({theta},{phi},{lambd}), got 
prob_zero={prob_zero:.4f}, prob_one={prob_one:.4f}"
             )
-            assert prob_zero < 0.9 and prob_one < 0.9, (
+            assert prob_zero < 0.9, (
+                f"Expected superposition after U({theta},{phi},{lambd}), got 
prob_zero={prob_zero:.4f}, prob_one={prob_one:.4f}"
+            )
+            assert prob_one < 0.9, (
                 f"Expected superposition after U({theta},{phi},{lambd}), got 
prob_zero={prob_zero:.4f}, prob_one={prob_one:.4f}"
             )
 
 
 @pytest.mark.parametrize(
-    "theta, phi, lambd",
+    ("theta", "phi", "lambd"),
     [
         (math.pi / 4, math.pi / 4, math.pi / 4),
         (math.pi / 2, math.pi / 4, 0),
@@ -459,7 +464,7 @@ class TestPauliZGate:
     """Test class for Pauli Z gate functionality."""
 
     @pytest.mark.parametrize(
-        "initial_state, num_applications, expected_state",
+        ("initial_state", "num_applications", "expected_state"),
         [
             ("0", 1, "0"),  # |0⟩ -> Z -> |0⟩ (Z leaves |0⟩ unchanged)
             ("1", 1, "1"),  # |1⟩ -> Z -> -|1⟩ (phase flip doesn't affect 
measurement)
@@ -532,7 +537,7 @@ class TestTGate:
     """Test class for T gate functionality."""
 
     @pytest.mark.parametrize(
-        "initial_state, expected_state",
+        ("initial_state", "expected_state"),
         [
             ("0", "0"),  # T leaves |0> unchanged
             ("1", "1"),  # T applies phase to |1>, measurement unchanged
@@ -750,7 +755,7 @@ class TestSingleQubitGatesEdgeCases:
 
 
 @pytest.mark.parametrize(
-    "gate_name, expected_state_or_behavior",
+    ("gate_name", "expected_state_or_behavior"),
     [
         ("pauli_x", "1"),  # Pauli X should flip |0⟩ to |1⟩
         ("hadamard", "superposition"),  # Hadamard creates superposition
diff --git a/testing/qumat/test_swap_test.py b/testing/qumat/test_swap_test.py
index 26530bb2f..7c13e2d8f 100644
--- a/testing/qumat/test_swap_test.py
+++ b/testing/qumat/test_swap_test.py
@@ -17,9 +17,10 @@
 
 import pytest
 
-from ..utils import TESTING_BACKENDS, get_backend_config
 from qumat import QuMat
 
+from ..utils import TESTING_BACKENDS, get_backend_config
+
 
 @pytest.mark.parametrize("backend_name", TESTING_BACKENDS)
 class TestSwapTest:
diff --git a/testing/utils/amazon_braket_helpers.py 
b/testing/utils/amazon_braket_helpers.py
index e8a04bbb2..448c6484c 100644
--- a/testing/utils/amazon_braket_helpers.py
+++ b/testing/utils/amazon_braket_helpers.py
@@ -15,9 +15,9 @@
 # limitations under the License.
 #
 
-from braket.devices import LocalSimulator
-from braket.circuits import Circuit
 import numpy as np
+from braket.circuits import Circuit
+from braket.devices import LocalSimulator
 
 
 def get_qumat_backend_config(test_type: str = "get_final_state_vector"):
diff --git a/testing/utils/qumat_helpers.py b/testing/utils/qumat_helpers.py
index d0dcdd023..2e024857e 100644
--- a/testing/utils/qumat_helpers.py
+++ b/testing/utils/qumat_helpers.py
@@ -14,8 +14,10 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-import numpy as np
 from functools import reduce
+
+import numpy as np
+
 from qumat.qumat import QuMat
 
 
diff --git a/uv.lock b/uv.lock
index a89d21407..678148684 100644
--- a/uv.lock
+++ b/uv.lock
@@ -2144,28 +2144,27 @@ wheels = [
 
 [[package]]
 name = "ruff"
-version = "0.14.11"
-source = { registry = "https://pypi.org/simple"; }
-sdist = { url = 
"https://files.pythonhosted.org/packages/d4/77/9a7fe084d268f8855d493e5031ea03fa0af8cc05887f638bf1c4e3363eb8/ruff-0.14.11.tar.gz";,
 hash = 
"sha256:f6dc463bfa5c07a59b1ff2c3b9767373e541346ea105503b4c0369c520a66958", size 
= 5993417, upload-time = "2026-01-08T19:11:58.322Z" }
-wheels = [
-    { url = 
"https://files.pythonhosted.org/packages/f0/a6/a4c40a5aaa7e331f245d2dc1ac8ece306681f52b636b40ef87c88b9f7afd/ruff-0.14.11-py3-none-linux_armv6l.whl";,
 hash = 
"sha256:f6ff2d95cbd335841a7217bdfd9c1d2e44eac2c584197ab1385579d55ff8830e", size 
= 12951208, upload-time = "2026-01-08T19:12:09.218Z" },
-    { url = 
"https://files.pythonhosted.org/packages/5c/5c/360a35cb7204b328b685d3129c08aca24765ff92b5a7efedbdd6c150d555/ruff-0.14.11-py3-none-macosx_10_12_x86_64.whl";,
 hash = 
"sha256:6f6eb5c1c8033680f4172ea9c8d3706c156223010b8b97b05e82c59bdc774ee6", size 
= 13330075, upload-time = "2026-01-08T19:12:02.549Z" },
-    { url = 
"https://files.pythonhosted.org/packages/1b/9e/0cc2f1be7a7d33cae541824cf3f95b4ff40d03557b575912b5b70273c9ec/ruff-0.14.11-py3-none-macosx_11_0_arm64.whl";,
 hash = 
"sha256:f2fc34cc896f90080fca01259f96c566f74069a04b25b6205d55379d12a6855e", size 
= 12257809, upload-time = "2026-01-08T19:12:00.366Z" },
-    { url = 
"https://files.pythonhosted.org/packages/a7/e5/5faab97c15bb75228d9f74637e775d26ac703cc2b4898564c01ab3637c02/ruff-0.14.11-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl";,
 hash = 
"sha256:53386375001773ae812b43205d6064dae49ff0968774e6befe16a994fc233caa", size 
= 12678447, upload-time = "2026-01-08T19:12:13.899Z" },
-    { url = 
"https://files.pythonhosted.org/packages/1b/33/e9767f60a2bef779fb5855cab0af76c488e0ce90f7bb7b8a45c8a2ba4178/ruff-0.14.11-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl";,
 hash = 
"sha256:a697737dce1ca97a0a55b5ff0434ee7205943d4874d638fe3ae66166ff46edbe", size 
= 12758560, upload-time = "2026-01-08T19:11:42.55Z" },
-    { url = 
"https://files.pythonhosted.org/packages/eb/84/4c6cf627a21462bb5102f7be2a320b084228ff26e105510cd2255ea868e5/ruff-0.14.11-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl";,
 hash = 
"sha256:6845ca1da8ab81ab1dce755a32ad13f1db72e7fba27c486d5d90d65e04d17b8f", size 
= 13599296, upload-time = "2026-01-08T19:11:30.371Z" },
-    { url = 
"https://files.pythonhosted.org/packages/88/e1/92b5ed7ea66d849f6157e695dc23d5d6d982bd6aa8d077895652c38a7cae/ruff-0.14.11-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl";,
 hash = 
"sha256:e36ce2fd31b54065ec6f76cb08d60159e1b32bdf08507862e32f47e6dde8bcbf", size 
= 15048981, upload-time = "2026-01-08T19:12:04.742Z" },
-    { url = 
"https://files.pythonhosted.org/packages/61/df/c1bd30992615ac17c2fb64b8a7376ca22c04a70555b5d05b8f717163cf9f/ruff-0.14.11-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl";,
 hash = 
"sha256:590bcc0e2097ecf74e62a5c10a6b71f008ad82eb97b0a0079e85defe19fe74d9", size 
= 14633183, upload-time = "2026-01-08T19:11:40.069Z" },
-    { url = 
"https://files.pythonhosted.org/packages/04/e9/fe552902f25013dd28a5428a42347d9ad20c4b534834a325a28305747d64/ruff-0.14.11-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl";,
 hash = 
"sha256:53fe71125fc158210d57fe4da26e622c9c294022988d08d9347ec1cf782adafe", size 
= 14050453, upload-time = "2026-01-08T19:11:37.555Z" },
-    { url = 
"https://files.pythonhosted.org/packages/ae/93/f36d89fa021543187f98991609ce6e47e24f35f008dfe1af01379d248a41/ruff-0.14.11-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl";,
 hash = 
"sha256:a35c9da08562f1598ded8470fcfef2afb5cf881996e6c0a502ceb61f4bc9c8a3", size 
= 13757889, upload-time = "2026-01-08T19:12:07.094Z" },
-    { url = 
"https://files.pythonhosted.org/packages/b7/9f/c7fb6ecf554f28709a6a1f2a7f74750d400979e8cd47ed29feeaa1bd4db8/ruff-0.14.11-py3-none-manylinux_2_31_riscv64.whl";,
 hash = 
"sha256:0f3727189a52179393ecf92ec7057c2210203e6af2676f08d92140d3e1ee72c1", size 
= 13955832, upload-time = "2026-01-08T19:11:55.064Z" },
-    { url = 
"https://files.pythonhosted.org/packages/db/a0/153315310f250f76900a98278cf878c64dfb6d044e184491dd3289796734/ruff-0.14.11-py3-none-musllinux_1_2_aarch64.whl";,
 hash = 
"sha256:eb09f849bd37147a789b85995ff734a6c4a095bed5fd1608c4f56afc3634cde2", size 
= 12586522, upload-time = "2026-01-08T19:11:35.356Z" },
-    { url = 
"https://files.pythonhosted.org/packages/2f/2b/a73a2b6e6d2df1d74bf2b78098be1572191e54bec0e59e29382d13c3adc5/ruff-0.14.11-py3-none-musllinux_1_2_armv7l.whl";,
 hash = 
"sha256:c61782543c1231bf71041461c1f28c64b961d457d0f238ac388e2ab173d7ecb7", size 
= 12724637, upload-time = "2026-01-08T19:11:47.796Z" },
-    { url = 
"https://files.pythonhosted.org/packages/f0/41/09100590320394401cd3c48fc718a8ba71c7ddb1ffd07e0ad6576b3a3df2/ruff-0.14.11-py3-none-musllinux_1_2_i686.whl";,
 hash = 
"sha256:82ff352ea68fb6766140381748e1f67f83c39860b6446966cff48a315c3e2491", size 
= 13145837, upload-time = "2026-01-08T19:11:32.87Z" },
-    { url = 
"https://files.pythonhosted.org/packages/3b/d8/e035db859d1d3edf909381eb8ff3e89a672d6572e9454093538fe6f164b0/ruff-0.14.11-py3-none-musllinux_1_2_x86_64.whl";,
 hash = 
"sha256:728e56879df4ca5b62a9dde2dd0eb0edda2a55160c0ea28c4025f18c03f86984", size 
= 13850469, upload-time = "2026-01-08T19:12:11.694Z" },
-    { url = 
"https://files.pythonhosted.org/packages/4e/02/bb3ff8b6e6d02ce9e3740f4c17dfbbfb55f34c789c139e9cd91985f356c7/ruff-0.14.11-py3-none-win32.whl";,
 hash = 
"sha256:337c5dd11f16ee52ae217757d9b82a26400be7efac883e9e852646f1557ed841", size 
= 12851094, upload-time = "2026-01-08T19:11:45.163Z" },
-    { url = 
"https://files.pythonhosted.org/packages/58/f1/90ddc533918d3a2ad628bc3044cdfc094949e6d4b929220c3f0eb8a1c998/ruff-0.14.11-py3-none-win_amd64.whl";,
 hash = 
"sha256:f981cea63d08456b2c070e64b79cb62f951aa1305282974d4d5216e6e0178ae6", size 
= 14001379, upload-time = "2026-01-08T19:11:52.591Z" },
-    { url = 
"https://files.pythonhosted.org/packages/c4/1c/1dbe51782c0e1e9cfce1d1004752672d2d4629ea46945d19d731ad772b3b/ruff-0.14.11-py3-none-win_arm64.whl";,
 hash = 
"sha256:649fb6c9edd7f751db276ef42df1f3df41c38d67d199570ae2a7bd6cbc3590f0", size 
= 12938644, upload-time = "2026-01-08T19:11:50.027Z" },
+version = "0.15.5"
+source = { registry = "https://pypi.org/simple"; }
+sdist = { url = 
"https://files.pythonhosted.org/packages/77/9b/840e0039e65fcf12758adf684d2289024d6140cde9268cc59887dc55189c/ruff-0.15.5.tar.gz";,
 hash = 
"sha256:7c3601d3b6d76dce18c5c824fc8d06f4eef33d6df0c21ec7799510cde0f159a2", size 
= 4574214, upload-time = "2026-03-05T20:06:34.946Z" }
+wheels = [
+    { url = 
"https://files.pythonhosted.org/packages/47/20/5369c3ce21588c708bcbe517a8fbe1a8dfdb5dfd5137e14790b1da71612c/ruff-0.15.5-py3-none-linux_armv6l.whl";,
 hash = 
"sha256:4ae44c42281f42e3b06b988e442d344a5b9b72450ff3c892e30d11b29a96a57c", size 
= 10478185, upload-time = "2026-03-05T20:06:29.093Z" },
+    { url = 
"https://files.pythonhosted.org/packages/44/ed/e81dd668547da281e5dce710cf0bc60193f8d3d43833e8241d006720e42b/ruff-0.15.5-py3-none-macosx_10_12_x86_64.whl";,
 hash = 
"sha256:6edd3792d408ebcf61adabc01822da687579a1a023f297618ac27a5b51ef0080", size 
= 10859201, upload-time = "2026-03-05T20:06:32.632Z" },
+    { url = 
"https://files.pythonhosted.org/packages/c4/8f/533075f00aaf19b07c5cd6aa6e5d89424b06b3b3f4583bfa9c640a079059/ruff-0.15.5-py3-none-macosx_11_0_arm64.whl";,
 hash = 
"sha256:89f463f7c8205a9f8dea9d658d59eff49db05f88f89cc3047fb1a02d9f344010", size 
= 10184752, upload-time = "2026-03-05T20:06:40.312Z" },
+    { url = 
"https://files.pythonhosted.org/packages/66/0e/ba49e2c3fa0395b3152bad634c7432f7edfc509c133b8f4529053ff024fb/ruff-0.15.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl";,
 hash = 
"sha256:ba786a8295c6574c1116704cf0b9e6563de3432ac888d8f83685654fe528fd65", size 
= 10534857, upload-time = "2026-03-05T20:06:19.581Z" },
+    { url = 
"https://files.pythonhosted.org/packages/59/71/39234440f27a226475a0659561adb0d784b4d247dfe7f43ffc12dd02e288/ruff-0.15.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl";,
 hash = 
"sha256:fd4b801e57955fe9f02b31d20375ab3a5c4415f2e5105b79fb94cf2642c91440", size 
= 10309120, upload-time = "2026-03-05T20:06:00.435Z" },
+    { url = 
"https://files.pythonhosted.org/packages/f5/87/4140aa86a93df032156982b726f4952aaec4a883bb98cb6ef73c347da253/ruff-0.15.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl";,
 hash = 
"sha256:391f7c73388f3d8c11b794dbbc2959a5b5afe66642c142a6effa90b45f6f5204", size 
= 11047428, upload-time = "2026-03-05T20:05:51.867Z" },
+    { url = 
"https://files.pythonhosted.org/packages/5a/f7/4953e7e3287676f78fbe85e3a0ca414c5ca81237b7575bdadc00229ac240/ruff-0.15.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl";,
 hash = 
"sha256:8dc18f30302e379fe1e998548b0f5e9f4dff907f52f73ad6da419ea9c19d66c8", size 
= 11914251, upload-time = "2026-03-05T20:06:22.887Z" },
+    { url = 
"https://files.pythonhosted.org/packages/77/46/0f7c865c10cf896ccf5a939c3e84e1cfaeed608ff5249584799a74d33835/ruff-0.15.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl";,
 hash = 
"sha256:1cc6e7f90087e2d27f98dc34ed1b3ab7c8f0d273cc5431415454e22c0bd2a681", size 
= 11333801, upload-time = "2026-03-05T20:05:57.168Z" },
+    { url = 
"https://files.pythonhosted.org/packages/d3/01/a10fe54b653061585e655f5286c2662ebddb68831ed3eaebfb0eb08c0a16/ruff-0.15.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl";,
 hash = 
"sha256:c1cb7169f53c1ddb06e71a9aebd7e98fc0fea936b39afb36d8e86d36ecc2636a", size 
= 11206821, upload-time = "2026-03-05T20:06:03.441Z" },
+    { url = 
"https://files.pythonhosted.org/packages/7a/0d/2132ceaf20c5e8699aa83da2706ecb5c5dcdf78b453f77edca7fb70f8a93/ruff-0.15.5-py3-none-manylinux_2_31_riscv64.whl";,
 hash = 
"sha256:9b037924500a31ee17389b5c8c4d88874cc6ea8e42f12e9c61a3d754ff72f1ca", size 
= 11133326, upload-time = "2026-03-05T20:06:25.655Z" },
+    { url = 
"https://files.pythonhosted.org/packages/72/cb/2e5259a7eb2a0f87c08c0fe5bf5825a1e4b90883a52685524596bfc93072/ruff-0.15.5-py3-none-musllinux_1_2_aarch64.whl";,
 hash = 
"sha256:65bb414e5b4eadd95a8c1e4804f6772bbe8995889f203a01f77ddf2d790929dd", size 
= 10510820, upload-time = "2026-03-05T20:06:37.79Z" },
+    { url = 
"https://files.pythonhosted.org/packages/ff/20/b67ce78f9e6c59ffbdb5b4503d0090e749b5f2d31b599b554698a80d861c/ruff-0.15.5-py3-none-musllinux_1_2_armv7l.whl";,
 hash = 
"sha256:d20aa469ae3b57033519c559e9bc9cd9e782842e39be05b50e852c7c981fa01d", size 
= 10302395, upload-time = "2026-03-05T20:05:54.504Z" },
+    { url = 
"https://files.pythonhosted.org/packages/5f/e5/719f1acccd31b720d477751558ed74e9c88134adcc377e5e886af89d3072/ruff-0.15.5-py3-none-musllinux_1_2_i686.whl";,
 hash = 
"sha256:15388dd28c9161cdb8eda68993533acc870aa4e646a0a277aa166de9ad5a8752", size 
= 10754069, upload-time = "2026-03-05T20:06:06.422Z" },
+    { url = 
"https://files.pythonhosted.org/packages/c3/9c/d1db14469e32d98f3ca27079dbd30b7b44dbb5317d06ab36718dee3baf03/ruff-0.15.5-py3-none-musllinux_1_2_x86_64.whl";,
 hash = 
"sha256:b30da330cbd03bed0c21420b6b953158f60c74c54c5f4c1dabbdf3a57bf355d2", size 
= 11304315, upload-time = "2026-03-05T20:06:10.867Z" },
+    { url = 
"https://files.pythonhosted.org/packages/28/3a/950367aee7c69027f4f422059227b290ed780366b6aecee5de5039d50fa8/ruff-0.15.5-py3-none-win32.whl";,
 hash = 
"sha256:732e5ee1f98ba5b3679029989a06ca39a950cced52143a0ea82a2102cb592b74", size 
= 10551676, upload-time = "2026-03-05T20:06:13.705Z" },
+    { url = 
"https://files.pythonhosted.org/packages/b8/00/bf077a505b4e649bdd3c47ff8ec967735ce2544c8e4a43aba42ee9bf935d/ruff-0.15.5-py3-none-win_amd64.whl";,
 hash = 
"sha256:821d41c5fa9e19117616c35eaa3f4b75046ec76c65e7ae20a333e9a8696bc7fe", size 
= 11678972, upload-time = "2026-03-05T20:06:45.379Z" },
+    { url = 
"https://files.pythonhosted.org/packages/fe/4e/cd76eca6db6115604b7626668e891c9dd03330384082e33662fb0f113614/ruff-0.15.5-py3-none-win_arm64.whl";,
 hash = 
"sha256:b498d1c60d2fe5c10c45ec3f698901065772730b411f164ae270bb6bfcc4740b", size 
= 10965572, upload-time = "2026-03-05T20:06:16.984Z" },
 ]
 
 [[package]]

Reply via email to