Skip to content

Public API ​

This page lists exported symbols of CTFlows.Configs.


From CTFlows.Configs ​

CTFlows.Configs [Module] ​

CTFlows.Configs Module
julia
Configs

Configuration types for integration problems in CTFlows.

This module provides the configuration type hierarchy that specifies integration scenarios including:

  • Integration mode: point-to-point vs trajectory

  • Dynamics type: state-only vs Hamiltonian (state + costate)

  • Time dependence: autonomous vs non-autonomous

  • Variable dependence: fixed vs non-fixed (for optimal control)

Configuration types encode these choices as type parameters for compile-time dispatch.

Main Types

Accessors

See also: CTFlows.Flows.build_flow, CTFlows.Trajectories.build_trajectory.

AbstractAugmentedHamiltonianConfig [Abstract Type] ​

CTFlows.Configs.AbstractAugmentedHamiltonianConfig Type
julia
abstract type AbstractConfigWithMaC{X0, M<:CTBase.Traits.AbstractModeTrait, CTBase.Traits.AugmentedHamiltonianDynamics} <: CTFlows.Configs.AbstractConfig{X0}

Type alias for augmented Hamiltonian configurations, which include state, costate, and augmented variable initial conditions.

Type Parameters

  • X0: Type of the initial condition (typically a vector concatenating state, costate, and augmented variable).

  • M: Type of the mutability trait (InPlace or OutOfPlace).

Notes

See also: CTFlows.Configs.AbstractHamiltonianConfig, CTBase.Traits.AugmentedHamiltonianDynamics, CTFlows.Systems.HamiltonianSystem.

AbstractConfig [Abstract Type] ​

CTFlows.Configs.AbstractConfig Type
julia
abstract type AbstractConfig{X0}

Abstract configuration type for integration problems.

Marker type for dispatch on configuration objects. Concrete subtypes define specific integration scenarios (e.g., point-to-point, trajectory, costate).

The type parameters encode:

  • X0: Type of the initial condition (scalar Number or vector AbstractVector)

  • Mode: Integration mode (EndPointMode or TrajectoryMode)

  • Dyn: Dynamics type (StateDynamics or HamiltonianDynamics)

This enables compile-time dispatch on mode and content without runtime type tests.

Interface Requirements

All subtypes must implement:

  • tspan(config): Return the time span as a tuple (t0, tf).

Example

julia
julia> using CTFlows: Configs

julia> Configs.StateEndPointConfig <: Configs.AbstractConfig
true

julia> Configs.StateEndPointConfig <: Configs.AbstractEndPointConfig
true

julia> Configs.StateEndPointConfig <: Configs.AbstractStateConfig
true

See also: CTFlows.Configs.AbstractEndPointConfig, CTFlows.Configs.AbstractTrajectoryConfig, CTFlows.Configs.AbstractStateConfig, CTFlows.Configs.AbstractHamiltonianConfig.

AbstractConfigWithMaC [Abstract Type] ​

CTFlows.Configs.AbstractConfigWithMaC Type
julia
abstract type AbstractConfigWithMaC{X0, Mode<:CTBase.Traits.AbstractModeTrait, Dyn<:CTBase.Traits.AbstractDynamicsTrait} <: CTFlows.Configs.AbstractConfig{X0}

Abstract configuration type with mode and content traits.

Extends AbstractConfig with additional type parameters for compile-time dispatch on integration mode (point vs trajectory) and content type (state, Hamiltonian, augmented Hamiltonian).

Type Parameters

  • X0: Type of the initial condition (scalar Number or vector AbstractVector)

  • Mode <: AbstractModeTrait: Integration mode trait (EndPointMode or TrajectoryMode)

  • Dyn <: AbstractDynamicsTrait: Dynamics trait (StateDynamics, HamiltonianDynamics, or AugmentedHamiltonianDynamics)

Interface Requirements

All subtypes must implement:

  • tspan(config): Return the time span as a tuple (t0, tf).

Example

julia
julia> using CTFlows: Configs

julia> Configs.StateEndPointConfig <: Configs.AbstractConfigWithMaC
true

julia> Configs.HamiltonianEndPointConfig <: Configs.AbstractConfigWithMaC
true

See also: CTFlows.Configs.AbstractConfig, CTFlows.Configs.AbstractEndPointConfig, CTFlows.Configs.AbstractTrajectoryConfig, CTFlows.Configs.AbstractStateConfig, CTFlows.Configs.AbstractHamiltonianConfig, CTFlows.Configs.AbstractAugmentedHamiltonianConfig.

AbstractEndPointConfig [Abstract Type] ​

CTFlows.Configs.AbstractEndPointConfig Type
julia
abstract type AbstractConfigWithMaC{X0, CTBase.Traits.EndPointMode, C<:CTBase.Traits.AbstractDynamicsTrait} <: CTFlows.Configs.AbstractConfig{X0}

Alias for point integration mode configurations.

Matches any AbstractConfig with EndPointMode as the mode parameter.

AbstractGrid [Abstract Type] ​

CTFlows.Configs.AbstractGrid Type
julia
abstract type AbstractGrid

Abstract supertype of the output grids generated from the time span of a trajectory call (f((t0, tf), x0, …; grid=spec)). A generated grid has exactly n distinct times, the bounds and the switching times of a multi-phase flow included; it only shapes the output (the integration is that of the span). CTFlows.Configs.AutomaticGrid is the default grid of a call that sets none.

See also: CTFlows.Configs.UniformGrid, CTFlows.Configs.AdaptiveGrid.

AbstractHamiltonianConfig [Abstract Type] ​

CTFlows.Configs.AbstractHamiltonianConfig Type
julia
abstract type AbstractConfigWithMaC{X0, M<:CTBase.Traits.AbstractModeTrait, CTBase.Traits.HamiltonianDynamics} <: CTFlows.Configs.AbstractConfig{X0}

Alias for Hamiltonian content configurations.

Matches any AbstractConfig with HamiltonianDynamics as the dynamics parameter.

AbstractStateConfig [Abstract Type] ​

CTFlows.Configs.AbstractStateConfig Type
julia
abstract type AbstractConfigWithMaC{X0, M<:CTBase.Traits.AbstractModeTrait, CTBase.Traits.StateDynamics} <: CTFlows.Configs.AbstractConfig{X0}

Alias for state content configurations.

Matches any AbstractConfig with StateDynamics as the dynamics parameter.

AbstractTrajectoryConfig [Abstract Type] ​

CTFlows.Configs.AbstractTrajectoryConfig Type
julia
abstract type AbstractConfigWithMaC{X0, CTBase.Traits.TrajectoryMode, C<:CTBase.Traits.AbstractDynamicsTrait} <: CTFlows.Configs.AbstractConfig{X0}

Alias for trajectory integration mode configurations.

Matches any AbstractConfig with TrajectoryMode as the mode parameter.

AdaptiveGrid [Struct] ​

CTFlows.Configs.AdaptiveGrid Type
julia
struct AdaptiveGrid <: CTFlows.Configs.AbstractGrid

Adaptive output grid of n times, denser where the plotted curves (state, costate and control, each scaled by its range) bend: the times equidistribute the density ρ ∝ ‖y''‖^{1/2}, which minimizes the error of the polyline drawn through them, mixed with a uniform share uniform. On a multi-phase flow, the intervals are shared between the phases in proportion to their mass.

Fields

  • n::Int: Number of distinct times, at least 2.

  • uniform::Float64: Share of the uniform density, in [0, 1] (default 0.1).

Throws

  • CTBase.Exceptions.IncorrectArgument: If n < 2 or uniform ∉ [0, 1].

See also: CTFlows.Configs.UniformGrid.

AugmentedHamiltonianEndPointConfig [Struct] ​

CTFlows.Configs.AugmentedHamiltonianEndPointConfig Type
julia
struct AugmentedHamiltonianEndPointConfig{T0<:Real, X0, P0, PV0, TF<:Real} <: CTFlows.Configs.AbstractConfigWithMaC{X0, CTBase.Traits.EndPointMode, CTBase.Traits.AugmentedHamiltonianDynamics}

Configuration for an augmented Hamiltonian point-to-point integration problem.

Defines the initial and final time points along with the initial state, costate, and variable costate for integration from a single initial condition to a specific final time in the augmented Hamiltonian framework.

Fields

  • t0::T0: Initial time

  • x0::X0: Initial state vector

  • p0::P0: Initial costate vector

  • pv0::PV0: Initial variable costate vector (typically zeros)

  • tf::TF: Final time

Example

julia
julia> using CTFlows: Configs

julia> config = Configs.AugmentedHamiltonianEndPointConfig(0.0, [1.0, 0.0], [0.5, 0.3], [0.0, 0.0], 1.0)
AugmentedHamiltonianEndPointConfig
  t0: 0.0
  x0: [1.0, 0.0]
  p0: [0.5, 0.3]
  pv0: [0.0, 0.0]
  tf: 1.0

See also: CTFlows.Configs.HamiltonianEndPointConfig, CTBase.Traits.AugmentedHamiltonianDynamics.

AutomaticGrid [Struct] ​

CTFlows.Configs.AutomaticGrid Type
julia
struct AutomaticGrid <: CTFlows.Configs.AbstractGrid

Output grid applied by default to a trajectory call that sets no output grid (grid not provided, issue #446): the adaptive grid grid is generated only when the integration is dense and yields fewer than grid.n times, so that the result has grid.n times; otherwise the result is left as the solver returned it.

It is resolved by the top-level trajectory calls and never by the internal ones (the inner flow of a decorator, a phase of a multi-phase flow), whose result is regridded once, at the end. grid=nothing opts out.

Fields

  • grid::AdaptiveGrid: The grid generated when the solver returns fewer than grid.n times (default AdaptiveGrid(250), the size of the solutions of the direct methods).

See also: CTFlows.Configs.AdaptiveGrid.

HamiltonianEndPointConfig [Struct] ​

CTFlows.Configs.HamiltonianEndPointConfig Type
julia
struct HamiltonianEndPointConfig{T0<:Real, X0, P0, TF<:Real} <: CTFlows.Configs.AbstractConfigWithMaC{X0, CTBase.Traits.EndPointMode, CTBase.Traits.HamiltonianDynamics}

Configuration for a Hamiltonian point-to-point integration problem.

Defines the initial and final time points along with the initial state and costate for integration from a single initial condition to a specific final time in the Hamiltonian framework.

Fields

  • t0::T0: Initial time

  • x0::X0: Initial state vector

  • p0::P0: Initial costate vector

  • tf::TF: Final time

Example

julia
julia> using CTFlows: Configs

julia> config = Configs.HamiltonianEndPointConfig(0.0, [1.0, 0.0], [0.5, 0.3], 1.0)
HamiltonianEndPointConfig
  t0: 0.0
  x0: [1.0, 0.0]
  p0: [0.5, 0.3]
  tf: 1.0

See also: CTFlows.Configs.HamiltonianTrajectoryConfig, CTFlows.Configs.StateEndPointConfig.

HamiltonianTrajectoryConfig [Struct] ​

CTFlows.Configs.HamiltonianTrajectoryConfig Type
julia
struct HamiltonianTrajectoryConfig{TS<:(Tuple{var"#s16", var"#s8"} where {var"#s16"<:Real, var"#s8"<:Real}), X0, P0, G<:Union{Nothing, CTFlows.Configs.AbstractGrid, AbstractVector}} <: CTFlows.Configs.AbstractConfigWithMaC{X0, CTBase.Traits.TrajectoryMode, CTBase.Traits.HamiltonianDynamics}

Configuration for a Hamiltonian trajectory integration problem.

Defines a time span and initial state and costate for integration over a continuous time interval in the Hamiltonian framework, useful for generating full Hamiltonian trajectories.

Fields

Example

julia
julia> using CTFlows: Configs

julia> config = Configs.HamiltonianTrajectoryConfig((0.0, 1.0), [1.0, 0.0], [0.5, 0.3])
HamiltonianTrajectoryConfig
  tspan: (0.0, 1.0)
  x0: [1.0, 0.0]
  p0: [0.5, 0.3]

See also: CTFlows.Configs.HamiltonianEndPointConfig, CTFlows.Configs.StateTrajectoryConfig.

StateEndPointConfig [Struct] ​

CTFlows.Configs.StateEndPointConfig Type
julia
struct StateEndPointConfig{T0<:Real, X0, TF<:Real} <: CTFlows.Configs.AbstractConfigWithMaC{X0, CTBase.Traits.EndPointMode, CTBase.Traits.StateDynamics}

Configuration for a point-to-point integration problem.

Defines the initial and final time points along with the initial state for integration from a single initial condition to a specific final time.

Fields

  • t0::T0: Initial time

  • x0::X0: Initial state vector

  • tf::TF: Final time

Example

julia
julia> using CTFlows: Configs

julia> config = Configs.StateEndPointConfig(0.0, [1.0, 0.0], 1.0)
StateEndPointConfig
  t0: 0.0
  x0: [1.0, 0.0]
  tf: 1.0

See also: CTFlows.Configs.StateTrajectoryConfig

StateTrajectoryConfig [Struct] ​

CTFlows.Configs.StateTrajectoryConfig Type
julia
struct StateTrajectoryConfig{TS<:(Tuple{var"#s4", var"#s3"} where {var"#s4"<:Real, var"#s3"<:Real}), X0, G<:Union{Nothing, CTFlows.Configs.AbstractGrid, AbstractVector}} <: CTFlows.Configs.AbstractConfigWithMaC{X0, CTBase.Traits.TrajectoryMode, CTBase.Traits.StateDynamics}

Configuration for a trajectory integration problem.

Defines a time span and initial state for integration over a continuous time interval, useful for generating full trajectories.

Fields

Example

julia
julia> using CTFlows: Configs

julia> config = Configs.StateTrajectoryConfig((0.0, 1.0), [1.0, 0.0])
StateTrajectoryConfig
  tspan: (0.0, 1.0)
  x0: [1.0, 0.0]

See also: CTFlows.Configs.StateEndPointConfig

TimeSpec [Struct] ​

CTFlows.Configs.TimeSpec Type

Time specification accepted by a trajectory call (and by the trajectory configurations):

  • a 2-tuple (t0, tf) is the time span; the output grid is chosen automatically: the integrator's saveat, or else the default grid of a top-level call (CTFlows.Configs.AutomaticGrid: AdaptiveGrid(250) when the solver returns fewer than 250 times), or the solver steps with grid=nothing;

  • a vector (or range) of times, or a tuple of at least three times, imposes the output grid (t0, t1, …, tf): the integration runs from its first to its last time and the trajectory is returned on exactly these times. The grid takes precedence over the integrator's saveat, and only affects the output: the integration and the dense interpolant are the same as for the span (t0, tf).

A grid must be strictly monotone (increasing for a forward integration, decreasing for a backward one).

See also: CTFlows.Configs.StateTrajectoryConfig, CTFlows.Configs.HamiltonianTrajectoryConfig, CTFlows.Configs.output_grid.

UniformGrid [Struct] ​

CTFlows.Configs.UniformGrid Type
julia
struct UniformGrid <: CTFlows.Configs.AbstractGrid

Uniform output grid of n times (grid=n is a shortcut for grid=UniformGrid(n)). On a multi-phase flow, the n - 1 intervals are shared between the phases in proportion to their duration.

Fields

  • n::Int: Number of distinct times, at least 2.

Throws

  • CTBase.Exceptions.IncorrectArgument: If n < 2.

See also: CTFlows.Configs.AdaptiveGrid.

final_time [Function] ​

CTFlows.Configs.final_time Function
julia
final_time(c::CTFlows.Configs.AbstractConfig) -> Real

Return the final time for a configuration (stub method).

This is a stub method on the base AbstractConfig type that throws NotImplemented. Concrete subtypes should implement this method to return their specific final time.

Arguments

  • c::AbstractConfig: The configuration.

Throws

  • Exceptions.NotImplemented: Always thrown for the base abstract type.

See also: CTFlows.Configs.AbstractConfig, CTFlows.Configs.initial_time.

julia
final_time(
    c::CTFlows.Configs.AbstractEndPointConfig
) -> Real

Return the final time for point configurations.

For point configurations, returns the stored tf field directly.

Arguments

  • c::AbstractEndPointConfig: The point configuration.

Returns

  • Real: Final time tf.

See also: CTFlows.Configs.AbstractEndPointConfig, CTFlows.Configs.final_time.

julia
final_time(
    c::CTFlows.Configs.AbstractTrajectoryConfig
) -> Real

Return the final time for trajectory configurations.

For trajectory configurations, returns the second element of the stored tspan field.

Arguments

  • c::AbstractTrajectoryConfig: The trajectory configuration.

Returns

  • Real: Final time tf.

See also: CTFlows.Configs.AbstractTrajectoryConfig, CTFlows.Configs.final_time.

initial_condition [Function] ​

CTFlows.Configs.initial_condition Function
julia
initial_condition(
    c::CTFlows.Configs.AbstractConfig
) -> Vector

Return the initial condition for a configuration (stub method).

This is a stub method on the base AbstractConfig type that throws NotImplemented. Concrete subtypes should implement this method to return their specific initial condition format.

Arguments

  • c::AbstractConfig: The configuration.

Throws

  • Exceptions.NotImplemented: Always thrown for the base abstract type.

See also: CTFlows.Configs.AbstractConfig.

julia
initial_condition(
    c::CTFlows.Configs.AbstractConfigWithMaC{<:Number, M<:CTBase.Traits.AbstractModeTrait, CTBase.Traits.StateDynamics}
) -> Vector

Return the initial condition as a vector for scalar state configurations.

For scalar initial conditions, wraps the scalar in a length-1 vector to maintain consistent vector-based ODE problem construction.

Arguments

  • c::AbstractStateConfig{<:Number, M}: The state configuration with scalar initial state.

Returns

  • Vector{<:Number}: Length-1 vector containing the scalar initial state.

See also: CTFlows.Configs.AbstractStateConfig, CTFlows.Configs.initial_condition.

julia
initial_condition(
    c::CTFlows.Configs.AbstractStateConfig
) -> Vector

Return the initial condition for state configurations.

For vector initial conditions, returns the state vector directly.

Arguments

  • c::AbstractStateConfig: The state configuration.

Returns

  • The initial state vector.

See also: CTFlows.Configs.AbstractStateConfig.

julia
initial_condition(
    c::CTFlows.Configs.AbstractHamiltonianConfig
) -> Any

Return the initial condition for Hamiltonian configurations.

For Hamiltonian systems, the initial condition is the concatenation of the initial state and initial costate: vcat(x0, p0).

Arguments

  • c::AbstractHamiltonianConfig: The Hamiltonian configuration.

Returns

  • Concatenated vector [x0; p0].

See also: CTFlows.Configs.AbstractHamiltonianConfig, CTFlows.Configs.initial_state, CTFlows.Configs.initial_costate.

julia
initial_condition(
    c::CTFlows.Configs.AugmentedHamiltonianEndPointConfig
) -> Any

Return the initial condition for augmented Hamiltonian configurations.

For augmented Hamiltonian systems, the initial condition is the concatenation of the initial state, initial costate, and initial variable costate: vcat(x0, p0, pv0).

Arguments

  • c::AugmentedHamiltonianEndPointConfig: The augmented Hamiltonian configuration.

Returns

  • Concatenated vector [x0; p0; pv0].

See also: CTFlows.Configs.AugmentedHamiltonianEndPointConfig, CTFlows.Configs.initial_state, CTFlows.Configs.initial_costate, CTFlows.Configs.initial_variable_costate.

initial_costate [Function] ​

CTFlows.Configs.initial_costate Function
julia
initial_costate(c::CTFlows.Configs.AbstractConfig)

Return the initial costate for a configuration (stub method).

This is a stub method on the base AbstractConfig type that throws NotImplemented. Concrete subtypes should implement this method to return their specific initial costate (if applicable).

Arguments

  • c::AbstractConfig: The configuration.

Throws

  • Exceptions.NotImplemented: Always thrown for the base abstract type.

See also: CTFlows.Configs.AbstractConfig.

julia
initial_costate(c::CTFlows.Configs.AbstractStateConfig)

Return the initial costate for state configurations (error stub).

State configurations do not have a costate field. This method throws a PreconditionError to enforce the contract that initial_costate is only defined for Hamiltonian configurations.

Arguments

  • c::AbstractStateConfig: The state configuration.

Throws

  • Exceptions.PreconditionError: Always thrown for state configurations.

See also: CTFlows.Configs.AbstractStateConfig, CTFlows.Configs.AbstractHamiltonianConfig, CTFlows.Configs.initial_costate.

julia
initial_costate(
    c::CTFlows.Configs.AbstractHamiltonianConfig
) -> Any

Return the initial costate for Hamiltonian configurations.

Extracts the initial costate field from the Hamiltonian configuration.

Arguments

  • c::AbstractHamiltonianConfig: The Hamiltonian configuration.

Returns

  • The initial costate vector.

See also: CTFlows.Configs.AbstractHamiltonianConfig.

julia
initial_costate(
    c::CTFlows.Configs.AugmentedHamiltonianEndPointConfig
) -> Any

Return the initial costate for augmented Hamiltonian configurations.

Extracts the initial costate field from the augmented Hamiltonian configuration.

Arguments

  • c::AugmentedHamiltonianEndPointConfig: The augmented Hamiltonian configuration.

Returns

  • The initial costate vector.

See also: CTFlows.Configs.AugmentedHamiltonianEndPointConfig.

initial_state [Function] ​

CTFlows.Configs.initial_state Function
julia
initial_state(c::CTFlows.Configs.AbstractConfig) -> Any

Return the initial state for a configuration (stub method).

This is a stub method on the base AbstractConfig type that throws NotImplemented. Concrete subtypes should implement this method to return their specific initial state.

Arguments

  • c::AbstractConfig: The configuration.

Throws

  • Exceptions.NotImplemented: Always thrown for the base abstract type.

See also: CTFlows.Configs.AbstractConfig.

julia
initial_state(
    c::CTFlows.Configs.AbstractConfigWithMaC
) -> Any

Return the initial state from a configuration.

Extracts the initial state field from the configuration.

Arguments

  • c::AbstractConfigWithMaC: The configuration with mode and content traits.

Returns

  • The initial state vector.

See also: CTFlows.Configs.AbstractConfigWithMaC.

initial_time [Function] ​

CTFlows.Configs.initial_time Function
julia
initial_time(c::CTFlows.Configs.AbstractConfig) -> Real

Return the initial time for a configuration (stub method).

This is a stub method on the base AbstractConfig type that throws NotImplemented. Concrete subtypes should implement this method to return their specific initial time.

Arguments

  • c::AbstractConfig: The configuration.

Throws

  • Exceptions.NotImplemented: Always thrown for the base abstract type.

See also: CTFlows.Configs.AbstractConfig, CTFlows.Configs.final_time.

julia
initial_time(
    c::CTFlows.Configs.AbstractEndPointConfig
) -> Real

Return the initial time for point configurations.

For point configurations, returns the stored t0 field directly.

Arguments

  • c::AbstractEndPointConfig: The point configuration.

Returns

  • Real: Initial time t0.

See also: CTFlows.Configs.AbstractEndPointConfig, CTFlows.Configs.initial_time.

julia
initial_time(
    c::CTFlows.Configs.AbstractTrajectoryConfig
) -> Real

Return the initial time for trajectory configurations.

For trajectory configurations, returns the first element of the stored tspan field.

Arguments

  • c::AbstractTrajectoryConfig: The trajectory configuration.

Returns

  • Real: Initial time t0.

See also: CTFlows.Configs.AbstractTrajectoryConfig, CTFlows.Configs.initial_time.

initial_variable_costate [Function] ​

CTFlows.Configs.initial_variable_costate Function
julia
initial_variable_costate(
    c::CTFlows.Configs.AbstractConfig
) -> Any

Return the initial variable costate for a configuration (stub method).

This is a stub method on the base AbstractConfig type that throws NotImplemented. Concrete subtypes should implement this method to return their specific initial variable costate (if applicable).

Arguments

  • c::AbstractConfig: The configuration.

Throws

  • Exceptions.NotImplemented: Always thrown for the base abstract type.

See also: CTFlows.Configs.AbstractConfig.

julia
initial_variable_costate(
    c::CTFlows.Configs.AugmentedHamiltonianEndPointConfig
) -> Any

Return the initial variable costate for augmented Hamiltonian configurations.

Extracts the initial variable costate field from the augmented Hamiltonian configuration.

Arguments

  • c::AugmentedHamiltonianEndPointConfig: The augmented Hamiltonian configuration.

Returns

  • The initial variable costate vector.

See also: CTFlows.Configs.AugmentedHamiltonianEndPointConfig.

mode_trait [Function] ​

CTFlows.Configs.mode_trait Function
julia
mode_trait(
    _::CTFlows.Configs.AbstractConfigWithMaC{X0, Mode<:CTBase.Traits.AbstractModeTrait, Dyn<:CTBase.Traits.AbstractDynamicsTrait}
) -> Type{Mode} where Mode<:CTBase.Traits.AbstractModeTrait

Return the mode trait type of a configuration.

Extracts the Mode type parameter from the configuration's parametric type, enabling trait-based dispatch on the integration mode (point vs trajectory).

Arguments

  • ::AbstractConfigWithMaC{X0, Mode, Content}: Any concrete configuration subtype.

Returns

  • Type{Mode}: The mode trait type (e.g., EndPointMode or TrajectoryMode).

Example

julia
config = Configs.HamiltonianEndPointConfig(0.0, [1.0], [0.5], 1.0)
Configs.mode_trait(config) === Traits.EndPointMode  # true

See also: CTFlows.Configs.AbstractConfigWithMaC, CTBase.Traits.EndPointMode, CTBase.Traits.TrajectoryMode, CTBase.Traits.dynamics_trait.

output_grid [Function] ​

CTFlows.Configs.output_grid Function
julia
output_grid(_::CTFlows.Configs.AbstractConfig) -> Any

Return the output time grid imposed at the call, or nothing (point configurations, and trajectory configurations built from a time span).

See also: CTFlows.Configs.TimeSpec.

julia
output_grid(
    c::CTFlows.Configs.AbstractTrajectoryConfig
) -> Any

Return the output time grid imposed at the call, or nothing for a time span.

tspan [Function] ​

CTFlows.Configs.tspan Function
julia
tspan(
    c::CTFlows.Configs.AbstractConfig
) -> Tuple{Real, Real}

Return the time span for a configuration (stub method).

This is a stub method on the base AbstractConfig type that throws NotImplemented. Concrete subtypes should implement this method to return their specific time span format.

Arguments

  • c::AbstractConfig: The configuration.

Throws

  • Exceptions.NotImplemented: Always thrown for the base abstract type.

See also: CTFlows.Configs.AbstractConfig.

julia
tspan(
    c::CTFlows.Configs.AbstractEndPointConfig
) -> Tuple{Real, Real}

Return the time span as a tuple for point configurations.

For point configurations, extracts the initial and final times from the t0 and tf fields.

Arguments

  • c::AbstractEndPointConfig: The point configuration.

Returns

  • Tuple{Real, Real}: Time span as (t0, tf).

See also: CTFlows.Configs.AbstractEndPointConfig, CTFlows.Configs.tspan.

julia
tspan(
    c::CTFlows.Configs.AbstractTrajectoryConfig
) -> Tuple{Real, Real}

Return the time span for trajectory configurations.

For trajectory configurations, returns the stored tspan field directly.

Arguments

  • c::AbstractTrajectoryConfig: The trajectory configuration.

Returns

  • Tuple{Real, Real}: Time span as (t0, tf).

See also: CTFlows.Configs.AbstractTrajectoryConfig, CTFlows.Configs.tspan.