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
2
votes
1 answer

How to render a general lattice with D3JS?

I am looking to an algorithm or layout to be implemented in D3JS to render a graph of a "general" lattice, a lattice that is not (necessarily) binomial. An example of the kind of result I would like to obtain is: I want to visualize the lattice as…
enridaga
  • 631
  • 4
  • 9
1
vote
1 answer

How can I crop the white space of an image using EmguCV and windows form

My project need to crop the image automatically to remove the white space around the drawing (Lattice). Here is my code grayImage = grayImage.ThresholdBinary(new Gray(threshold), new Gray(255)); VectorOfVectorOfPoint contours = new…
1
vote
3 answers

How to create a function with a variable number of 'for' loops, each with a distinct index?

The Problem: Consider a d-dimensional simple cubic lattice. If the lattice has width L, then the number of lattice sites is Ld. I want to create a list that contains all the positions of the lattice sites, for a general d and L. For example, when L…
1
vote
0 answers

Get all points with integer coordinates inside a Shapely polygon

I have a polygon that looks like this: I am trying to get the integer coordinates of the inside. I tried to use this to get the interior and exterior coords: (from https://stackoverflow.com/a/21922058/5666087) def extract_poly_coords(geom): if…
vftw
  • 1,547
  • 3
  • 22
  • 51
1
vote
1 answer

Define a connectivity graph in Prolog

I'm continuing some researches in lattices and semilattices and suddenly having this question. Basically, we have a RelationList of [a,b] pairs, which means that (a,b) is an edge. Now we should know, is a graph formed by this RelationList…
1
vote
1 answer

Trying to map a 2 D hexagonal lattice point for convex hull study

I am trying to map a 2 D hexagonal lattice point for convex hull study. But I can only get rectangular lattice. Here is the code: Map a hexagonal lattice on a 2D plane u = 0:1:100; if mod(u,2) == 0; v = 0:2*sqrt(3):50*sqrt(3); else v =…
1
vote
1 answer

Scaling factor of n-dim fft in numpy

I have an image of a grid of holes. Processing it with numpy.fft.fft2 yields a nice image where I can clearly see periodicity, base vectors etc. But how can I extract the lattice spacing? The lattice points in real-space have a spacing of about…
user3696412
  • 1,321
  • 3
  • 15
  • 33
1
vote
1 answer

Generating centered hexagonal lattice

I want to create a hexagonal lattice but it should be centered basically the whole lattice is a central hexagon and then layers of hexagon around, like shown in the figure. (may be my description is confusion, but right now that is how I am seeing…
jkhadka
  • 2,443
  • 8
  • 34
  • 56
1
vote
1 answer

FCC 100 and 111 lattice C code

I am trying to make FCC 100 and FCC 111 crystal lattice using C code. I have configured FCC 100 lattice and I made it correctly. However, when I tried to make FCC 111 lattice and it looks different from what I expect. I use the reference FCC 111…
veera
  • 11
  • 6
1
vote
0 answers

How to refer the center of a giant component to an external coordinate system?

I am working in Python (package: NetworkX) with a network of, say, 100 nodes. I create it and then fragment it by removing a fraction of its nodes (removal), as shown below. The script computes the length of the largest component and its center…
FaCoffee
  • 7,609
  • 28
  • 99
  • 174
1
vote
0 answers

Alternating triangulation pattern on square lattice

I have an array of points in python making a square lattice. I want to triangulate it like this: so that the braces alternate in a checkerboard pattern from square to square. My attempts have been based on deforming it before triangulation. For…
NPMitchell
  • 193
  • 1
  • 10
1
vote
1 answer

Reflect a point on a lattice across a plane

I have a lattice three dimensional lattice of size lx * ly * lz with periodic boundary conditions on all three sides. My planar symmetry cuts are two horizontal and vertical planes (slope 0 and inf) plus two diagonal cuts (slope -1 and +1)…
PyariBilli
  • 501
  • 1
  • 7
  • 17
1
vote
1 answer

How to use qflll() in the PARI library?

I wanted to use the function qflll from the PARI library in python, so I downloaded pari-python-cygwin-0.1.zip, however when I attempted to use qflll in python, i.e. qflll([[1,0,0],[0,1,0],[0,0,1]]) I got this error message Traceback (most recent…
meta_warrior
  • 389
  • 1
  • 6
  • 18
1
vote
1 answer

code for LLL algorithm in pari/gp

I know that in PARI/GP the function qflll performs LLL algorithm on a set of bases. However, is it possible for me to look at the code for qflll in the PARI/GP library? Or does anyone know how does the LLL algorithm work in the PARI/GP library?
meta_warrior
  • 389
  • 1
  • 6
  • 18
1
vote
1 answer

Plot a igraph object on a torus

I have a lattice that is wrapped on a torus (each nodes on the end of the graph are linked to their opposite on the grid). require("igraph") require("rgl") n = 10 g = graph.lattice(c(n,n)) # create a square lattice (nxn) plot(g,vertex.size =…
David
  • 326
  • 1
  • 11