graphics – How to get neighbor lists in the same order/orientation from a periodic IGTriangularLattice[] graph?

Using IGraphM, I want to get the VertexComponent() neighbors around all nodes, in a periodic IGTriangularLattice() graph. To do that, I do:

(*Dimensions of the graph*)
i = 5;
j = 5;
(*Graph and neighborhoods distance {1} from each node*)
myPeriodicGraph = 
  IGTriangularLattice({i, j}, VertexLabels -> "Name", 
   "Periodic" -> True,
   VertexCoordinates -> GraphEmbedding(IGTriangularLattice({i, j})));
allNeighbors = 
  Table(VertexComponent(myPeriodicGraph, i, {1}), {i, 1, 
    VertexCount(myPeriodicGraph)});

enter image description here

Now, just to visualize the order in which VertexComponent() gives the neighborhoods, I have a list of colors to highlight these neighbors for any given focal cell:

colorNeighbors = {Red, Lighter(Red), Lighter(Lighter(Red)),
   Blue, Lighter(Blue), Lighter(Lighter(Blue))}

enter image description here

Okay, let’s see one particular neighborhood:

focalNode = 13;
GraphPlot(myPeriodicGraph, 
 VertexStyle -> (Rule(#((2)), #((1))) & /@ 
    Transpose({colorNeighbors, allNeighbors((focalNode))})))

enter image description here

You can see that the Red() tones are these neighbors to the “right” of the focalNode, and the Blue() tones are these to the left. But this is not always the case! Especially when we query one of the nodes sitting at the “edges” of the graph (edge in spatial coordinates; topologically this is a “periodic” space).

focalNode = 23;
GraphPlot(myPeriodicGraph, 
 VertexStyle -> (Rule(#((2)), #((1))) & /@ 
    Transpose({colorNeighbors, allNeighbors((focalNode))})))

enter image description here

You can see that the colors are now “disorganized”. The same if you query other boundary nodes, and they disorganize in different ways:
enter image description here

So, my question is, can I get the neighborhoods in a way that they are always oriented in the same order? Let’s say I have a canonical ordering: {W, NW, NE, E, SE, SW}, can I always get this order, no matter where the queried focalNode is? (below an example from a ‘central’ node, a node on the edge of the graph should preserve the orientation of the list of neighbors).
enter image description here

Thanks!

ra.rings and algebras – More vocabulary for periodic elements in monoids

Let $M$ be a monoid, and let $xin M$. One says that $x$ is periodic if
$$x^{i+j}=x^j$$
for some integers $igeq 1$ and $jgeq 0$.

An easy division algorithm argument shows that if $m$ is the smallest value of $i$ where this happens (for some $j$), and similarly $n$ is the smallest value of $j$ where this happens (for some $i$), then $x^{m+n}=x^n$. (So those minimal values work together.)

Moreover, given such an $m$ and $n$, the displayed equality holds if and only if $m|i$ and $nleq j$.

Question 1: Is there a standard reference for these basic facts in the monoid setting?

Question 2: Is there a standard name for $m$ and $n$?

Question 3: Are there special names for the periodic property when $n=0$ or when $n=1$? (I’ve seen them called “torsion units” and “potents” (generalizing “idempotents”) in the ring-theoretic setting.)

reactjs – Where should I put/handle periodic data updates in React?

I’m following the guide in https://reactjs.org/docs/thinking-in-react.html which makes sense for data that I request and update on a filter.

However, I want to have some sort of general synchronization job in the background that polls and updates an SQLite database periodically.

The question I have is if the SQLite database has detected that there was an update, how do I signal to a list component that it needs to refresh itself?

Notes:

I am thinking if it was in a context it will trigger a re-render of every component underneath it which may be problematic if I have something like a data entry form since a re-render will cause my focus to be lost

In vue land we have emit to emit custom events, but I don’t see anything like that in the API guide for React

Another approach I was thinking of was to useReducer, but it didn’t pan out on the context because it will also cause a re-render just like useState

Then I thought of having the reducer on the filtered table component but then I don’t know how to trigger it from the context.

Correlating the von Mangoldt function with periodic sequences, or the expansion of itself really

The Dirichlet inverse of the Euler totient function is:
$$varphi^{-1}(n) = sum_{d mid n} mu(d)d tag{1}$$
Consider the sequences:
$$a(n)=sum _{k=1}^{j} frac{varphi^{-1}(gcd (n,k))}{k}$$
$$b(n)=sum _{k=1}^{j+1} frac{varphi^{-1}(gcd (n,k))}{k}$$

Question:

For what values of $j$ does $b(n)$ eventually correlate better than $a(n)$ with the von Mangoldt function $Lambda(n)$ as $n rightarrow infty$?

The exceptions of $j$ when $b(n)$ correlates worse than $a(n)$ appears to be:
$$j=7, 15, 24, 26, 31$$ which when added with $1$ gives initially a sequence of powers of some sort:
$$j+1=8, 16, 25, 27, 32$$

A very slow Mathematica program that computes the sequences and compares their Pearson correlation with the von Mangoldt function is:

Clear(a, n, k, start, end)
nnn = 400;
a(n_) := Total(Divisors(n)*MoebiusMu(Divisors(n)));
Do(
 column = j;
 earlier = 
  Table(Correlation(
    Table(Sum(a(GCD(n, k))/k, {k, 1, column}), {n, 1, nn}), 
    Table(N(MangoldtLambda(n)), {n, 1, nn})), {nn, 2, nnn});
 later = Table(
   Correlation(
    Table(Sum(a(GCD(n, k))/k, {k, 1, column + 1}), {n, 1, nn}), 
    Table(N(MangoldtLambda(n)), {n, 1, nn})), {nn, 2, nnn});
 sign = Sign(later - earlier);
 Print(Count(sign, 1)), {j, 2, 32})

nnn = 400; is considered a large number that serves as the substitute for infinity in the program.

nt.number theory – Periodic Gauss hypergeometric function

I stumbled upon the following identity, which I have not tried to prove, but seems true:
the function $$f(t):={}_2F_1(1/2,2t;1-t;4)$$
is periodic of period 1, and more precisely
$$f(t)=dfrac{2+3e^{2pi it}+2e^{4pi it}-e^{6pi it}}{3(e^{2pi it}+e^{6pi it})};.$$
This begs several questions:

(1). Is this true? (2). Are there other (infinitely many?) formulas of this type (of course outside of trivial manipulations of this) ? (3) More generally, call a function $f(t)$ scale-periodic if there exists $A>0$ such that $A^{-t}f(t)$ is $1$-periodic (so periodic if $A=1$). I have found a number of such $f(t)$ of the form ${}_2F_1(a(t),b(t);c(t);z)$: is there some way to find them? (this last question was inspired by a paper of Beukers and Forsgard arXiv:2004.08117).

differential equations – Continuity of the period for a periodic dynamical system

Let $vinmathcal{C}^1(mathbb{R}^n,mathbb{R}^n)$ $(ngeq 1)$ a velocity field such that every solution $(x_t)_{tgeq 0}$ of $(d/dt)x_t=f(x_t)$ is periodic. Denote, for a non-stationary point $xinmathbb{R}^n$ (meaning $v(x)neq0$), by $T(x)$ the period of such a solution $(x_t)_{tgeq0}$ such that $x(0)=x$.

Quetion: Is $T$ continuous over the set of non-stationnary points?.

pr.probability – Lemma 3.10 of paper ‘Periodic nonlinear Schrodinger Equation and Invariant measure’ by J.Bourgain

I am reading a paper ‘Periodic nonlinear Schrodinger Equation and Invariant measure’ by J.Bourgain. And I have two questions on the lemma 3.10.

enter image description here

  1. My first question is to get (3.12).

What I have up to now is as below.

begin{align*}
lambda sigma_M &< left| sum_{n~ M} frac{g_n(omega)}{M} e^{inx} right|_p \
&leq left| sum_{n~ M} frac{g_n(omega)}{n} e^{inx} right|_p\
&leq M^{frac{1}{2}-frac{1}{p}} left| sum_{n~ M} frac{g_n(omega)}{M} e^{inx} right|_2\
&leq M^{frac{1}{2}-frac{1}{p}} B
end{align*}

Thus, we get
$$sigma_M frac{lambda}{B}<M^{frac{1}{2}-frac{1}{p}}$$

In order to have (3.12), I would need to remove $sigma_M$ by using (3.14) but it seems like I went too far to use it. I will be happy to have any idea on this inequality.

  1. My one another question is if there is any reference to understand this line in the proof of same lemma.

enter image description here

Thanks in advance.

vector spaces – Is the set of periodic functions from $mathbb{R}$ to $mathbb{R}$ a subspace of $mathbb{R}^mathbb{R}$? Is my answer ok? (Linear Algebra Done Right)

I am reading “Linear Algebra Done Right 3rd Edition” by Sheldon Axler.

This book contains the following exercise:

A function $f:mathbb{R}tomathbb{R}$ is called periodic if there exists a positive number $p$ such that $f(x) = f(x+p)$ for all $xinmathbb{R}$. Is the set of periodic functions from $mathbb{R}$ to $mathbb{R}$ a subspace of $mathbb{R}^mathbb{R}$? Explain.

I solved this exercise, but I am not sure that my answer is correct because my answer is too simple.
Is the following answer of mine right or not?

Define the function $f:mathbb{R}tomathbb{R}$ by $f(x) = 0$ for $xinmathbb{R}setminusmathbb{Z}$ and $f(x) = 1$ for $xinmathbb{Z}$.
Define the function $g:mathbb{R}tomathbb{R}$ by $g(x) = 0$ for $xinmathbb{R}setminussqrt{2},mathbb{Z}$ and $g(x) = 1$ for $xinsqrt{2},mathbb{Z}$.
$f$ is a periodic function whose period is $1$.
$g$ is a periodic function whose period is $sqrt{2}$.
Since $0inmathbb{Z}capsqrt{2},mathbb{Z}$, $(f+g)(0)=f(0)+g(0)=1+1=2$.
Let $p$ be any positive real number.
Since $pnotinmathbb{Z}capsqrt{2},mathbb{Z}$, so $(f+g)(0+p)=(f+g)(p)=f(p)+g(p) < 2$.
So, $(f+g)(0)neq (f+g)(0+p)$ for any positive real number $p$.
So, the function $f+g$ is not periodic.

soft question – How can I smoothly transform one periodic function into another if the period time is allowed to differ?

How can I smoothly transform one periodic function into another if the period time is allowed to differ?

Let us visit the very simplest example I can think of : Two audio signals pure sine waves.

Note A ($440$ Hz) and C ($523$ Hz).
There are probably many ways we can morph first into the other.


Own work:
Maybe the most straight forward solution would be : $$sin((alpha(t) f_1 + (1-alpha(t))f_2)t )\ t to alpha(t)\ tin (0,1)\alpha(t) in (0,1)$$
And $alpha$ monotonically smoothly increasing.

This one is nice in the sense that we don’t need to leave the set of $tto sin(ft)$ functions.

Maybe there exist other smooth solutions?

How could we express those?