Skip to content

Commit cc742e7

Browse files
committed
lint fixes
1 parent aa9706b commit cc742e7

File tree

8 files changed

+14
-15
lines changed

8 files changed

+14
-15
lines changed

src/qutip_qip/circuit/circuit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ def draw(
966966

967967
if renderer == "latex":
968968
from qutip_qip.circuit.draw import TeXRenderer
969-
969+
970970
if file_type == "png" and dpi is None:
971971
dpi = 100
972972

src/qutip_qip/circuit/draw/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
"TeXRenderer",
1111
"CONVERTERS",
1212
"TextRenderer",
13-
]
13+
]

src/qutip_qip/device/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
"LinearSpinChain",
2626
"CircularSpinChain",
2727
"SpinChainModel",
28-
"OptPulseProcessor"
28+
"OptPulseProcessor",
2929
]

src/qutip_qip/qasm/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
from .qasm_tokenize import qasm_tokenize
22
from .qasm_processor import QasmProcessor
33
from .read_qasm import read_qasm
4-
from .save_qasm import (
5-
print_qasm,
6-
circuit_to_qasm_str,
7-
save_qasm
8-
)
4+
from .save_qasm import print_qasm, circuit_to_qasm_str, save_qasm
95

106
__all__ = [
117
"qasm_tokenize",
@@ -14,4 +10,4 @@
1410
"print_qasm",
1511
"circuit_to_qasm_str",
1612
"save_qasm"
17-
]
13+
]

src/qutip_qip/qasm/qasm_processor.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import warnings
44
from copy import deepcopy
55
import numpy as np
6-
from math import pi # Don't remove
6+
from math import pi # Don't remove
77

88
from qutip_qip.circuit import QubitCircuit
99
from qutip_qip.operations import (
@@ -14,6 +14,7 @@
1414
)
1515
from qutip_qip.qasm import qasm_tokenize
1616

17+
1718
class QasmGate:
1819
"""
1920
Class which stores the gate definitions as specified in the QASM file.
@@ -25,6 +26,7 @@ def __init__(self, name, gate_args, gate_regs):
2526
self.gate_regs = gate_regs
2627
self.gates_inside = []
2728

29+
2830
def _get_qiskit_gates():
2931
"""
3032
Create and return a dictionary containing a few commonly used qiskit gates
@@ -54,7 +56,6 @@ def ch():
5456
return {"ch": ch, "tdg": tdg, "id": id, "u2": u2, "sdg": sdg, "cu3": cu3}
5557

5658

57-
5859
def _gate_processor(command):
5960
"""
6061
Process tokens for a gate call statement separating them into args and regs.
@@ -214,7 +215,7 @@ def _initialize_pass(self):
214215
continue
215216
else:
216217
raise SyntaxError("QASM: incorrect bracket formatting")
217-
218+
218219
elif open_bracket_mode:
219220
# Define the decomposition of custom QASM gate
220221
if command[0] == "{":
@@ -269,7 +270,7 @@ def _initialize_pass(self):
269270
self.num_cbits += num_regs
270271
else:
271272
raise SyntaxError("QASM: incorrect bracket formatting")
272-
273+
273274
elif command[0] == "reset":
274275
raise NotImplementedError(
275276
("QASM: reset functionality " "is not supported.")

src/qutip_qip/qasm/qasm_tokenize.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import re
22
from itertools import chain
33

4+
45
def _tokenize_line(command):
56
"""
67
Tokenize (break into several parts a string of) a single line of QASM code.
@@ -86,4 +87,4 @@ def qasm_tokenize(token_cmds):
8687
tokens = _tokenize_line(command)
8788
processed_commands.append(tokens)
8889

89-
return list(filter(lambda x: x != [], processed_commands))
90+
return list(filter(lambda x: x != [], processed_commands))

src/qutip_qip/qasm/read_qasm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ def read_qasm(qasm_input, mode="default", version="2.0", strmode=False):
7272

7373
qasm_obj._final_pass(qc)
7474

75-
return qc
75+
return qc

src/qutip_qip/qasm/save_qasm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"TOFFOLI": "ccx",
1818
}
1919

20+
2021
class QasmOutput:
2122
"""
2223
Class for QASM export.

0 commit comments

Comments
 (0)