Questions tagged [mathematical-lattices]

A lattice is a discrete subgroup of the n-dimensional Euclidean space R^n.

A lattice is a discrete subgroup of the n-dimensional Euclidean space R^n.

The Shortest Vector Problem (SVP) and the Closest Vector Problems (CVP) are NP-hard lattice problems.

49 questions
1
vote
2 answers

Number of parallelograms on a NxM grid

I have to solve a problem when Given a grid size N x M , I have to find the number of parallelograms that "can be put in it", in such way that they every coord is an integer. Here is my code: /* ~Keep It Simple!~ */ #include #define…
1
vote
1 answer

How to draw a regular lattice in R?

I'm new to R and want to construct a regular lattice with 30 nodes and k=4 (neighborhood connectivity). I've tried the igraph package with graph.lattice function, but cannot produce what I'm looking for.
Issac
  • 51
  • 5
0
votes
0 answers

Why is my thermal lattice boltzmann model ignoring the source term? Attempting to model one-phase stefan problem (phase change)

Why is my LBM code ignoring the source term? I am trying to solve the one-phase stefan problem of freezing using a D2Q5 lattice with an iterative enthalpy method. Any advice would be appreciated. The code is below. #Thermal LBM #solves 1D 1 phase…
Gwen
  • 11
0
votes
0 answers

Improving a clumsy automatic cuboid domain decomposition algorithm

Introduction For my library, I need to split up a cuboid point lattice for assignment to multiple processing elements (PEs). As you can see, no points are shared between the PEs, and certain PEs (here 4-7) get only 2D 'slices'. The interface…
0
votes
1 answer

Explanation for magic numbers in lattice Boltzmann simulation?

I recently came across this fluid dynamics simulation and have been trying to read up on the lattice Boltzmann method in order to better understand it. Most of the code there is pretty transparent, so between just reading the code and reading…
Logan R. Kearsley
  • 682
  • 1
  • 5
  • 19
0
votes
1 answer

Can I do a mathematical-shape mask for a (Nx,Ny) matrix?

I have a matrix of numbers (Nx,Ny) and I would like to select from that matrix a mathematical shape coordinates/components as it could be a line with a given slope. I learned how to create a mask and how to do it in a random way but I cannot think…
Nankin
  • 45
  • 7
0
votes
0 answers

Python - faster alternative to 'for' loops

I am trying to construct a binomial lattice model in Python. The idea is that there are multiple binomial lattices and based on the value in particular lattice, a series of operations are performed in other lattices. These operations are similar to…
0
votes
1 answer

Lattice su(2) gauge theory and random number generation in python

I'm currently writing a simple program in python to simulate 1 + 1 dimensional SU(2) yang mills theory. For the case of SU(2) there exists a particular heatbath algorithm for updating the Link variables. In order to implement this algorithm however…
0
votes
1 answer

How to propagate two vectors u and v to fill a rectangle box in an efficient way

For illustration purpose, see image below. Given a point p and two vectors u and v, we can get a linear combination of u and v, t = m*u + n*v, m and n are integer, and t should be within the box. Solve this problem is not too difficult. As m and n…
Jiadong
  • 1,822
  • 1
  • 17
  • 37
0
votes
1 answer

How to implement LLL Lattice Reduction in NTL using c++?

I am using C++ to do a research. And I am interested to know how to use the LLL function in NTL to find the shortest vector. My code is as follow; #include #include #include #include using…
Ivan Feng
  • 1
  • 2
0
votes
0 answers

How to check if elements form a primitive system of a lattice

Given a collection of vectors $V = {v_1, v_2, ..., v_k}$ belonging to a lattice $L$ with basis $B$, is there an efficient procedure that can determine whether or not $V$ forms a primitive system for $L$? This means that if $L$ has rank $n \geq k$,…
0
votes
0 answers

Find index of an ordered set of N elements

Problem description: A set of lists of N integers i1,i2,....,iN with 0<= i1<=i2<=i3<=....<=iN <=M, is created by starting with one integer 0<=i1<=M, and repeatedly adding one integer that is greater or equal to the last integer added. When adding…
0
votes
0 answers

Plotting interactive lattice in a simulation matlab

I'm running a simulation that describes activity at the front and back of a 2D, square lattice. the front and back are described for example by: front= [-1 1 -1 0 1 0 1 2 -2 1 ]; back = [ 1 0 0 0 2 0 1 -2 -2 1 ]; each number indicates different…
jarhead
  • 1,821
  • 4
  • 26
  • 46
0
votes
1 answer

Optical Lattice in MATLAB

I am writing the script to plot the following pic The following code works fine and plot the same shape as above, without spheres. clear all PS=zeros(100,100); A=2.4; B=3.4; for i=1:100 for j=1:100 PS(i,j) =…
Adrian
  • 13
  • 1
0
votes
0 answers

Setting the number of edges in igraph_ring c++

I am trying to use the igraph Graph Generator igraph_ring to create a ring lattice, in which each node is connected with n neighbors to the left and right. However, the method does not accept any arguments for the number of edges, i.e. I can only…
Niccola Tartaglia
  • 1,537
  • 2
  • 26
  • 40