Skip to content

Commit c190367

Browse files
authored
Fix lint (#620)
1 parent 5d20d2e commit c190367

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

.pylintdict

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ leq
109109
lhs
110110
lin
111111
linearconstraint
112+
linexpr
112113
lowerbound
113114
lp
114115
lucas
@@ -174,6 +175,7 @@ qn
174175
qp
175176
qrac
176177
qrao
178+
quadexpr
177179
quadratically
178180
quadraticconstraint
179181
quadraticobjective

qiskit_optimization/algorithms/grover_optimizer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This code is part of a Qiskit project.
22
#
3-
# (C) Copyright IBM 2020, 2023.
3+
# (C) Copyright IBM 2020, 2024.
44
#
55
# This code is licensed under the Apache License, Version 2.0. You may
66
# obtain a copy of this license in the LICENSE.txt file in the root directory
@@ -165,6 +165,8 @@ def solve(self, problem: QuadraticProgram) -> OptimizationResult:
165165
# Variables for result object.
166166
operation_count = {}
167167
iteration = 0
168+
samples = None
169+
raw_samples = None
168170

169171
# Variables for stopping if we've hit the rotation max.
170172
rotations = 0

qiskit_optimization/algorithms/qrao/magic_rounding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def _make_circuits(
130130
qc = circuit.compose(_z_to_31p_qrac_basis_circuit(basis).inverse(), inplace=False)
131131
elif vars_per_qubit == 2:
132132
qc = circuit.compose(_z_to_21p_qrac_basis_circuit(basis).inverse(), inplace=False)
133-
elif vars_per_qubit == 1:
133+
else:
134134
qc = circuit.copy()
135135
qc.measure_all()
136136
circuits.append(qc)

qiskit_optimization/translators/gurobipy.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This code is part of a Qiskit project.
22
#
3-
# (C) Copyright IBM 2021, 2023.
3+
# (C) Copyright IBM 2021, 2024.
44
#
55
# This code is licensed under the Apache License, Version 2.0. You may
66
# obtain a copy of this license in the LICENSE.txt file in the root directory
@@ -33,6 +33,20 @@ class Model: # type: ignore
3333

3434
pass
3535

36+
class LinExpr: # type: ignore
37+
"""Empty LinExpr class
38+
Replacement if gurobipy.LinExpr is not present.
39+
"""
40+
41+
pass
42+
43+
class QuadExpr: # type: ignore
44+
"""Empty QuadExpr class
45+
Replacement if gurobipy.QuadExpr is not present.
46+
"""
47+
48+
pass
49+
3650

3751
@_optionals.HAS_GUROBIPY.require_in_call
3852
def to_gurobipy(quadratic_program: QuadraticProgram) -> Model:

0 commit comments

Comments
 (0)