Abstract base class for control parameterizations.
More...
#include <controlbasis.hpp>
|
| | 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.
|
| |
| virtual int | getNSplines () |
| | Retrieves the number of splines (default implementation returns 0).
|
| |
| virtual double | computeVariation (std::vector< double > &, int) |
| | Computes the variation of control parameters (default implementation returns 0.0).
|
| |
| virtual void | computeVariation_diff (double *, std::vector< double > &, double, int) |
| | Computes the gradient of the variation (default implementation does nothing).
|
| |
| virtual void | enforceBoundary (double *, int) |
| | Enforces boundary conditions for controls (default implementation does nothing).
|
| |
| virtual void | evaluate (const double t, const std::vector< double > &coeff, int carrier_freq_id, double *Blt1, double *Blt2)=0 |
| | Evaluates the control basis at a given time using the provided coefficients.
|
| |
| virtual void | derivative (const double t, const std::vector< double > &coeff, double *coeff_diff, const double valbar1, const double valbar2, int carrier_freq_id)=0 |
| | Evaluates the derivative of the control basis at a given time.
|
| |
|
| 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.
|
| |
Abstract base class for control parameterizations.
The ControlBasis class defines the interface for various parameterizations of the control pulse envelopes, which are multiplied by carrier waves in the Oscillator class. Derived classes implement specific control parameterizations, such as the most standard parameterization via 2nd order Bsplines. Specific control parameterizations are initialized in the constructor of the oscillator.
Main functionality:
- evaluate for computing the outer envelop shape of the pulses at given time t
- derivative for updating the local gradient of the evaluate function
- enforceBoundary for setting pulse shape envelopes to zero at initial and final time
◆ ControlBasis() [1/2]
| ControlBasis::ControlBasis |
( |
| ) |
|
◆ ControlBasis() [2/2]
| ControlBasis::ControlBasis |
( |
int |
nparams_, |
|
|
double |
tstart, |
|
|
double |
tstop, |
|
|
bool |
enforceZeroBoundary |
|
) |
| |
Constructor with parameters.
- Parameters
-
| nparams_ | Number of parameters defining the controls. |
| tstart | Start time of the interval. |
| tstop | Stop time of the interval. |
| enforceZeroBoundary | Flag to enforce zero boundary conditions. If true, ensures that the controls start and end at zero. |
◆ ~ControlBasis()
| ControlBasis::~ControlBasis |
( |
| ) |
|
|
virtual |
◆ computeVariation()
| virtual double ControlBasis::computeVariation |
( |
std::vector< double > & |
, |
|
|
int |
|
|
) |
| |
|
inlinevirtual |
Computes the variation of control parameters (default implementation returns 0.0).
Default implementation ignores all input parameters.
- Returns
- double Variation value.
Reimplemented in BSpline0.
◆ computeVariation_diff()
| virtual void ControlBasis::computeVariation_diff |
( |
double * |
, |
|
|
std::vector< double > & |
, |
|
|
double |
, |
|
|
int |
|
|
) |
| |
|
inlinevirtual |
Computes the gradient of the variation (default implementation does nothing).
Default implementation ignores all input parameters.
Reimplemented in BSpline0.
◆ derivative()
| virtual void ControlBasis::derivative |
( |
const double |
t, |
|
|
const std::vector< double > & |
coeff, |
|
|
double * |
coeff_diff, |
|
|
const double |
valbar1, |
|
|
const double |
valbar2, |
|
|
int |
carrier_freq_id |
|
) |
| |
|
pure 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. |
Implemented in BSpline2nd, BSpline2ndAmplitude, and BSpline0.
◆ enforceBoundary()
| virtual void ControlBasis::enforceBoundary |
( |
double * |
, |
|
|
int |
|
|
) |
| |
|
inlinevirtual |
Enforces boundary conditions for controls (default implementation does nothing).
For some control parameterizations, this can be used to enforce that the controls start and end at zero. For example, the 2nd order Bspline parameterization will overwrite the parameters of the first and last two splines by zero, ensuring that the resulting control pulses start and end at zero.
Default implementation ignores all input parameters.
Reimplemented in BSpline2nd, BSpline2ndAmplitude, and BSpline0.
◆ evaluate()
| virtual void ControlBasis::evaluate |
( |
const double |
t, |
|
|
const std::vector< double > & |
coeff, |
|
|
int |
carrier_freq_id, |
|
|
double * |
Blt1, |
|
|
double * |
Blt2 |
|
) |
| |
|
pure 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. |
Implemented in BSpline2nd, BSpline2ndAmplitude, and BSpline0.
◆ getNparams()
| int ControlBasis::getNparams |
( |
| ) |
|
|
inline |
Retrieves the number of parameters defining the controls.
- Returns
- int Number of parameters.
◆ getNSplines()
| virtual int ControlBasis::getNSplines |
( |
| ) |
|
|
inlinevirtual |
◆ getSkip()
| int ControlBasis::getSkip |
( |
| ) |
|
|
inline |
Retrieves the offset for the starting location in the global control vector.
- Returns
- int Offset value.
◆ getTstart()
| double ControlBasis::getTstart |
( |
| ) |
|
|
inline |
Retrieves the start time of the interval.
- Returns
- double Start time.
◆ getTstop()
| double ControlBasis::getTstop |
( |
| ) |
|
|
inline |
Retrieves the stop time of the interval.
- Returns
- double Stop time.
◆ getType()
Retrieves the type of control parameterization.
- Returns
- ControlType Type of control.
◆ setSkip()
| void ControlBasis::setSkip |
( |
int |
skip_ | ) |
|
|
inline |
Sets the offset for the starting location in the global control vector.
- Parameters
-
◆ controltype
Type of control parameterization.
◆ enforceZeroBoundary
| bool ControlBasis::enforceZeroBoundary |
|
protected |
Flag to enforce zero boundary conditions for control pulses.
◆ nparams
| int ControlBasis::nparams |
|
protected |
Number of parameters that define the control pulse.
◆ skip
Offset to the starting location for this basis inside the global control vector.
◆ tstart
| double ControlBasis::tstart |
|
protected |
Start time of the interval where the control basis is applied.
◆ tstop
| double ControlBasis::tstop |
|
protected |
Stop time of the interval where the control basis is applied.
The documentation for this class was generated from the following files: