Skip to content

Commit

Permalink
Deprecate AWSBraket_ for standardized classes (#165)
Browse files Browse the repository at this point in the history
Deprecates AWSBraketProvider and AWSBraketBackend for BraketProvider and BraketAwsBackend respectively
  • Loading branch information
speller26 authored Mar 6, 2024
1 parent e62177d commit e0f89d0
Show file tree
Hide file tree
Showing 10 changed files with 458 additions and 232 deletions.
216 changes: 126 additions & 90 deletions docs/tutorials/0_tutorial_qiskit-braket-provider_overview.ipynb

Large diffs are not rendered by default.

61 changes: 37 additions & 24 deletions docs/tutorials/1_tutorial_vqe.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"id": "ebac1b5c",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-03-06T05:50:24.799348Z",
"start_time": "2024-03-06T05:50:23.124683Z"
}
},
"outputs": [],
"source": [
"from qiskit.circuit.library import TwoLocal\n",
Expand All @@ -39,7 +44,7 @@
"from qiskit_algorithms.optimizers import SLSQP\n",
"from qiskit_algorithms.utils import algorithm_globals\n",
"\n",
"from qiskit_braket_provider import AWSBraketProvider, BraketLocalBackend\n",
"from qiskit_braket_provider import BraketLocalBackend, BraketProvider\n",
"\n",
"seed = 50\n",
"algorithm_globals.random_seed = seed"
Expand All @@ -55,23 +60,26 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"id": "e94c63b1",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-03-06T05:50:24.889207Z",
"start_time": "2024-03-06T05:50:24.800625Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
"BraketBackend[default]"
]
"text/plain": "BraketBackend[default]"
},
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"provider = AWSBraketProvider()\n",
"provider = BraketProvider()\n",
"local_simulator = BraketLocalBackend()\n",
"local_simulator"
]
Expand All @@ -90,32 +98,37 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"id": "9081f3b3",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-03-06T05:50:25.245606Z",
"start_time": "2024-03-06T05:50:24.889913Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{ 'aux_operators_evaluated': None,\n",
" 'cost_function_evals': 9,\n",
" 'eigenvalue': -1.0522310440132328,\n",
" 'optimal_circuit': <qiskit.circuit.library.n_local.two_local.TwoLocal object at 0x17af130d0>,\n",
" 'optimal_parameters': { ParameterVectorElement(θ[1]): 4.19301252102391,\n",
" ParameterVectorElement(θ[0]): 3.611860069224077,\n",
" ParameterVectorElement(θ[2]): 0.6019852007557844,\n",
" ParameterVectorElement(θ[6]): -5.466043598406607,\n",
" ParameterVectorElement(θ[7]): 0.6984088030463615,\n",
" ParameterVectorElement(θ[3]): 5.949536809130025,\n",
" 'eigenvalue': -1.090030662389807,\n",
" 'optimal_circuit': <qiskit.circuit.library.n_local.two_local.TwoLocal object at 0x168f412d0>,\n",
" 'optimal_parameters': { ParameterVectorElement(θ[0]): 3.6118600692240777,\n",
" ParameterVectorElement(θ[1]): 4.19301252102391,\n",
" ParameterVectorElement(θ[2]): 0.6019852007557841,\n",
" ParameterVectorElement(θ[4]): -3.3070470445355764,\n",
" ParameterVectorElement(θ[5]): 1.8462931831829383},\n",
" ParameterVectorElement(θ[5]): 1.846293183182938,\n",
" ParameterVectorElement(θ[3]): 5.949536809130025,\n",
" ParameterVectorElement(θ[6]): -5.466043598406607,\n",
" ParameterVectorElement(θ[7]): 0.6984088030463612},\n",
" 'optimal_point': array([ 3.61186007, 4.19301252, 0.6019852 , 5.94953681, -3.30704704,\n",
" 1.84629318, -5.4660436 , 0.6984088 ]),\n",
" 'optimal_value': -1.0522310440132328,\n",
" 'optimal_value': -1.090030662389807,\n",
" 'optimizer_evals': None,\n",
" 'optimizer_result': <qiskit_algorithms.optimizers.optimizer.OptimizerResult object at 0x12411d700>,\n",
" 'optimizer_time': 0.6713869571685791}\n"
" 'optimizer_result': <qiskit_algorithms.optimizers.optimizer.OptimizerResult object at 0x10932cb80>,\n",
" 'optimizer_time': 0.3481462001800537}\n"
]
}
],
Expand Down
Loading

0 comments on commit e0f89d0

Please sign in to comment.