Skip to content

Approximation

This is very much WIP

Dimensions, free variables, constants and boundary conditions are defined and an approximation object is created

Semantics

Notes

subsection for each circuit - first atomics then operators

we might need to change the networks to allow stochs?? or are we okay in multi dimensions??

what about the categorical isomorphism - do we need any of them?

separate sections for the different semantics: Riemann, Strato(Ito?) what we have done now is the Riemann semantics

It looks like the below semantics will work for stratonovich as well - given that the usual \(\frac{1}{n}t^n\) anti-deriv rule works and the \(n t^{n-1}\) deriv rule works...

Network Semantics

Given a dimension \(n \in \mathbb{R}\) a network is a function \(s : \mathbb{N}^n \rightarrow \mathbb{R}\). The network represents the coefficients of a polynomial, which is a polynomial approximation of the solution.

Atomic circuits

Id

For \(a : \mathbb{N}^n \rightarrow \mathbb{R}\) and \(i \in \mathbb{N}^n\)

\[ (id(a))(i) = a(i) \]

Scalar

For \(a : \mathbb{N}^n \rightarrow \mathbb{R}\), \(i \in \mathbb{N}^n\) and \(s \in \mathbb{R}\)

\[ (s \cdot a) (i) = s*i \]

Addition

For \(a, b : \mathbb{N}^n \rightarrow \mathbb{R}\) and \(i \in \mathbb{N}^n\)

\[ (a + b)(i) = a(i) + b(i) \]

Multiplication

For \(a, b : \mathbb{N}^n \rightarrow \mathbb{R}\), \(i \in \mathbb{N}^n\)

\[ (a \cdot b)(i) = \sum_{i_1 + i_2 = i} a(i_1) b(i_2) \]
Algorithm

How to do it in matrix representation format

Composition

For \(v \in \mathbb{N}^n\) let \(|v| = \sum_{k=1}^n v_k\).

In one-dimension: For \(a, b : \mathbb{N} \rightarrow \mathbb{R}\), \(n \in \mathbb{N}\)

\[ (a \circ b)(n) = \sum_{i \in \mathbb{N}} a(i) (\sum_{w \in \mathbb{N}^i, |w|=n} \prod_{j=1}^i b(v_j)) \]

Approximation: For \(a, b : [ 0 , ... , P ] \rightarrow \mathbb{R}\), \(n \in \mathbb{N}\)

\[ (a \circ b)(n) = \sum_{i=0}^{P} a(i) (\sum_{v \in \mathbb{N}^i, |v|=n} \prod_{j=1}^i b(v_j)) \]

In \(N\) dimensions: For \(a, b : \mathbb{N}^N \rightarrow \mathbb{R}\), \(n \in \mathbb{N}^N\), \(M \in [1, .., N]\)

\[ \begin{split} (a \circ b)(n) = \sum_{i \in \mathbb{N}} (\sum_{v_1 \in \mathbb{N}^{i+1}, |v_1| = n_1} \cdots \sum_{v_M \in \mathbb{N}^{i+1}, |v_M| = n_M+i,v_M(0)=i} \cdots \sum_{v_N \in \mathbb{N}^{i+1}, |v_N| = n_N}\\ a(\langle v_1(0), ... , v_N(0) \rangle) \prod_{j=1}^i b(\langle v_1(j), ... , v_N(j) \rangle)) \end{split} \]

Approximation: For \(a, b : \times_{i=1}^N [ 0 , ... , P_i ] \rightarrow \mathbb{R}\), \(n \in \mathbb{N}^N\), \(M \in [1, .., N]\)

\[ \begin{split} (a \circ b)(n) = \sum_{i=0}^{P_M} (\sum_{v_1 \in \mathbb{N}^{i+1}, |v_1| = n_1} \cdots \sum_{v_M \in \mathbb{N}^{i+1}, |v_M| = n_M+i,v_M(0)=i} \cdots \sum_{v_N \in \mathbb{N}^{i+1}, |v_N| = n_N}\\ a(\langle v_1(0), ... , v_N(0) \rangle) \prod_{j=1}^i b(\langle v_1(j), ... , v_N(j) \rangle)) \end{split} \]
Algorithm

Either by recursion or by enumeration.

Recursion:

function do_dimension(N, ii, i, v, k)
  if N == 0
    r = a[v[0]]
    for j=1 to ii
      r = r*b[v_j]
    return r
  fi
  if i == 0
    return do_dimension(N-1, ii, ii, v, n[N-1])
  fi
  if (i == 1) || ((i == 2) && (N == M+1))
     v[i - 1, N] += k
     if i == 2
       v[0, M] += (ii-1)
     fi
     return do_dimension(N, ii, i-1, v, 0)
  fi
  sum = 0.0
  for j = 0 to k doe
    v[i, N] = j
    sum += do_dimension(N-1, ii, i-1, v, k-j)
  done
  return sum

convolution(a, b, n, M, N)
  ab = 0.0
  if n[M] == 0
     ab += a[n]
  fi
  for i = 1 to P_M do
    v = [v_0, ... , v_i] =
          [[v_10, ... , v_1N], ... ] =
          [[0, ... , 0], ... ]
    ab += do_dimension(N, i + 1, i + 1, v, n[N])
  done
  return ab

Enumeration:


Copy

For \(a, : \mathbb{N}^n \rightarrow \mathbb{R}\) and \(i \in \mathbb{N}^n\)

\[ (\Delta(a))(i) = a(i) \]

Register

For \(m \in \mathbb{N}\), \(a : \mathbb{N}^n \rightarrow \mathbb{R}\), \(i \in \mathbb{N}^n\)

\[ R_m(a)(i) = \left\{ \begin{array}{cc} 0 & i_m = 0\\ \frac{1}{i_m} a(\hat{i}) & i_m > 0 \end{array} \right. \]

where \(\hat{i}_k = i_k\) for \(k \neq m\) and \(\hat{i}_m = i_m-1\)

De-Register

For \(m \in \mathbb{N}\), \(a : \mathbb{N}^n \rightarrow \mathbb{R}\), \(i \in \mathbb{N}^n\)

\[ D_m(a)(i) = (i_m+1) a(\hat{i}) \]

where \(\hat{i}_k = i_k\) for \(k \neq m\) and \(\hat{i}_m = i_m+1\)

Power function

Square root function

Structural operators

Composition

For \(s, t : (\mathbb{N}^n \rightarrow \mathbb{R}) \rightarrow (\mathbb{N}^n \rightarrow \mathbb{R})\) and \(a : \mathbb{N}^n \rightarrow \mathbb{R}\)

\[ (s \circ t) = s(t(a)) \]

Monoidal

For \(s, t : (\mathbb{N}^n \rightarrow \mathbb{R}) \rightarrow (\mathbb{N}^n \rightarrow \mathbb{R})\) and \(a, b : \mathbb{N}^n \rightarrow \mathbb{R}\)

\[ (s \otimes t)\langle a , b \rangle = \langle s(a), r(a) \rangle \]

Trace

For \(s : (\mathbb{N}^n \rightarrow \mathbb{R})^c \rightarrow (\mathbb{N}^m \rightarrow \mathbb{R})^d\), \(a : \mathbb{N}^n \rightarrow \mathbb{R}\) and \(i \in \mathbb{N}^n\)

\[ Tr_k(s)(i) = Tr_k(s)(\langle n_1 , ... , n_{c-e}, ....\rangle) \]

given that \(0 < e < c,d\) and \(c, d > 1\).