Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add hardware ports and MW-FEM support #44

Merged
merged 35 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
cacb945
Added relevant ports
nulinspiratie Jun 26, 2024
c8ad5bc
generalized ports
nulinspiratie Jun 26, 2024
758edde
cleanup of ports
nulinspiratie Jun 27, 2024
2cb0e40
fix: missing import
nulinspiratie Jun 28, 2024
3f31928
adding ports to channels
nulinspiratie Jun 28, 2024
9c6986d
always create Port when adding in channels
nulinspiratie Jun 28, 2024
5fc369c
Add support for MW FEM
nulinspiratie Jun 28, 2024
1b6bed4
add overwriting warning to ports
nulinspiratie Jun 28, 2024
2166e63
added tests for ports
nulinspiratie Jun 28, 2024
eb2f900
add documentation
nulinspiratie Jun 28, 2024
3295e70
handling of offsets
nulinspiratie Jun 28, 2024
e70a499
MWChannel inherits from Channel
nulinspiratie Jun 30, 2024
849482e
refactoring of ports
nulinspiratie Jun 30, 2024
a5bb6cb
renaming
nulinspiratie Jun 30, 2024
63b1152
move paraemters between classes
nulinspiratie Jun 30, 2024
2edcb0e
rename controller_name -> controller_id
nulinspiratie Jun 30, 2024
8afdd0c
change crosstalk, filters default values
nulinspiratie Jul 1, 2024
0484896
add port tuple, made offset optional
nulinspiratie Jul 1, 2024
823a788
channel tuple fixes
nulinspiratie Jul 1, 2024
7c7c05a
minor fix to channels
nulinspiratie Jul 1, 2024
f4d4e74
fixing tests
nulinspiratie Jul 2, 2024
0dae746
fully working tests
nulinspiratie Jul 2, 2024
d280572
Added channel tests
nulinspiratie Jul 2, 2024
2283238
adding ports containers
nulinspiratie Jul 2, 2024
dfa64b0
clean up ports containers
nulinspiratie Jul 2, 2024
742385b
add porots containers tests
nulinspiratie Jul 3, 2024
514e4e0
test ports containers
nulinspiratie Jul 3, 2024
bae1b09
fixing ports bugs
nulinspiratie Jul 3, 2024
5001015
octave ports
nulinspiratie Jul 3, 2024
bed20b3
Merge remote-tracking branch 'origin/main' into feat/ports
nulinspiratie Jul 3, 2024
b92b626
Merge branch 'fix/json-int-keys-folder' into feat/ports
nulinspiratie Jul 3, 2024
37e602d
Merge branch 'fix/dict-instantiation' into feat/ports
nulinspiratie Jul 3, 2024
e044810
test: fix IQ channels test
nulinspiratie Jul 4, 2024
f28562d
fix: dataclass issue for python > 3.9
nulinspiratie Jul 4, 2024
d1938f2
Merge remote-tracking branch 'origin/main' into feat/ports
nulinspiratie Jul 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Explore detailed documentation and get started with QuAM here: [QuAM Documentati
- **State Management**: Features robust tools for saving and loading your quantum states, promoting reproducibility and consistency.

## Installation
To install QuAM, first ensure you have Python 3.8 installed on your system.
To install QuAM, first ensure you have 3.8 ≤ Python 3.11 installed on your system.
Then run the following command:

```bash
Expand Down
25 changes: 25 additions & 0 deletions docs/components/channel-ports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Channel Ports

In the section [Channels](channels.md), we have seen how to create analog channels and attach digital outputs to them.
In these examples, the ports are defined by the OPX output tuple `(connector, port)`.
However, for more advanced use cases it is instead possible to define the ports using dedicated [Port][quam.components.ports.Port] QuAM components.
This is primarily useful in two situations:

1. Multiple channels are connected to the same physical port, and the user wants to define the port and its properties only once.
2. The user wants to access port-specific properties that cannot directly be accessed through the [Channel][quam.components.channels.Channel]. Examples are the crosstalk, delay, and sampling rate of the port.

## Example: Defining a Port
In this example, we want to use analog output ("con1", 3) of the OPX+ to create a single channel.
We define the port using the [OPXPlusAnalogOutputPort][quam.components.ports.OPXPlusAnalogOutputPort] component, which allows us to set the offset and delay of the port.

```python
from quam.components.ports import OPXPlusAnalogOutputPort
from quam.components import SingleChannel

port = OPXPlusAnalogOutputPort(port=("con1", 3), offset=0.2, delay=12)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit confusing as the term port has a few meanings here, it's both the class name (and therefore the returned type) that contains the offset and delay, and also it's an argument to the class, indicating the controller + port tuple (and FEM in OPX1000 case?)
I can think of several options:

  1. Name it channel - but this collides with the channel below, what is its purpose?
  2. Change the port argument, maybe we can have it physical_port? maybe we can also separate it from the tuple and just have: (controller=1, physical_port=3, offset_0.2,...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah there is some ambiguity here, agreed.

Channel is already reserved for everything in channels.py, they largely overlap with elements in the qua config. The reason I called it channel as opposed to element is that up to now they also implemented the controllers part of the config, so they were a combination of element + controller port. So I don't think channels would be a good name.

We could change the port argument to something else, but I'm not sure physical_port is the right name. The reason I liked using port as an argument is that from the channel's perspective you could say e.g. SingleChannel.opx_output.port.
I think separating it into controller, fem, and physical_port also adds too many parameters.
What about using port_id?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the object Port is actually the physical port + static configuration. Maybe we can keep it just as a port... or port_id as you suggested

I don't think that the existing tuple ('con1', 1, 1) makes a lot of sense, so it's weird to me it'll be the same in QuAM.
Note that at some point, the port tuple might change in QUA (probably separated similar to what I wrote above), so let's make sure we do not depend too strongly on it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah interesting, do you also mean it will be changed in the qua config?
So in ("con1", 2, 3) what are the different parts called?
I also see in your example of where you separate it, you refer to con1 as controller=1, does that mean we'll go away from strings?

channel = SingleChannel(opx_output=port)
```

Note that in this situation the port offset is defined by `channel.port.offset`, and is therefore part of the port.
The [SingleChannel][quam.components.channels.SingleChannel] component also has the attribute `SingleChannel.OPX_output_offset`, but its value is ignored in this case.
If we would have instead used `SingleChannel.opx_output = ("con1", 3)`, then the offset would have been defined by `channel.OPX_output_offset`.
Loading