diff --git a/README.md b/README.md index 0484351..617db7c 100644 --- a/README.md +++ b/README.md @@ -96,13 +96,13 @@ AutoQASM can support subroutines and complex control flow. You can use the Pytho and quantum runtime side-by-side. There are rough edges at the moment, but we're actively smoothing them out! -The Amazon Braket local simulator supports AutoQASM programs as input. +AutoQASM includes a simulator which can be accessed using the Amazon Braket local simulator interface. Let's simulate the `conditional_multi_bell_states` program: ``` from braket.devices.local_simulator import LocalSimulator -device = LocalSimulator() +device = LocalSimulator("autoqasm") task = device.run(conditional_multi_bell_states, shots=100) result = task.result() ``` diff --git a/examples/1_Getting_started_with_AutoQASM.ipynb b/examples/1_Getting_started_with_AutoQASM.ipynb index e33d5b7..962db45 100644 --- a/examples/1_Getting_started_with_AutoQASM.ipynb +++ b/examples/1_Getting_started_with_AutoQASM.ipynb @@ -108,7 +108,7 @@ } ], "source": [ - "device = LocalSimulator()\n", + "device = LocalSimulator(\"autoqasm\")\n", "result = device.run(bell_state, shots=100).result()\n", "counts = Counter(result.measurements[\"return_value\"])\n", "print(\"measurement counts: \", counts)" diff --git a/examples/2_Expressing_classical_control_flow.ipynb b/examples/2_Expressing_classical_control_flow.ipynb index d4c5694..5f2726c 100644 --- a/examples/2_Expressing_classical_control_flow.ipynb +++ b/examples/2_Expressing_classical_control_flow.ipynb @@ -167,7 +167,7 @@ } ], "source": [ - "device = LocalSimulator()\n", + "device = LocalSimulator(\"autoqasm\")\n", "result = device.run(conditioned_bell, shots=500).result()\n", "counts = Counter(result.measurements[\"return_value\"])\n", "print(\"measurement counts: \", counts)\n", diff --git a/examples/3_1_Iterative_phase_estimation.ipynb b/examples/3_1_Iterative_phase_estimation.ipynb index 57ea403..72a5b2b 100644 --- a/examples/3_1_Iterative_phase_estimation.ipynb +++ b/examples/3_1_Iterative_phase_estimation.ipynb @@ -158,7 +158,7 @@ } ], "source": [ - "device = LocalSimulator()\n", + "device = LocalSimulator(\"autoqasm\")\n", "result = device.run(ipe, shots=100).result()\n", "counts = Counter(result.measurements[\"b0\"])\n", "print(\"measurement counts: \", counts)\n", diff --git a/examples/3_2_magic_state_distillation.ipynb b/examples/3_2_magic_state_distillation.ipynb index 0612f3e..dfed335 100644 --- a/examples/3_2_magic_state_distillation.ipynb +++ b/examples/3_2_magic_state_distillation.ipynb @@ -175,7 +175,7 @@ ], "source": [ "# Get measurement result\n", - "result = LocalSimulator().run(gate_teleportation, shots=100).result()\n", + "result = LocalSimulator(\"autoqasm\").run(gate_teleportation, shots=100).result()\n", "counts = Counter(result.measurements[\"return_value\"])\n", "print(\"measurement counts: \", counts)\n", "\n", @@ -315,7 +315,7 @@ ], "source": [ "n_shots = 1000\n", - "result = LocalSimulator().run(distillation, shots=n_shots).result()\n", + "result = LocalSimulator(\"autoqasm\").run(distillation, shots=n_shots).result()\n", "counts = Counter(result.measurements[\"c\"])\n", "print(\"measurement counts: \", counts)" ] @@ -435,7 +435,7 @@ } ], "source": [ - "result = LocalSimulator().run(distillation_rus, shots=20).result()\n", + "result = LocalSimulator(\"autoqasm\").run(distillation_rus, shots=20).result()\n", "counts = Counter(result.measurements[\"c2\"])\n", "probs = {str(k): v / sum(counts.values()) for k, v in counts.items()}\n", "\n", diff --git a/setup.py b/setup.py index e45b277..0cafbff 100644 --- a/setup.py +++ b/setup.py @@ -57,6 +57,11 @@ "tox", ], }, + entry_points={ + "braket.simulators": [ + "autoqasm = autoqasm.simulator.simulator:McmSimulator", + ] + }, include_package_data=True, url="https://github.com/amazon-braket/autoqasm", author="Amazon Web Services", diff --git a/src/autoqasm/simulator/simulator.py b/src/autoqasm/simulator/simulator.py index d9be8ab..d823648 100644 --- a/src/autoqasm/simulator/simulator.py +++ b/src/autoqasm/simulator/simulator.py @@ -23,7 +23,7 @@ class McmSimulator(StateVectorSimulator): - DEVICE_ID = "autoqasm_mcm" + DEVICE_ID = "autoqasm" def initialize_simulation(self, **kwargs) -> Simulation: """