Skip to content

Commit

Permalink
docs: went through all docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nulinspiratie committed May 6, 2024
1 parent 23368cd commit 72d47c7
Show file tree
Hide file tree
Showing 14 changed files with 80 additions and 639 deletions.
3 changes: 3 additions & 0 deletions docs/API_references/components/basic_quam_API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# BasicQuAM API

::: quam.components.basic_quam
2 changes: 1 addition & 1 deletion docs/API_references/components/pulses_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Welcome to the QuAM Pulses API Documentation.
The QuAM Pulses module offers a versatile framework for creating and controlling pulse schemes essential for quantum operations.
Information can be found in [QuAM Pulses Documentation](components/pulses) in the User Guide.
Information can be found in [QuAM Pulses Documentation](/components/pulses) in the User Guide.

This section provides detailed API references for various pulse types—ranging from simple waveforms to complex modulated pulses—tailored for precise quantum state manipulation and measurement. Explore the properties, methods, and examples to effectively integrate these pulse components into your quantum experiments.

Expand Down
13 changes: 8 additions & 5 deletions docs/API_references/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@ Welcome to the API Reference section of the Quantum Abstract Machine (QuAM) docu

## Quick Links

- [**Core Components**](/API_references/core/quam_classes_API.md)
- [**Core Components**](/API_references/core/quam_classes_API)
Details on fundamental building blocks like [QuamBase][quam.core.quam_classes.QuamBase], [QuamComponent][quam.core.quam_classes.QuamComponent] and [QuamRoot][quam.core.quam_classes.QuamRoot].
[QuamBase][quam.core.quam_classes.QuamBase]

- [**Channel Components**](/API_references/components/channels_API.md)
- [**Channel Components**](/API_references/components/channels_API)
Learn about channel configurations and their operations within the QuAM framework.

- [**Pulse Components**](/API_references/components/pulses_API.md)
- [**Pulse Components**](/API_references/components/pulses_API)
A detailed look at various pulse types and their properties used in quantum operations.

- [**Hardware Components**](/API_references/components/hardware_API.md)
- [**Hardware Components**](/API_references/components/hardware_API)
Explore the hardware-related classes such as [Mixer][quam.components.hardware.Mixer], [LocalOscillator][quam.components.hardware.LocalOscillator], and [FrequencyConverter][quam.components.hardware.FrequencyConverter].

- [**Octave Components**](/API_references/components/octave_API.md)
- [**Octave Components**](/API_references/components/octave_API)
Documentation on the `Octave` component and its associated up and down converters.

- [**BasicQuAM Class**](/API_references/components/basic_quam_API)
Details on the `BasicQuAM` class, the root-level QuAM instance that serves as the entry point for QuAM configurations.
6 changes: 3 additions & 3 deletions docs/components/channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ IQ_channel = IQChannel(

### DC Offset
Each analog channel can have a specified DC offset that remains for the duration of the QUA program.
This can be set through `SingleChannel.opx_output_offset` for the `SingleChannel`, and through `IQChannel.opx_output_offset_I` and `IQChannel.opx_output_offset_Q` for the `IQChannel`.
This can be set through `SingleChannel.opx_output_offset` for the [SingleChannel][quam.components.channels.SingleChannel], and through `IQChannel.opx_output_offset_I` and `IQChannel.opx_output_offset_Q` for the [IQChannel][quam.components.channels.IQChannel].

Note that if multiple channels are attached to the same OPX output port(s), they may not have different output offsets.
This raises a warning and chooses the DC offset of the last channel.
Expand Down Expand Up @@ -86,7 +86,7 @@ IQ_channel = IQChannel(

Integrated frequency conversion systems such as [QM's Octave](https://docs.quantum-machines.co/1.1.7/qm-qua-sdk/docs/Hardware/octave/) usually have additional features such as auto-calibration.
For this reason they have a specialized frequency converter such as the [OctaveUpConverter][quam.components.octave.OctaveUpConverter].
See the [octave][] documentation for details.
See the [QuAM Octave Documentation][octave] documentation for details.


### Analog Pulses
Expand All @@ -110,7 +110,7 @@ with program() as prog:
```
[Channel.play()][quam.components.channels.Channel.play] is a light wrapper around [qm.qua.play()](https://docs.quantum-machines.co/latest/qm-qua-sdk/docs/Introduction/qua_overview/?h=play#play-statement) to attach it to the channel.

Details on pulses in quam can be found at [pulses][].
Details on pulses in QuAM can be found at the [Pulses Documentation][pulses].

## Analog Output + Input Channels
Aside from sending signals to the quantum hardware, data is usually also received back, and subsequently read out through the hardware's input ports.
Expand Down
2 changes: 0 additions & 2 deletions docs/components/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@ The Octave component in QuAM handles the upconversion and downconversion of freq
For users looking to expand beyond the standard QuAM toolkit, custom components provide a way to introduce novel functionalities tailored to specific quantum computing needs or experimental setups.

- **[Custom QuAM Components](/components/custom-components)**: Get guidance on how to develop and integrate your own custom components into the QuAM framework.

Each component is designed with modularity and integration in mind, ensuring that users can build and customize their quantum computing environments effectively. For more detailed instructions and examples, visit the individual documentation pages linked above.
28 changes: 14 additions & 14 deletions docs/components/pulses.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Users can supplement these common pulses with their own custom pulses by subclas


## Usage
To implement pulses in a QuAM program, you first need to register them to a specific channel. Here's how to set up a channel and register a square pulse for an operation labeled "X180":
To implement pulses in a QuAM program, you first need to register them to a specific channel. Here's how to set up a channel and register a square pulse for an operation labeled `"X180"`:

```python
from quam.components import pulses, SingleChannel
Expand All @@ -29,10 +29,10 @@ from quam.components import pulses, SingleChannel
channel = SingleChannel(opx_output=("con1", 1))

# Register a square pulse with a duration of 1000 units and amplitude of 0.5
channel.operations["X180"] = pulses.SquarePulse(duration=1000, amplitude=0.5)```
channel.operations["X180"] = pulses.SquarePulse(duration=1000, amplitude=0.5)
```

After registering a pulse, you can utilize it in a QuAM program. Below is a simple example where the "X180" pulse is played:
After registering a pulse, you can utilize it in a QuAM program. Below is a simple example where the `"X180"` pulse is played:

```python
from qm.qua import program
Expand Down Expand Up @@ -68,34 +68,34 @@ with program() as prog:
## Creating Custom Pulses
To create custom pulses in QuAM, you can extend the functionality of the Pulse class by subclassing it and defining your own waveform generation logic. This allows for precise control over the pulse characteristics.

### Example: Creating a Triangular Pulse
To illustrate, let's create a triangular pulse. This involves subclassing the Pulse class from the QuAM library and defining specific parameters and the waveform function.
### Example: Creating a Ramp Pulse
To illustrate, let's create a pulse that ramps in amplitude. This involves subclassing the Pulse class from the QuAM library and defining specific parameters and the waveform function.

```python
import numpy as np
from quam.core import quam_dataclass
from quam.components import pulses

@quam_dataclass
class TriangularPulse(pulses.Pulse):
# Define the starting and stopping amplitudes for the triangular pulse
class RampPulse(pulses.Pulse):
# Define the starting and stopping amplitudes for the ramp pulse
amplitude_start: float
amplitude_stop: float

def waveform_function(self) -> np.ndarray:
# This function generates a linearly spaced array to form a triangular waveform
# This function generates a linearly spaced array to form a ramp waveform
return np.linspace(self.amplitude_start, self.amplitude_stop, self.length)
```
Ensure this code is saved in a properly structured Python module within your project so that it can be imported as needed. For details on organizing custom components, refer to the [Custom QuAM Components](/components/custom-components) section of the QuAM documentation

### Extending to Readout Pulses
To create a readout pulse derived from a control pulse, subclass both the specific control pulse and the [ReadoutPulse][quam.components.pulses.ReadoutPulse] class. Below is an example of how to adapt the Triangular Pulse into a readout pulse.
To create a readout pulse derived from a control pulse, subclass both the specific control pulse and the [ReadoutPulse][quam.components.pulses.ReadoutPulse] class. Below is an example of how to adapt the RampPulse into a readout pulse.

```python
@quam_dataclass
class TriangularReadoutPulse(pulses.ReadoutPulse, TriangularPulse):
"""Extend TriangularPulse to include readout-specific functionality."""
# No additional fields needed; inherits all from TriangularPulse and ReadoutPulse
class RampReadoutPulse(pulses.ReadoutPulse, RampPulse):
"""Extend RampPulse to include readout-specific functionality."""
# No additional fields needed; inherits all from RampPulse and ReadoutPulse
pass
```
Readout pulses utilize additional parameters for integration weights which are crucial for signal processing:
Expand All @@ -105,7 +105,7 @@ Readout pulses utilize additional parameters for integration weights which are c

These two parameters are used to calculate the readout pulse's integration weights (`sine`, `-sine` and `cosine`), which are essential for signal processing in readout operations.

These parameters are typically used to manage the integration weights (`sine`, `-sine`, and `cosine`) for the readout operations. By default, these weights assume a fixed angle. If variable angles are needed, subclass the BaseReadoutPulse class and override the integration_weights_function() to customize this behavior.
These parameters are typically used to manage the integration weights (`sine`, `-sine`, and `cosine`) for the readout operations. By default, these weights assume a fixed angle. If variable angles are needed, subclass the [BaseReadoutPulse][quam.components.pulses.BaseReadoutPulse] class and override the `integration_weights_function()` to customize this behavior.

This approach ensures your custom pulse configurations are both flexible and compatible with the broader QuAM framework.

Expand All @@ -127,7 +127,7 @@ In the QUA configuration, pulses are decomposed into multiple components, such a
Conversely, QuAM adopts a parametrized approach that encapsulates all pulse characteristics within a single class, aiming to simplify pulse definition and manipulation:

- **Parametrized Representation**: Pulses in QuAM are instances of a parametrized class, where the type of pulse and its parameters (such as length and amplitude) are directly defined by the user. This simplifies the initial setup and modification of pulse configurations.
- **Waveform Generation**: These parameters are used to generate the waveform dynamically using the method `[Pulse.generate_waveform()][quam.components.pulses.Pulse.generate_waveform]`. This approach integrates waveform generation within the pulse definition, streamlining the configuration process.
- **Waveform Generation**: These parameters are used to generate the waveform dynamically using the method `waveform_function()`. This approach integrates waveform generation within the pulse definition, streamlining the configuration process.
- **No built-in waveform reuse**: QuAM does not currently support sharing waveforms across pulses, as each pulse is defined independently. This can have implications for memory usage on the OPX. Reusing waveforms in QuAM is planned in a future release.

### Conclusion
Expand Down
3 changes: 2 additions & 1 deletion docs/components/quam-root.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ For more complex setups requiring custom components, you can extend the QuAM roo
### Example of a Custom QuAM Class

```python title="custom_components/quam.py"
from typing import Dict
from quam.core import QuamRoot, quam_dataclass
from quam.components import Octave
from custom_components.qubit import Qubit

@quam_dataclass
class QuAM(QuamRoot):
qubit: Dict[str, Qubit]
qubits: Dict[str, Qubit]
octaves: Dict[str, Octave]
```

Expand Down
Loading

0 comments on commit 72d47c7

Please sign in to comment.