Oakfield API Documentation 1.0.0
Numerical core APIs
Loading...
Searching...
No Matches
digamma_square.h File Reference

Digamma square stimulus operators. More...

#include "coords.h"
#include "oakfield/math/special_functions.h"
#include "oakfield/operator_split.h"
#include "oakfield/operators/coupling/mixer.h"
#include <stdbool.h>
#include <stddef.h>
Include dependency graph for digamma_square.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SimStimulusDigammaSquareConfig
 Shared configuration for digamma square stimulus variants. More...
 
struct  SimDigammaSquareState
 State for digamma square stimulus. More...
 

Typedefs

typedef enum SimDigammaSquareWaveformShape SimDigammaSquareWaveformShape
 Waveform shape for digamma square stimulus.
 
typedef struct SimStimulusDigammaSquareConfig SimStimulusDigammaSquareConfig
 Shared configuration for digamma square stimulus variants.
 
typedef struct SimDigammaSquareState SimDigammaSquareState
 State for digamma square stimulus.
 

Enumerations

enum  SimDigammaSquareWaveformShape { SIM_DIGAMMA_SQUARE_WAVEFORM_DEFAULT = 0 , SIM_DIGAMMA_SQUARE_WAVEFORM_TRIANGLE , SIM_DIGAMMA_SQUARE_WAVEFORM_SAWTOOTH }
 Waveform shape for digamma square stimulus. More...
 

Functions

SimResult sim_add_stimulus_digamma_square_operator (struct SimContext *context, const SimStimulusDigammaSquareConfig *config, size_t *out_index)
 Register a digamma square stimulus operator.
 
SimResult sim_add_digamma_square_operator (struct SimContext *context, size_t field_index, const SimStimulusDigammaSquareConfig *config, size_t *out_index)
 Register a digamma-square operator while overriding the target field.
 
SimResult sim_stimulus_digamma_square_config (struct SimContext *context, size_t operator_index, SimStimulusDigammaSquareConfig *out_config)
 Copy the current digamma-square configuration from a registered operator.
 
SimResult sim_stimulus_digamma_square_update (struct SimContext *context, size_t operator_index, const SimStimulusDigammaSquareConfig *config)
 Replace or renormalize a registered digamma-square stimulus configuration.
 

Detailed Description

Digamma square stimulus operators.

Complex fields are driven by writing real/imag components with optional rotation.

Enumeration Type Documentation

◆ SimDigammaSquareWaveformShape

Waveform shape for digamma square stimulus.

Enumerator
SIM_DIGAMMA_SQUARE_WAVEFORM_DEFAULT 

Default square-like digamma waveform.

SIM_DIGAMMA_SQUARE_WAVEFORM_TRIANGLE 

Triangle-like waveform variant.

SIM_DIGAMMA_SQUARE_WAVEFORM_SAWTOOTH 

Sawtooth-like waveform variant.

Function Documentation

◆ sim_add_digamma_square_operator()

SimResult sim_add_digamma_square_operator ( struct SimContext context,
size_t  field_index,
const SimStimulusDigammaSquareConfig config,
size_t *  out_index 
)

Register a digamma-square operator while overriding the target field.

This compatibility wrapper copies config when supplied, replaces its field_index with field_index, and registers the legacy operator name.

Parameters
contextSimulation context that will own the operator.
field_indexTarget field index written by the operator.
configOptional configuration values other than the target field.
[out]out_indexOptional destination for the registered operator index.
Returns
SIM_RESULT_OK on success, or an error code from validation, allocation, buffer setup, or split-operator registration.

◆ sim_add_stimulus_digamma_square_operator()

SimResult sim_add_stimulus_digamma_square_operator ( struct SimContext context,
const SimStimulusDigammaSquareConfig config,
size_t *  out_index 
)

Register a digamma square stimulus operator.

The implementation copies and normalizes config, then registers the default digamma-square waveform as a split operator targeting the configured field.

Parameters
contextSimulation context that will own the operator.
configOptional digamma-square configuration; NULL selects normalized defaults.
[out]out_indexOptional destination for the registered operator index.
Returns
SIM_RESULT_OK on success, or an error code from validation, allocation, buffer setup, or split-operator registration.

◆ sim_stimulus_digamma_square_config()

SimResult sim_stimulus_digamma_square_config ( struct SimContext context,
size_t  operator_index,
SimStimulusDigammaSquareConfig out_config 
)

Copy the current digamma-square configuration from a registered operator.

Parameters
contextSimulation context containing the operator.
operator_indexIndex returned by a digamma-square registration call.
[out]out_configReceives the operator's normalized configuration.
Returns
SIM_RESULT_OK on success, SIM_RESULT_INVALID_ARGUMENT for NULL pointers, SIM_RESULT_NOT_FOUND for a missing operator, or SIM_RESULT_INVALID_STATE when the operator has no stimulus state.

◆ sim_stimulus_digamma_square_update()

SimResult sim_stimulus_digamma_square_update ( struct SimContext context,
size_t  operator_index,
const SimStimulusDigammaSquareConfig config 
)

Replace or renormalize a registered digamma-square stimulus configuration.

Passing NULL for config keeps the existing configuration and reapplies normalization. A successful update refreshes symbolic and cached runtime state before invalidating the scheduler plan.

Parameters
contextSimulation context containing the operator.
operator_indexIndex of the digamma-square operator to update.
configOptional replacement configuration.
Returns
SIM_RESULT_OK on success, or an error code if lookup, buffer setup, or state validation fails.