-
Notifications
You must be signed in to change notification settings - Fork 3
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
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
cacb945
Added relevant ports
nulinspiratie c8ad5bc
generalized ports
nulinspiratie 758edde
cleanup of ports
nulinspiratie 2cb0e40
fix: missing import
nulinspiratie 3f31928
adding ports to channels
nulinspiratie 9c6986d
always create Port when adding in channels
nulinspiratie 5fc369c
Add support for MW FEM
nulinspiratie 1b6bed4
add overwriting warning to ports
nulinspiratie 2166e63
added tests for ports
nulinspiratie eb2f900
add documentation
nulinspiratie 3295e70
handling of offsets
nulinspiratie e70a499
MWChannel inherits from Channel
nulinspiratie 849482e
refactoring of ports
nulinspiratie a5bb6cb
renaming
nulinspiratie 63b1152
move paraemters between classes
nulinspiratie 2edcb0e
rename controller_name -> controller_id
nulinspiratie 8afdd0c
change crosstalk, filters default values
nulinspiratie 0484896
add port tuple, made offset optional
nulinspiratie 823a788
channel tuple fixes
nulinspiratie 7c7c05a
minor fix to channels
nulinspiratie f4d4e74
fixing tests
nulinspiratie 0dae746
fully working tests
nulinspiratie d280572
Added channel tests
nulinspiratie 2283238
adding ports containers
nulinspiratie dfa64b0
clean up ports containers
nulinspiratie 742385b
add porots containers tests
nulinspiratie 514e4e0
test ports containers
nulinspiratie bae1b09
fixing ports bugs
nulinspiratie 5001015
octave ports
nulinspiratie bed20b3
Merge remote-tracking branch 'origin/main' into feat/ports
nulinspiratie b92b626
Merge branch 'fix/json-int-keys-folder' into feat/ports
nulinspiratie 37e602d
Merge branch 'fix/dict-instantiation' into feat/ports
nulinspiratie e044810
test: fix IQ channels test
nulinspiratie f28562d
fix: dataclass issue for python > 3.9
nulinspiratie d1938f2
Merge remote-tracking branch 'origin/main' into feat/ports
nulinspiratie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
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`. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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:
channel
- but this collides with the channel below, what is its purpose?port
argument, maybe we can have itphysical_port
? maybe we can also separate it from the tuple and just have: (controller=1, physical_port=3, offset_0.2,...)
There was a problem hiding this comment.
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 withelements
in the qua config. The reason I called itchannel
as opposed toelement
is that up to now they also implemented thecontrollers
part of the config, so they were a combination ofelement + controller port
. So I don't thinkchannels
would be a good name.We could change the
port
argument to something else, but I'm not surephysical_port
is the right name. The reason I liked usingport
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
, andphysical_port
also adds too many parameters.What about using
port_id
?There was a problem hiding this comment.
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 suggestedI 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.
There was a problem hiding this comment.
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
ascontroller=1
, does that mean we'll go away from strings?