Skip to content

Commit

Permalink
Fix lint (#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-imamichi authored May 17, 2024
1 parent 5d20d2e commit c190367
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .pylintdict
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ leq
lhs
lin
linearconstraint
linexpr
lowerbound
lp
lucas
Expand Down Expand Up @@ -174,6 +175,7 @@ qn
qp
qrac
qrao
quadexpr
quadratically
quadraticconstraint
quadraticobjective
Expand Down
4 changes: 3 additions & 1 deletion qiskit_optimization/algorithms/grover_optimizer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of a Qiskit project.
#
# (C) Copyright IBM 2020, 2023.
# (C) Copyright IBM 2020, 2024.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
Expand Down Expand Up @@ -165,6 +165,8 @@ def solve(self, problem: QuadraticProgram) -> OptimizationResult:
# Variables for result object.
operation_count = {}
iteration = 0
samples = None
raw_samples = None

# Variables for stopping if we've hit the rotation max.
rotations = 0
Expand Down
2 changes: 1 addition & 1 deletion qiskit_optimization/algorithms/qrao/magic_rounding.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def _make_circuits(
qc = circuit.compose(_z_to_31p_qrac_basis_circuit(basis).inverse(), inplace=False)
elif vars_per_qubit == 2:
qc = circuit.compose(_z_to_21p_qrac_basis_circuit(basis).inverse(), inplace=False)
elif vars_per_qubit == 1:
else:
qc = circuit.copy()
qc.measure_all()
circuits.append(qc)
Expand Down
16 changes: 15 additions & 1 deletion qiskit_optimization/translators/gurobipy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of a Qiskit project.
#
# (C) Copyright IBM 2021, 2023.
# (C) Copyright IBM 2021, 2024.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
Expand Down Expand Up @@ -33,6 +33,20 @@ class Model: # type: ignore

pass

class LinExpr: # type: ignore
"""Empty LinExpr class
Replacement if gurobipy.LinExpr is not present.
"""

pass

class QuadExpr: # type: ignore
"""Empty QuadExpr class
Replacement if gurobipy.QuadExpr is not present.
"""

pass


@_optionals.HAS_GUROBIPY.require_in_call
def to_gurobipy(quadratic_program: QuadraticProgram) -> Model:
Expand Down

0 comments on commit c190367

Please sign in to comment.