@@ -0,0 +1,927 @@
+# Copied from: https://gist.github.com/ismaelfaro/2f9351259bb8107db0d06d774109b2b8%0A# example to solve a quadratic problem using a Quantum optimization algorithm%0A%0Afrom qiskit.optimization import QuadraticProgram%0Afrom qiskit.optimization.algorithms import GroverOptimizer%0A%0Afrom qiskit import Aer%0A%0Afrom docplex.mp.model import Model%0A%0A# construct problem with DOcplex%0Amodel = Model('docplex_model')%0Ax, y = model.binary_var_list(2)%0Amodel.maximize(x*y + x + y)%0A%0A# convert DOcplex model to Qiskit Quadratic Program%0Aqp = QuadraticProgram()%0Aqp.from_docplex(model)%0A%0A# define a Quantum backend on which to run the optimization%0A# a Qiskit simulator in this case%0Abackend = Aer.get_backend('statevector_simulator')%0A%0A# use the Grover Adaptive Search (GAS) to solve the optimization problem%0Agrover = GroverOptimizer(num_value_qubits=3, quantum_instance=backend)%0Aresult = grover.solve(qp)%0A%0A# printing results: x=%5B1.0,1.0%5D, fval=3%0Aprint(result)%0A

Add qiskit_optimization_module.py.