-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* * Amended the runtime clients for the new QAOA runtime. * * More flexible provider.run interface. * * Spelling. * * Args consistency error. * * Spelling. * * Updated tests to function with the new QAOA client. * * Refactor. * * Fix text. * Update qiskit_optimization/runtime/qaoa_client.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * * Expose options to users. * Update qiskit_optimization/runtime/vqe_client.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * * Docstring and error message. * * Fix refactor bugs. * * removed _send_job. * * Added the runtime tutorial. * * Tutorial. * * Tutorial * fix spell and do not run tutorial * * Removed the results inputs. * * Black NB * * Tutorial name and title consistency. * * Properties. * * Consistency. * * Update to tutorial. * * Reno. * * RNG initial point and spelling. * more detailed reno * Apply suggestions from code review Co-authored-by: Julien Gacon <gaconju@gmail.com> * * Reverted rng seed. * * Test on reps. * * rng, docs, alpha check. * * Init point doc. Co-authored-by: Manoel Marques <Manoel.Marques@ibm.com> Co-authored-by: Julien Gacon <gaconju@gmail.com>
- Loading branch information
1 parent
2a46fcd
commit 68e197d
Showing
10 changed files
with
922 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
releasenotes/notes/qaoa-runtime-client-afa2453fc325d9bd.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
features: | ||
- | | ||
Added the runtime client :class:`~qiskit_optimization.runtime.QAOAClient` to execute the | ||
QAOA algorithm on Qiskit runtime. This runtime program leverages QAOA dedicated transpiler | ||
passes such as swap strategies and pulse-efficient transpiler passes for cross-resonance based hardware. | ||
Both these optimizations can significantly reduce circuit depth and improve execution time and | ||
results. | ||
Further, the QAOA runtime also allows using CVaR expectation values, which can improve the | ||
performance of ground state calculations in optimization settings. | ||
The client can for instance be used as | ||
.. code-block:: python | ||
from qiskit import IBMQ | ||
from qiskit.algorithms.optimizers import COBYLA | ||
from qiskit.opflow import I, Z | ||
from qiskit_optimization.runtime import QAOAClient | ||
# get the provider and backend we use to run the program | ||
IBMQ.load_account() | ||
provider = IBMQ.get_provider(hub="ibm-q", group="open", project="main") | ||
backend = provider.get_backend("ibmq_qasm_simulator") | ||
# define diagonal Hamiltonian whose minimum eigenvalue we want to find | ||
op = (Z ^ Z ^ I ^ I ^ I) - (I ^ I ^ Z ^ Z ^ I) | ||
# set up the client and solve the problem | ||
client = QAOAClient( | ||
reps=2, # use p=2 repetitions in the QAOA ansatz | ||
optimizer=COBYLA(), | ||
alpha=0.75, # use CVaR expectation with 75% of the best readouts | ||
provider=provider, | ||
backend=backend | ||
) | ||
result = client.compute_minimum_eigenvalue(op) | ||
See also the new QAOA Runtime tutorial in ``docs/tutorials/12_qaoa_runtime.ipynb`` for more | ||
details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.