diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5fd25af3..43ceec2a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ ci: skip: [mypy] repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -20,8 +20,8 @@ repos: - id: fix-byte-order-marker - id: fix-encoding-pragma args: ['--remove'] -- repo: https://github.com/PyCQA/docformatter - rev: v1.7.5 +- repo: https://github.com/s-weigand/docformatter + rev: 1ec30b7 hooks: - id: docformatter args: @@ -66,7 +66,7 @@ repos: args: - --in-place - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.1 + rev: v1.11.2 hooks: - id: mypy exclude: tests/qis/test_pauli.py diff --git a/bqskit/ir/gates/__init__.py b/bqskit/ir/gates/__init__.py index 183a6426..fb9affdb 100644 --- a/bqskit/ir/gates/__init__.py +++ b/bqskit/ir/gates/__init__.py @@ -72,6 +72,8 @@ CRZGate CUGate FSIMGate + MPRYGate + MPRZGate PauliGate PauliZGate PhasedXZGate diff --git a/bqskit/runtime/detached.py b/bqskit/runtime/detached.py index ea32afbd..51b805aa 100644 --- a/bqskit/runtime/detached.py +++ b/bqskit/runtime/detached.py @@ -260,7 +260,7 @@ def handle_disconnect(self, conn: Connection) -> None: self.handle_cancel_comp_task(task_id) tasks_to_pop = [] - for (task, (tid, other_conn)) in self.tasks.items(): + for (task_id, (tid, other_conn)) in self.tasks.items(): if other_conn == conn: tasks_to_pop.append((task_id, tid)) diff --git a/tests/ir/gates/parameterized/test_mpry.py b/tests/ir/gates/parameterized/test_mpry.py index f16e6827..8d4b7aa5 100644 --- a/tests/ir/gates/parameterized/test_mpry.py +++ b/tests/ir/gates/parameterized/test_mpry.py @@ -2,11 +2,11 @@ from __future__ import annotations import numpy as np +import scipy.linalg as la from hypothesis import given from hypothesis.strategies import floats from hypothesis.strategies import integers from hypothesis.strategies import lists -from scipy.linalg import block_diag from bqskit.ir.gates.constant import PermutationGate from bqskit.ir.gates.parameterized import MPRYGate @@ -34,7 +34,7 @@ def test_get_unitary(thetas: list[float]) -> None: thetas = thetas[:2 ** (num_qudits - 1)] MPRy = MPRYGate(num_qudits=num_qudits) block_unitaries = [RYGate().get_unitary([theta]) for theta in thetas] - blocked_unitary = block_diag(*block_unitaries) + blocked_unitary = la.block_diag(*block_unitaries) dist = MPRy.get_unitary(thetas).get_distance_from(blocked_unitary) assert dist < 1e-7 @@ -50,7 +50,7 @@ def test_get_unitary_target_select(target_qubit: int) -> None: # Create the block diagonal matrix block_unitaries = [RYGate().get_unitary([theta]) for theta in thetas] - blocked_unitary = block_diag(*block_unitaries) + blocked_unitary = la.block_diag(*block_unitaries) # Apply a permutation transformation # to the block diagonal matrix diff --git a/tests/ir/gates/parameterized/test_mprz.py b/tests/ir/gates/parameterized/test_mprz.py index b19c5d92..0ba506e3 100644 --- a/tests/ir/gates/parameterized/test_mprz.py +++ b/tests/ir/gates/parameterized/test_mprz.py @@ -2,11 +2,11 @@ from __future__ import annotations import numpy as np +import scipy.linalg as la from hypothesis import given from hypothesis.strategies import floats from hypothesis.strategies import integers from hypothesis.strategies import lists -from scipy.linalg import block_diag from bqskit.ir.gates.constant import PermutationGate from bqskit.ir.gates.parameterized import MPRZGate @@ -34,7 +34,7 @@ def test_get_unitary(thetas: list[float]) -> None: thetas = thetas[:2 ** (num_qudits - 1)] MPRy = MPRZGate(num_qudits=num_qudits) block_unitaries = [RZGate().get_unitary([theta]) for theta in thetas] - blocked_unitary = block_diag(*block_unitaries) + blocked_unitary = la.block_diag(*block_unitaries) dist = MPRy.get_unitary(thetas).get_distance_from(blocked_unitary) assert dist < 1e-7 @@ -50,7 +50,7 @@ def test_get_unitary_target_select(target_qubit: int) -> None: # Create the block diagonal matrix block_unitaries = [RZGate().get_unitary([theta]) for theta in thetas] - blocked_unitary = block_diag(*block_unitaries) + blocked_unitary = la.block_diag(*block_unitaries) # Apply a permutation transformation # to the block diagonal matrix