6e9a58b20848646f37fcf24179fc29f28cabda3d,test/optimization/test_converters.py,TestConverters,test_penalize_binary,#TestConverters#,296
Before Change
op2 = conv.convert(op)
self.assertEqual(op2.get_num_linear_constraints(), 0)
result = OptimizationResult(x=np.arange(3), fval=0, variables=op2.variables,
status=OptimizationResultStatus.SUCCESS)
new_result = conv.interpret(result)
self.assertEqual(new_result.status, OptimizationResultStatus.INFEASIBLE)
np.testing.assert_array_almost_equal(new_result.x, np.arange(3))
self.assertListEqual(result.variable_names, ["x0", "x1", "x2"])
self.assertDictEqual(result.variables_dict, {"x0": 0, "x1": 1, "x2": 2})
After Change
op2 = conv.convert(op)
self.assertEqual(op2.get_num_linear_constraints(), 0)
new_x = conv.interpret(np.arange(3))
np.testing.assert_array_almost_equal(new_x, np.arange(3))
def test_penalize_integer(self):
Test PenalizeLinearEqualityConstraints with integer variables
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
Instances
Project Name: Qiskit/qiskit-aqua
Commit Name: 6e9a58b20848646f37fcf24179fc29f28cabda3d
Time: 2020-11-25
Author: 31178928+t-imamichi@users.noreply.github.com
File Name: test/optimization/test_converters.py
Class Name: TestConverters
Method Name: test_penalize_binary
Project Name: Qiskit/qiskit-aqua
Commit Name: 6e9a58b20848646f37fcf24179fc29f28cabda3d
Time: 2020-11-25
Author: 31178928+t-imamichi@users.noreply.github.com
File Name: test/optimization/test_converters.py
Class Name: TestConverters
Method Name: test_inequality_binary
Project Name: Qiskit/qiskit-aqua
Commit Name: 6e9a58b20848646f37fcf24179fc29f28cabda3d
Time: 2020-11-25
Author: 31178928+t-imamichi@users.noreply.github.com
File Name: test/optimization/test_converters.py
Class Name: TestConverters
Method Name: test_inequality_integer