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

Advanced envelopes #1118

Open
2 tasks
alecandido opened this issue Dec 11, 2024 · 0 comments
Open
2 tasks

Advanced envelopes #1118

alecandido opened this issue Dec 11, 2024 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@alecandido
Copy link
Member

The envelopes in the 0.2 release have been manipulated wrt their 0.1 counterpart, but no drastic change has been implemented.

In particular, there are a couple of leftover features that have been considered, but not realized

Envelopes extensions

Preview Give feedback

Modifiers

The present Drag is nothing else than the DRAG scheme applied to a Gaussian pulse, but it does not implement the general DRAG procedure.
This is similar to the case for the Iir filter, which adopts a different strategy, and currently wraps an entire other envelope.

target: BaseEnvelope

There are two challenges in here.

One is related to a proper implementation of a general envelope-modifier scheme, and it's serialization. Wrapping an object like in the Iir is a potential solution, that would cater for the serialization, and Pydantic's duck-typing serialization may boost this strategy. Others may be taken into account.

The second challenge is specific to the DRAG scheme, which requires a derivative of the pulse itself to compute the Q component.
This can be achieved in multiple ways:

  • symbolically, using
    • SymPy's diff, over a generic callable
    • applying another auto-differentiation framework (e.g. JAX)
  • numerically, by
    • crude finite differences
    • a suitable Savgol filter, whose parameters may be
      • constant, optimized for the average use case
      • adaptive, taking into account the number of samples, or the sharpness of the original waveform's variations

The main complexity for this derivative affair is not much in the implementation, which are all pretty feasible for the proposed solution, but which is the optimality criterion for the final result (the main differences are expected for very short pulses, containing few samples - but even sampling the analytic derivative in those cases may be not the optimal solution).

Plugins

This is just about to allow the user to register further envelopes, allowing experimenting without the need of a full Custom every time, and retaining the original parametrization.

This now requires patching Qibolab itself.

Applying the same infrastructure of ConfigKinds it can be (easily enough) integrated with the serialization.

@alecandido alecandido added this to the Qibolab 0.3.0 milestone Dec 11, 2024
@alecandido alecandido added the enhancement New feature or request label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant