noise

behaviour.noise

What a Noise record does: its two derived dispersions, its symbolic form, its code generation, and its pytree.

A noise process is declared once and read by every backend, so sigma and nsig are two spellings of one quantity and each is derived from the other where only one is written. The record carries no cache: everything here is computed from the declared parameters, which is what makes a noise safe to serialize back out unchanged.

Classes

Name Description
NoiseBehaviour Everything a declared noise process does, on both generated forms.

NoiseBehaviour

behaviour.noise.NoiseBehaviour()

Everything a declared noise process does, on both generated forms.

A JAX leaf as well as a record: a runtime per-state sigma_vec is the one child, so a sweep can vmap over it while the declared spec stays static metadata.

Attributes

Name Description
LEAVES The runtime per-state sigma vector, exposed as the single array child so it can participate in vmap batching.
STANDARD_EQUATIONS The process each canonical noise type names, as (lhs, rhs).
canonical_type The declared noise type under its canonical spelling, None when none is declared.
equation_of_record The equation this noise runs, declared or standard.
nsig The noise dispersion nsig, \(0.5\,\sigma^2\) of the amplitude sigma reads.
sigma The noise standard deviation sigma, read by tvbo.utils.noise_sigma: a declared sigma as written, else \(\sqrt{2\,nsig}\).
sigma_vec The per-state sigma a run is using, or None before one sets it.
symbolic The right-hand side of the process this noise runs, as a SymPy expression.

Methods

Name Description
execute Render, execute, and return the backend’s noise class.
render_code Render the noise as source code for the requested backend.
execute
behaviour.noise.NoiseBehaviour.execute(format='tvb')

Render, execute, and return the backend’s noise class.

Parameters
Name Type Description Default
format Target backend passed through to code generation. 'tvb'
Returns
Name Type Description
The executed backend noise object.
render_code
behaviour.noise.NoiseBehaviour.render_code(format='tvb')

Render the noise as source code for the requested backend.

Parameters
Name Type Description Default
format Target backend; "tvb" selects the TVB template, while "autodiff" or "jax" selects the JAX template. 'tvb'
Returns
Name Type Description
The rendered source code as a string.