4
$\begingroup$

I am running an optimization problem whose objective function $F(a)$ requires measuring N variational circuits $V_i(a)$ at each evaluation.

So, roughly, I have created N parametric circuits and I do:

circuits = transpile(parameteric_circuits)

for step in steps:
    values = SomeOptimizer.get_next_values() # a numeric vector
    experiments = []
    for circuit in circuits:
        experiments.append(circuit.bind_parameters(values))
    
    job = backend.run(experiments)

    # and then post-processing ...

After profiling, I noticed, though, that a considerable percentage of execution time (~50%) is wasted assigning the parameters to the circuits and especially copying circuits (built-in deepcopy method).

Given that the whole process can take hours to complete, wasting at least 1/3 of time just copying circuits seems rather strange to me. Is it expected?

Is there a more clever way to save time?

$\endgroup$

0

Your Answer

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