Written on 2018-02-10
The symbol Zn denotes the set of all coordinate n-tuples with integer components. These are one kind of n-dimensional lattice.
Given two points s=(s1,…,sn) and e=(e1,…,en), their taxicab distance is ‖s−e‖1:=n∑i=1|si−ei|.
Given a complex number z, we denote its normalization as N(z):={0if z=0,z/|z|otherwise.
A staircase path between two points, informally, is any path by going only right or up.
Formally, given the starting point s∈Zn and ending point e∈Zn with s≤e (i.e., each component of s is less than or equal to each corresponding component of e), a staircase path is a sequence of ℓ:=1+‖s−e‖1 coordinates σ0,…,σℓ with the following facts:
σ0=s,
s≤σk≤e (in the sense described above), and
exactly one component of σk+1−σk is 1, with the other n−1 components equal to 0.
Denote the set of all staircase paths from s to e as {s→e}.
Part 1: Verify that facts 1–3 imply σℓ=e.
Next, consider the set Tm×n defined as n×m matrices whose entries are complex numbers of unit modulus. For consistency with the above, let's suppose the bottom-left element of each matrix is identified by (1,1) and top-right element is (n,m).
Part 2: Implement the function f:Tm×n→T∪{0} defined by f(M):=N(∑Σ∈{(1,1)→(m,n)}∏(x,y)∈ΣMx,y).
Extra Credit: Generalize f to work on a tensor of any order.