f826413f09e5a54ceb58939fc24351bef0fbd2e9,qiskit/optimization/converters/linear_equality_to_penalty.py,LinearEqualityToPenalty,interpret,#LinearEqualityToPenalty#Any#,163

Before Change


            substitute_dict[variables[i].name] = float(result.x[i])
        substituted_qp = self._src.substitute_variables(substitute_dict)

        new_result = copy.deepcopy(result)
        new_result.x = result.x

        // Set the new function value
        new_result.fval = substituted_qp.objective.constant

        // Set the new status of optimization result
        if substituted_qp.status == QuadraticProgramStatus.VALID:
            new_result.status = OptimizationResultStatus.SUCCESS
        else:
            new_result.status = OptimizationResultStatus.INFEASIBLE

        return new_result

    @property
    def penalty(self) -> Optional[float]:
        Returns the penalty factor used in conversion.

After Change


        else:
            new_status = OptimizationResultStatus.INFEASIBLE

        return OptimizationResult(x=result.x, fval=substituted_qp.objective.constant,
                                  variables=result.variables, raw_results=result.raw_results,
                                  status=new_status)

    @property
    def penalty(self) -> Optional[float]:
        Returns the penalty factor used in conversion.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: Qiskit/qiskit-aqua
Commit Name: f826413f09e5a54ceb58939fc24351bef0fbd2e9
Time: 2020-08-04
Author: 31178928+t-imamichi@users.noreply.github.com
File Name: qiskit/optimization/converters/linear_equality_to_penalty.py
Class Name: LinearEqualityToPenalty
Method Name: interpret


Project Name: Qiskit/qiskit-aqua
Commit Name: f826413f09e5a54ceb58939fc24351bef0fbd2e9
Time: 2020-08-04
Author: 31178928+t-imamichi@users.noreply.github.com
File Name: qiskit/optimization/converters/linear_equality_to_penalty.py
Class Name: LinearEqualityToPenalty
Method Name: interpret


Project Name: Qiskit/qiskit-aqua
Commit Name: f826413f09e5a54ceb58939fc24351bef0fbd2e9
Time: 2020-08-04
Author: 31178928+t-imamichi@users.noreply.github.com
File Name: qiskit/optimization/converters/inequality_to_equality.py
Class Name: InequalityToEquality
Method Name: interpret


Project Name: Qiskit/qiskit-aqua
Commit Name: f826413f09e5a54ceb58939fc24351bef0fbd2e9
Time: 2020-08-04
Author: 31178928+t-imamichi@users.noreply.github.com
File Name: qiskit/optimization/converters/integer_to_binary.py
Class Name: IntegerToBinary
Method Name: interpret