# QUBO defined in Qiskit/DOcplex: how to solve it using Pennylane?

I have a complex Integer Linear Programming model defined in DOcplex/Qiskit representing a combinatorial optimization problem.

Using the Qiskit utils, it is possible to covert it to either an Ising model or Pauli operators.

For a particular reason, I need to use Pennylane’s QAOA to solve the problem. Is there any easy way to convert the Qiskit’s Ising model/Pauli operators output to something that Pennylane “understands”?

I can neither find something in the Pennylane documentation mor can I a find sth. like DOcplex or any other QUBO-related tools in the Pennylane ecosystem.

• Why do you need to use Pennylane? Dec 16, 2021 at 20:55

This is Catalina from Xanadu. I don't think there's a converter as you describe it, but in PennyLane you can load a circuit in Qiskit format. You just create your circuit with qiskit syntax and use qml.load(qc, format='qiskit') to convert it into a PennyLane template. You can then use it within a PennyLane circuit. The example below should help.

import pennylane as qml
from pennylane import numpy as np
import qiskit
from qiskit.circuit import Parameter

qc = qiskit.QuantumCircuit(2)
theta = Parameter("θ")

qc.rx(theta, [0])
qc.cx(0, 1)

my_circuit = qml.load(qc, format='qiskit')

dev = qml.device('default.qubit', wires=2)

@qml.qnode(dev)
def circuit(x):
my_circuit(params={theta: x},wires=(1, 0))
return qml.expval(qml.PauliZ(0))

theta_train = np.array(1.5, requires_grad=True)