Skip to content

Commit

Permalink
update main example in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nulinspiratie committed Oct 15, 2024
1 parent 332d69f commit c1364d0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ from qm import qua
# Create a root-level QuAM instance
machine = BasicQuAM()

# Add an OPX output channel
channel = SingleChannel(opx_output=("con1", 1))
machine.channels["output"] = channel
# Add a qubit connected to an OPX output channel
qubit = SingleChannel(opx_output=("con1", 1))
machine.channels["qubit"] = qubit

# Add a Gaussian pulse to the channel
channel.operations["gaussian"] = pulses.GaussianPulse(
qubit.operations["gaussian"] = pulses.GaussianPulse(
length=100, # Pulse length in ns
amplitude=0.5, # Peak amplitude of Gaussian pulse
sigma=20, # Standard deviation of Guassian pulse
)

# Play the Gaussian pulse on the channel within a QUA program
with qua.program() as prog:
channel.play("gaussian")
qubit.play("gaussian")

# Generate the QUA configuration from QuAM
qua_configuration = machine.generate_config()
Expand Down
21 changes: 10 additions & 11 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,29 @@ QuAM is not just a tool but a gateway to streamlined and efficient quantum compu
- **State Management:** Effortlessly save and load your QuAM state, enabling consistent results and reproducibility in experiments.

```python
from quam.components import *
from quam.components import BasicQuAM, SingleChannel, pulses
from qm import qua

# Create a root-level QuAM instance
machine = BasicQuAM()

# Add an OPX output channel
channel = SingleChannel(opx_output=("con1", 1))
machine.channels["output"] = channel
# Add a qubit connected to an OPX output channel
qubit = SingleChannel(opx_output=("con1", 1))
machine.channels["qubit"] = qubit

# Add a Gaussian pulse to the channel
channel.operations["gaussian"] = pulses.GaussianPulse(
length=100, amplitude=0.5, sigma=20
qubit.operations["gaussian"] = pulses.GaussianPulse(
length=100, # Pulse length in ns
amplitude=0.5, # Peak amplitude of Gaussian pulse
sigma=20, # Standard deviation of Guassian pulse
)

# Play the Gaussian pulse within a QUA program
# Play the Gaussian pulse on the channel within a QUA program
with qua.program() as prog:
channel.play("gaussian")
qubit.play("gaussian")

# Generate the QUA configuration from QuAM
qua_configuration = machine.generate_config()

# Save QuAM to a JSON file
machine.save("state.json")
```
</div>

Expand Down

0 comments on commit c1364d0

Please sign in to comment.