Adding stay alive method for sticky elements (TWPA pumps) within shot loops#135
Conversation
… alive during shot loops Modified docstring for initialize_qpu to note the need for twpa_keepalive (#123)
|
@arthurostrauss Im hesitant to introduce program-scope awareness in quam_builder. It would be implicit behavior under the hood that is difficult to debug for customers, and I prefer a requirement for an explicit call to twpa_keepalive. However, I am also totally open to refactoring if you think that would be a better approach! |
|
I see in the comments that it mentions explicitly the shot loop. Could we have a test with nested loops in QUA for different sweeps (like frequency or other) to test if the align needs only to be in the most inner loop or all of them? Moreover,while I agree in principle that the explicit approach is the most straightforward way to make it happen, this raises a challenge for the most anticipated gate level use cases. As QuAM builder is growing and its specs become harder to track for gate level users (who will grow, especially at IQCC), keeping in mind what to do beyond handling QUA control flow and automated circuit to QUA compilation within the program will become increasingly difficult to manage. There is probably no easy middle ground in bare QUA or QUAM as we know it, but it would be good at least to ensure that this new method you added is enough after the circuit execution and does not need to be added anywhere else for the sticky element to stay alive. Let me know what you think. |
arthurostrauss
left a comment
There was a problem hiding this comment.
I think that is a legit approach, but it adds overhead that may keep piling up on complexity for each iteration of new custom components like this that may occur in other qubits configurations, we need to start thinking about a better encapsulation strategy for enabling QUA to handle more abstract layers.
I hadn't considered gate level use and I do agree this doesn't scale there as a manual call. I see two ways we can move forward for scaling:
Also, I hate that github doesn't allow comment chains unless its attached to a code block :( |
arthurostrauss
left a comment
There was a problem hiding this comment.
I'm okay with the proposed approach 1. Let's feature this in already so IQCC can propose a consistent way of addressing this issue.
It would be great to follow up with the next PR soon so that gate level users don't have to manually adapt their script in future evolutions of the quam builder


Pull Request
Description
When building QUA programs using quam_builder's FluxTunableQuam and initialize_qpu, TWPA pump elements configured as sticky CW tones required being included in at least one align() statement inside every shot loop to maintain their output. Without this, the TWPA pump stops pinging after its initial sticky window, causing total signal loss at the readout and silently yielding all-zero measurement outcomes. This PR adds an additional method to FluxTunableQuam (twpa_keepalive) which injects aligns of the twpa pump with any active qubits to keep the twpa element alive without forcing an align with all inactive qubits.
Type of Change
Related Issues
Closes #123
Checklist
Code Quality
pre-commithooks and all checks pass (pre-commit run --all-files)Testing
pytest)Documentation