Quandary
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BSpline2ndAmplitude Class Reference

Control parameterization where only the pulse amplitude is parameterized by Bsplines, while the phase is time-independent. More...

#include <controlbasis.hpp>

Inheritance diagram for BSpline2ndAmplitude:
Inheritance graph
[legend]
Collaboration diagram for BSpline2ndAmplitude:
Collaboration graph
[legend]

Public Member Functions

 BSpline2ndAmplitude (int nsplines, double scaling, double tstart, double tstop, bool enforceZeroBoundary)
 Constructor for quadratic Bsplines for amplitude parameterization.
 
 ~BSpline2ndAmplitude ()
 
int getNSplines ()
 Retrieves the number of splines (default implementation returns 0).
 
void enforceBoundary (double *x, int carrier_id)
 Sets the first and last two spline coefficients in x to zero, so that the controls start and end at zero.
 
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.
 
- Public Member Functions inherited from ControlBasis
 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 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).
 

Protected Member Functions

double basisfunction (int id, double t)
 Evaluate one basis function B_i(tau_i(t)).
 

Protected Attributes

int nsplines
 Number of splines.
 
double dtknot
 Spacing of the time knot vector.
 
double * tcenter
 Vector of basis function center positions.
 
double width
 Support of each basis function (m * dtknot).
 
double scaling
 Scaling for the phase.
 
- Protected Attributes inherited from ControlBasis
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.
 

Detailed Description

Control parameterization where only the pulse amplitude is parameterized by Bsplines, while the phase is time-independent.

Discretization of the controls amplitudes using quadratic Bsplines. Bspline basis functions have local support with width = 3 * dtknot, where dtknot = T / (nsplines - 2) is the time knot vector spacing.

Constructor & Destructor Documentation

◆ BSpline2ndAmplitude()

BSpline2ndAmplitude::BSpline2ndAmplitude ( int  nsplines,
double  scaling,
double  tstart,
double  tstop,
bool  enforceZeroBoundary 
)

Constructor for quadratic Bsplines for amplitude parameterization.

Parameters
nsplinesNumber of splines.
scalingScaling factor for the phase.
tstartStart time of the interval.
tstopStop time of the interval.
enforceZeroBoundaryFlag to enforce zero boundary conditions.

◆ ~BSpline2ndAmplitude()

BSpline2ndAmplitude::~BSpline2ndAmplitude ( )

Member Function Documentation

◆ basisfunction()

double BSpline2ndAmplitude::basisfunction ( int  id,
double  t 
)
protected

Evaluate one basis function B_i(tau_i(t)).

Parameters
idIndex of the basis function.
tTime at which to evaluate.
Returns
double Value of the basis function.

◆ derivative()

void BSpline2ndAmplitude::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
tTime at which to evaluate.
coeffVector of coefficients.
coeff_diffPointer to the derivative coefficients.
valbar1Multiplier for the real derivative term.
valbar2Multiplier for the imaginary derivative term.
carrier_freq_idID of the carrier frequency.

Implements ControlBasis.

◆ enforceBoundary()

void BSpline2ndAmplitude::enforceBoundary ( double *  x,
int  carrier_id 
)
virtual

Sets the first and last two spline coefficients in x to zero, so that the controls start and end at zero.

Parameters
xPointer to the control parameters.
carrier_idID of the carrier wave.

Reimplemented from ControlBasis.

◆ evaluate()

void BSpline2ndAmplitude::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]tTime at which to evaluate.
[in]coeffVector of parameters (coefficients of the basis parameterization).
[in]carrier_freq_idID of the carrier frequency, provided by the oscillator.
[out]Blt1Pointer to store the real part of the control parameterization.
[out]Blt2Pointer to store the imaginary part of the control parameterization.

Implements ControlBasis.

◆ getNSplines()

int BSpline2ndAmplitude::getNSplines ( )
inlinevirtual

Retrieves the number of splines (default implementation returns 0).

Returns
int Number of splines.

Reimplemented from ControlBasis.

Member Data Documentation

◆ dtknot

double BSpline2ndAmplitude::dtknot
protected

Spacing of the time knot vector.

◆ nsplines

int BSpline2ndAmplitude::nsplines
protected

Number of splines.

◆ scaling

double BSpline2ndAmplitude::scaling
protected

Scaling for the phase.

◆ tcenter

double* BSpline2ndAmplitude::tcenter
protected

Vector of basis function center positions.

◆ width

double BSpline2ndAmplitude::width
protected

Support of each basis function (m * dtknot).


The documentation for this class was generated from the following files: