diff --git a/README.md b/README.md index 9c38d52..8f963a2 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ quantum programs with a simplified syntax and run the programs on the service. I model programming paradigm that is also used in the Amazon Braket SDK. First, import the following modules and functions: -``` +```python import autoqasm as aq from autoqasm.instructions import h, cnot, measure ``` @@ -66,7 +66,7 @@ This allows AutoQASM to hook into the program definition and generate an output by quantum devices. For instance, we can create a Bell state like so: -``` +```python # A program that generates a maximally entangled state @aq.main def bell_state(): @@ -79,7 +79,7 @@ You can view the output format, which is OpenQASM, by running `bell_state.build( AutoQASM enables users to use more complicated program constructs with a compact and readable structure. We can demonstrate this with a program that conditionally prepares multiple Bell states on qubit pairs (1, 2) and (3, 4). -``` +```python @aq.main(num_qubits=5) def conditional_multi_bell_states() -> None: h(0) @@ -99,7 +99,7 @@ them out! AutoQASM includes a simulator which can be accessed using the Amazon Braket local simulator interface. Let's simulate the `conditional_multi_bell_states` program: -``` +```python from braket.devices import LocalSimulator device = LocalSimulator("autoqasm")