Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint #620

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading