paraqeet.signal.envelopes.Envelope#

class paraqeet.signal.envelopes.Envelope(amplitude=None, t_final=None)[source]#

Bases: Waveform

Classical Signal Envelope class.

_amplitude: Quantity

The amplitude of the envelope.

_t_final: Quantity

The length in time of the envelope.

_gradient_function: Callable | None

The function to calculate the gradient with respect to a set of previously defined parameters.

_grad_arg_nums: tuple[int, …]

The identifying indices of which parameters to calculate the gradient with respect to.

Parameters:
__init__(amplitude=None, t_final=None)[source]#
Parameters:

Methods

__init__([amplitude, t_final])

get_parameters()

Get a list of parameters of the envelope.

get_time_and_parameter_gradient(times)

Compute the double derivative with respect to parameter and time.

get_time_gradient(times)

Compute a signal envelopes time derivative.

get_value(times)

Compute the output.

get_value_and_gradient(times)

Compute the gradient of the _evaluate method.

set_all_optimizable_parameters(all_params)

Set all optimizable parameters in the optimization.

set_optimizable_parameters(params)

Set optimizable parameters for optimization.

Attributes

all_optimizable_parameters

Get the optimizable parameters

amplitude

Get the amplitude of the system.

name

Get the name of the parameter.

optimizable_parameters

Get the optimizable parameters

t_final

Get the length of the tone.

property all_optimizable_parameters: list[Quantity]#

Get the optimizable parameters

Returns:

The list of all the optimizable parameters considered in the optimization

Return type:

list[Quantity]

property amplitude: Quantity#

Get the amplitude of the system.

Returns:

Amplitude of the system.

Return type:

Quantity

get_parameters()[source]#

Get a list of parameters of the envelope.

Returns:

List of parameters of the envelope.

Return type:

List[Quantity]

get_time_and_parameter_gradient(times)[source]#

Compute the double derivative with respect to parameter and time.

This function computes $\frac{\partial^2 \Omega}{\partial t \partial alpha}$ for a pulse $\Omega(t)$ and parameter $\alpha$.

Parameters:

times (Array) – One-dimensional vector of timestamps.

Returns:

Returns a vector signals time derivative.

Return type:

Array

get_time_gradient(times)[source]#

Compute a signal envelopes time derivative.

Parameters:

times (Array) – One-dimensional vector of timestamps.

Returns:

Returns a vector signals time derivative.

Return type:

Array

abstract get_value(times)[source]#

Compute the output.

Parameters:

times (Array) – One-dimensional vector of timestamps.

Returns:

Output of the computation.

Return type:

Array

Raises:

NotImplementedError – Subclasses derived from this class must implement this method.

get_value_and_gradient(times)[source]#

Compute the gradient of the _evaluate method.

Uses Automatic differentiation as a fallback. The _evaluate method should be a pure function (should take the optimizable parameters as function arguments and doesn’t depend on global variables). Refer to https://jax.readthedocs.io/en/latest/notebooks/Common_Gotchas_in_JAX.html for functionally pure functions. To implement analytical gradients / other methods for gradient computation overwrite this method in the inherited class.

Parameters:

times (Array) – One-dimensional vector of timestamps.

Returns:

Returns the gradient array of the _evaluate method.

Return type:

Array

property name: str | None#

Get the name of the parameter.

Returns:

Name of the parameter.

Return type:

str | None

property optimizable_parameters: list[Quantity]#

Get the optimizable parameters

Returns:

The list of optimizable parameters associated with the object.

Return type:

list[Quantity]

set_all_optimizable_parameters(all_params)[source]#

Set all optimizable parameters in the optimization.

Parameters:
  • params (List[Quantity]) – List of optimizable parameters to be set.

  • all_params (list[Quantity])

Return type:

None

set_optimizable_parameters(params)[source]#

Set optimizable parameters for optimization.

Parameters:

params (list[Quantity]) – Input list of parameters to be set.

Return type:

None

property t_final: Quantity#

Get the length of the tone.

Returns:

Length in time of the tone.

Return type:

Quantity