Discretization of the Controls using piece-wise constant (0-th order) Bsplines.
More...
#include <controlbasis.hpp>
|
| | BSpline0 (int nsplines, double tstart, double tstop, bool enforceZeroBoundary) |
| |
| | ~BSpline0 () |
| |
| int | getNSplines () |
| | Retrieves the number of splines (default implementation returns 0).
|
| |
| void | enforceBoundary (double *x, int carrier_id) |
| | Sets the first and last parameter to zero for this carrier wave, so that the controls start and end at zero.
|
| |
| double | computeVariation (std::vector< double > ¶ms, int carrierfreqID) |
| | Computes total variation of the control parameters.
|
| |
| virtual void | computeVariation_diff (double *grad, std::vector< double > ¶ms, double var_bar, int carrierfreqID) |
| | Computes derivative of control parameter variation.
|
| |
| void | evaluate (const double t, const std::vector< double > &coeff, int carrier_freq_id, double *Blt1_ptr, double *Blt2_ptr) |
| | Evaluates the control basis at a given time using the provided coefficients.
|
| |
| void | derivative (const double t, const std::vector< double > &coeff, double *coeff_diff, const double valbar1, const double valbar2, int carrier_freq_id) |
| | Evaluates the derivative of the control basis at a given time.
|
| |
| | ControlBasis () |
| |
| | ControlBasis (int nparams_, double tstart, double tstop, bool enforceZeroBoundary) |
| | Constructor with parameters.
|
| |
| virtual | ~ControlBasis () |
| |
| int | getNparams () |
| | Retrieves the number of parameters defining the controls.
|
| |
| double | getTstart () |
| | Retrieves the start time of the interval.
|
| |
| double | getTstop () |
| | Retrieves the stop time of the interval.
|
| |
| ControlType | getType () |
| | Retrieves the type of control parameterization.
|
| |
| void | setSkip (int skip_) |
| | Sets the offset for the starting location in the global control vector.
|
| |
| int | getSkip () |
| | Retrieves the offset for the starting location in the global control vector.
|
| |
|
| int | nsplines |
| | Number of splines.
|
| |
| double | dtknot |
| | Spacing of time knot vector.
|
| |
| double | width |
| | Support of each basis function (m*dtknot).
|
| |
| int | nparams |
| | Number of parameters that define the control pulse.
|
| |
| double | tstart |
| | Start time of the interval where the control basis is applied.
|
| |
| double | tstop |
| | Stop time of the interval where the control basis is applied.
|
| |
| int | skip |
| | Offset to the starting location for this basis inside the global control vector.
|
| |
| ControlType | controltype |
| | Type of control parameterization.
|
| |
| bool | enforceZeroBoundary |
| | Flag to enforce zero boundary conditions for control pulses.
|
| |
Discretization of the Controls using piece-wise constant (0-th order) Bsplines.
This class parameterizes the control pulse using 0-th order Bspline basis functions (hat functions), with local support of width = T/nsplines.
◆ BSpline0()
| BSpline0::BSpline0 |
( |
int |
nsplines, |
|
|
double |
tstart, |
|
|
double |
tstop, |
|
|
bool |
enforceZeroBoundary |
|
) |
| |
◆ ~BSpline0()
◆ computeVariation()
| double BSpline0::computeVariation |
( |
std::vector< double > & |
params, |
|
|
int |
carrierfreqID |
|
) |
| |
|
virtual |
Computes total variation of the control parameters.
Computes \(\frac{1}{n_{splines}} \sum_{splines} (\alpha_i - \alpha_{i-1})^2\).
- Parameters
-
| params | Vector of control parameters |
| carrierfreqID | ID of the carrier frequency |
- Returns
- double Variation value
Reimplemented from ControlBasis.
◆ computeVariation_diff()
| void BSpline0::computeVariation_diff |
( |
double * |
grad, |
|
|
std::vector< double > & |
params, |
|
|
double |
var_bar, |
|
|
int |
carrierfreqID |
|
) |
| |
|
virtual |
Computes derivative of control parameter variation.
- Parameters
-
| grad | Pointer to gradient array to update |
| params | Vector of control parameters |
| var_bar | Adjoint of variation term |
| carrierfreqID | ID of the carrier frequency |
Reimplemented from ControlBasis.
◆ derivative()
| void BSpline0::derivative |
( |
const double |
t, |
|
|
const std::vector< double > & |
coeff, |
|
|
double * |
coeff_diff, |
|
|
const double |
valbar1, |
|
|
const double |
valbar2, |
|
|
int |
carrier_freq_id |
|
) |
| |
|
virtual |
Evaluates the derivative of the control basis at a given time.
- Parameters
-
| t | Time at which to evaluate. |
| coeff | Vector of coefficients. |
| coeff_diff | Pointer to the derivative coefficients. |
| valbar1 | Multiplier for the real derivative term. |
| valbar2 | Multiplier for the imaginary derivative term. |
| carrier_freq_id | ID of the carrier frequency. |
Implements ControlBasis.
◆ enforceBoundary()
| void BSpline0::enforceBoundary |
( |
double * |
x, |
|
|
int |
carrier_id |
|
) |
| |
|
virtual |
Sets the first and last parameter to zero for this carrier wave, so that the controls start and end at zero.
- Parameters
-
| x | Pointer to the control parameters array |
| carrier_id | ID of the carrier wave |
Reimplemented from ControlBasis.
◆ evaluate()
| void BSpline0::evaluate |
( |
const double |
t, |
|
|
const std::vector< double > & |
coeff, |
|
|
int |
carrier_freq_id, |
|
|
double * |
Blt1, |
|
|
double * |
Blt2 |
|
) |
| |
|
virtual |
Evaluates the control basis at a given time using the provided coefficients.
- Parameters
-
| [in] | t | Time at which to evaluate. |
| [in] | coeff | Vector of parameters (coefficients of the basis parameterization). |
| [in] | carrier_freq_id | ID of the carrier frequency, provided by the oscillator. |
| [out] | Blt1 | Pointer to store the real part of the control parameterization. |
| [out] | Blt2 | Pointer to store the imaginary part of the control parameterization. |
Implements ControlBasis.
◆ getNSplines()
| int BSpline0::getNSplines |
( |
| ) |
|
|
inlinevirtual |
Retrieves the number of splines (default implementation returns 0).
- Returns
- int Number of splines.
Reimplemented from ControlBasis.
◆ dtknot
Spacing of time knot vector.
◆ nsplines
◆ width
Support of each basis function (m*dtknot).
The documentation for this class was generated from the following files: