I have used the Qiskit-based QAOA function to solve a combinatorial problem tsp, and I want to append a circuit after the QAOA layer, is there any way to do that?
-
$\begingroup$ Do you mean to use output of QAOA in another circuit? $\endgroup$– Martin VeselyMay 15 at 20:04
-
$\begingroup$ i meant that i have a circuit that i want to append after QAOA, but the problem is QAOA is implemented in the form of using a qiskit function, is there any way to append the layer after qaoa ? $\endgroup$– Affan HussainMay 16 at 22:43
1 Answer
The anstaz used by QAOA is QAOAAnsatz, a circuit from the circuit library. Now QAOA is a simple subclass of SamplingVQE (or the now deprecated version of VQE if you are still using the also now deprecated QAOA that uses a QuantumInstance) that sets up this specific ansatz to use. But you can take that library circuit and append/compose onto it and pass the resulting circuit as the ansatz to SamplingVQE/VQE - assuming you want to use that during the optimization process. Since using QAOAAnsatz, as the ansatz with SamplingVQE/VQE, nets out to be the same as using QAOA.