I want to use a parameterized quantum-circuit which is $\text{CNOT}$ with another quantum-circuit that has no parameters, then after a series of gates on the second quantum-circuit, I want to measure and give it to the estimator and optimizer for VQE.

I have made a parameterized circuit and used it with a Hamiltonian containing constraint, but as soon as I add a non-parameterized circuit, I face two problems:

  1. How to give the measured set of qubits to the estimator?
  2. How to use VQE with or without generate_preset_pass_manager?
  • 2
    $\begingroup$ The Estimator expects the same number of qubits in the circuit as in the operator. If that is not the case, as I infer from this How to give the measured set of qubits to the estimator you would have to do something custom and use SamplerV2 which returns counts and compute the expectation yourself. $\endgroup$
    – Steve Wood
    Apr 4 at 15:18
  • $\begingroup$ @SteveWood Yes, exactly this is what I am looking for. Can we do custom for VQE in qiskit? $\endgroup$ Apr 7 at 14:12


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.