paraqeet.signal.generator.Generator#
- class paraqeet.signal.generator.Generator[source]#
Bases:
Optimizable,DifferentiableSignal generation stack.
Contrary to most quantum simulators, paraqeet includes a detailed simulation of the control stack. Each component in the stack and its functions are simulated individually and combined here.
Example: A local oscillator and arbitrary waveform generator signal are put through via a mixer device to produce an effective modulated signal.
- __init__()#
Methods
__init__()get_gradient_at_timestep(time)Return array with the gradient of the signal value for one time step.
Return all parameters of this class that can be optimized.
get_value(times)Return array with scalar signal value for each time step.
get_value_and_gradient(times)Calculate the gradient of the model.
set_all_optimizable_parameters(all_params)Set all optimizable parameters in the optimization.
set_optimizable_parameters(params)Set which parameters associated with the object shall be considered during optimization.
Attributes
Get the optimizable parameters
Get the name of the parameter.
Get the optimizable parameters
- 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]
- abstract get_gradient_at_timestep(time)[source]#
Return array with the gradient of the signal value for one time step.
The result has the shape (p,) where ‘p’ is the parameter index.
- Parameters:
time (Array) – One time stamp.
- Return type:
Array
- abstract get_parameters()[source]#
Return all parameters of this class that can be optimized.
- Raises:
NotImplementedError – Subclasses derived from this class must implement this method.
- Return type:
list[Quantity]
- abstract get_value(times)[source]#
Return array with scalar signal value for each time step.
- Parameters:
times (Array) – One-dimensional vector of timestamps.
- Returns:
Returns the scalar signal vector.
- Return type:
Array
- abstract get_value_and_gradient(times)[source]#
Calculate the gradient of the model.
- Returns:
The value and the gradient of the model.
- Return type:
tuple[Array, Array] | tuple[float, Array]
- Parameters:
times (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.
- set_optimizable_parameters(params)[source]#
Set which parameters associated with the object shall be considered during optimization.
All quantities that are not in the response of get_parameters will be filtered out. This function is called by the optimizer before gradient based optimization to tell the layers which gradients to compute.
- Parameters:
params (list[Quantity]) – List of optimizable parameters to be set.
- Return type:
None