We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@LenaPer found that the code example is not working as expected in the https://docs.quantum.ibm.com/run/run-jobs-in-session#run-two-vqe-algorithms-in-a-session-by-using-threading section. @jyu00 has provided updated code:
from concurrent.futures import ThreadPoolExecutor from qiskit_ibm_runtime import EstimatorV2 as Estimator def minimize_thread(estimator, method): return minimize(cost_func, x0, args=(ansatz, hamiltonian, estimator), method=method) with Session(backend=backend), ThreadPoolExecutor() as executor: estimator1 = Estimator() estimator2 = Estimator() # Use different tags to differentiate the jobs. estimator1.options.environment.job_tags = ["cobyla"] estimator2.options.environment.job_tags = ["nelder-mead"] # Submit the two workloads. cobyla_future = executor.submit(minimize_thread, estimator1, "cobyla") nelder_mead_future = executor.submit(minimize_thread, estimator2, "nelder-mead") # Get workload results. cobyla_result = cobyla_future.result() nelder_mead_result = nelder_mead_future.result()
The text was updated successfully, but these errors were encountered:
Update broken threading code in Run-jobs-in-session (#1571)
23f7b0b
Closes #1568
Update broken threading code in Run-jobs-in-session (Qiskit#1571)
1791639
Closes Qiskit#1568
Successfully merging a pull request may close this issue.
@LenaPer found that the code example is not working as expected in the https://docs.quantum.ibm.com/run/run-jobs-in-session#run-two-vqe-algorithms-in-a-session-by-using-threading section. @jyu00 has provided updated code:
The text was updated successfully, but these errors were encountered: