Skip to content

Commit

Permalink
documentation: add .build() call on examples of displaying MainProgra…
Browse files Browse the repository at this point in the history
…m instances (#24)

Co-authored-by: Ryan Shaffer <[email protected]>
  • Loading branch information
potatoboiler and rmshaffer authored Jun 5, 2024
1 parent 62ab4c5 commit aebde14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def bell_state():
cnot(0, 1)
```

You can view the output format, which is OpenQASM, by running `bell_state.display()`.
You can view the output format, which is OpenQASM, by running `bell_state.build().display()`.

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
Expand Down
4 changes: 2 additions & 2 deletions doc/decorators.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ def ghz_state():
device.run(ghz_state)
```

When you run your quantum program, the Amazon Braket SDK automatically serializes the program to OpenQASM before sending it to the local simulator or the Amazon Braket service. In AutoQASM, you can optionally view the OpenQASM script of your quantum program before submitting to a device by calling `display()` on the `Program` object.
When you run your quantum program, the Amazon Braket SDK automatically serializes the program to OpenQASM before sending it to the local simulator or the Amazon Braket service. In AutoQASM, you can optionally view the OpenQASM script of your quantum program before submitting to a device by calling `build()` on the MainProgram object, and calling `display()` on the resulting `Program` object.

```
ghz_state.display()
ghz_state.build().display()
```

## `@aq.subroutine`
Expand Down

0 comments on commit aebde14

Please sign in to comment.