{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Algorithm Name\n", "[Brief description of algorithm]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# References \n", "[1] references here with hyperlinkns" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# [Optional] Print the circuits" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Run on a local simulator" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from braket.devices import LocalSimulator\n", "\n", "# Code here\n", "local_simulator = LocalSimulator()\n", "task = local_simulator.run(circuit, shots=100)\n", "result = task.result()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# [Optional] Run on a QPU or Managed Simulator\n", "\n", "[Include estimated price for running in USD using the [cost tracker](https://docs.aws.amazon.com/braket/latest/developerguide/braket-pricing.html#real-time-cost-tracking).]" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "# Use Braket SDK Cost Tracking to estimate the cost to run this example\n", "from braket.tracking import Tracker\n", "\n", "tracker = Tracker().start()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "from braket.aws import AwsDevice\n", "\n", "# Code here\n", "qpu = AwsDevice(\"quantum_arn\")\n", "task = qpu.run(circuit, shots=100)\n", "result = task.result()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[Print the final costs]" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "print(\"Task Summary\")\n", "print(f\"{tracker.quantum_tasks_statistics()} \\n\")\n", "print(f\"Estimated cost to run this example: {tracker.qpu_tasks_cost() + tracker.simulator_tasks_cost():.2f} USD\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note: Charges shown are estimates based on your Amazon Braket simulator and quantum processing unit (QPU) task usage. Estimated charges shown may differ from your actual charges. Estimated charges do not factor in any discounts or credits, and you may experience additional charges based on your use of other services such as Amazon Elastic Compute Cloud (Amazon EC2)." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3.9.5 64-bit ('braket')", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.5" }, "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "5904cb9a2089448a2e1aeb5d493d227c9de33e591d7c07e4016fb81e71061a5d" } } }, "nbformat": 4, "nbformat_minor": 2 }