Skip to content

Commit 0b14c31

Browse files
committed
Linter changes
1 parent 8a47166 commit 0b14c31

File tree

6 files changed

+20
-10
lines changed

6 files changed

+20
-10
lines changed

simulaqron/local/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def setup_local(myName: str, virtualNet: SocketsConfig, classicalNet: SocketsCon
131131

132132

133133
def _init_register(resList: DeferredList, myName: str, virtualNet: SocketsConfig, classicalNet: SocketsConfig,
134-
lNode: pb.Root, func: Callable, *args, **kwargs):
134+
lNode: pb.Root, func: Callable, *args, **kwargs):
135135
_logger.debug("SETUP_LOCAL %s: All connections set up.", myName)
136136

137137
# Retrieve the connection to the local virtual node, if successful

simulaqron/math.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ def assemble_qubit(realM: np.ndarray, imagM: np.ndarray) -> np.ndarray:
1818
for t in range(len(M)):
1919
M[s][t] = realM[s][t] + 1j * imagM[s][t]
2020

21-
return M
21+
return M

simulaqron/netqasm_backend/executioner.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from collections import defaultdict
55
from enum import Enum
66
from functools import partial
7-
from typing import Generator, List, Tuple, Callable, Dict
7+
from typing import Generator, List, Tuple, Callable, Dict, Union
88

99
import netqasm.lang.instr.core as core_instructions
1010
import netqasm.lang.instr.vanilla as vanilla_instructions
@@ -35,7 +35,11 @@ class UnknownQubitError(RuntimeError):
3535
"""
3636
pass
3737

38-
_VanillaRotInstr = vanilla_instructions.RotXInstruction | vanilla_instructions.RotYInstruction | vanilla_instructions.RotZInstruction
38+
39+
_VanillaRotInstr = Union[vanilla_instructions.RotXInstruction,
40+
vanilla_instructions.RotYInstruction,
41+
vanilla_instructions.RotZInstruction]
42+
3943

4044
# TODO - This class is candidate to be deleted! Test and delete if not needed!
4145
class NetworkStack(BaseNetworkStack):
@@ -62,6 +66,7 @@ def setup_epr_socket(self, epr_socket_id, remote_node_id, remote_epr_socket_id,
6266
def get_purpose_id(self, remote_node_id: int, epr_socket_id: int) -> int:
6367
pass
6468

69+
6570
class VanillaSimulaQronExecutioner(Executor):
6671
SIMULAQRON_OPS = {
6772
vanilla_instructions.GateXInstruction: "apply_X",
@@ -213,7 +218,13 @@ def _do_single_qubit_instr(self, instr, subroutine_id, address):
213218
qubit_id=position,
214219
)
215220

216-
def _do_single_qubit_rotation(self, instr: core_instructions.RotationInstruction, subroutine_id: int, address: int, angle: float):
221+
def _do_single_qubit_rotation(
222+
self,
223+
instr: core_instructions.RotationInstruction,
224+
subroutine_id: int,
225+
address: int,
226+
angle: float
227+
):
217228
assert isinstance(instr, _VanillaRotInstr)
218229
position = self._get_position(subroutine_id=subroutine_id, address=address)
219230
axis = self._get_axis(instr=instr)
@@ -356,7 +367,7 @@ def cmd_measure(self, qubit_id: int, inplace=True):
356367
return outcome
357368

358369
@inlineCallbacks
359-
def cmd_reset(self, qubit_id: int, correct: bool=True):
370+
def cmd_reset(self, qubit_id: int, correct: bool = True):
360371
r"""
361372
Reset the given qubit to the state :math:`|0>`.
362373
@@ -373,7 +384,7 @@ def cmd_reset(self, qubit_id: int, correct: bool=True):
373384
if correct and outcome:
374385
yield call_method(virt_qubit, "apply_X")
375386

376-
def _do_wait(self, delay: float=0.1):
387+
def _do_wait(self, delay: float = 0.1):
377388
d = task.deferLater(reactor, delay, lambda: self._logger.debug("Wait finished"))
378389
self._logger.debug("waiting a bit")
379390
yield d

simulaqron/network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import random
3131
import time
3232
from timeit import default_timer as timer
33-
from typing import List, Optional, Dict
33+
from typing import List, Dict
3434

3535
import networkx as nx
3636
from multiprocess.context import ForkProcess as Process

simulaqron/reactor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
reactor.start()
1919
...
2020
reactor.stop()
21-
"""
21+
"""

tests/slow/merges/test_merges.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import sys
22
from pathlib import Path
33

4-
import pytest
54
import os
65
import unittest
76
import logging

0 commit comments

Comments
 (0)