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
7
votes
2 answers

Remove rotation effect when drawing a square grid of MxM nodes in networkx using grid_2d_graph

I need to generate a regular graph (also known as lattice network) which has 100x100 nodes. I started off with drawing a 10x10 graph with the following code: import numpy from numpy import * import networkx as nx from networkx import * import…
FaCoffee
  • 7,609
  • 28
  • 99
  • 174
6
votes
4 answers

Best way to find all points of lattice in sphere

Given a bunch of arbitrary vectors (stored in a matrix A) and a radius r, I'd like to find all integer-valued linear combinations of those vectors which land inside a sphere of radius r. The necessary coordinates I would then store in a Matrix V.…
kram1032
  • 237
  • 1
  • 14
5
votes
2 answers

Get all lattice points lying inside a Shapely polygon

I need to find all the lattice points inside and on a polygon. Input: from shapely.geometry import Polygon, mapping sh_polygon = Polygon(((0,0), (2,0), (2,2), (0,2))) Output: (0, 0), (1, 0), (2, 0), (0, 1), (1, 1), (2, 1), (0, 2), (1, 2), (2,…
Beginner
  • 1,202
  • 2
  • 20
  • 29
4
votes
1 answer

Testing if a given DAG is a lattice

I am given a directed acyclic graph (DAG) with a unique source and sink. Is there an efficient way to test whether the partial order represented by this graph is a lattice? In other words, I need to test whether any two vertices have a unique least…
4
votes
1 answer

How to code an array of FCC, BCC and HCP lattices in C++

How could these structures be represented in an array or vector while still maintaining the lengths between atoms in C++? I would like to construct a three dimensional vector to represent the configuration of: An FCC Lattice. A BCC Lattice A HCP…
NictraSavios
  • 502
  • 2
  • 9
  • 29
4
votes
3 answers

Generate lattice paths in R

For example, if I have a lattice that looks like this: 133.1 / 121 / \ 110 108.9 / \ / 100 99 \ / \ 90 89.1 \ / 81 \ 72.9 Where the lattice starts at 100…
Robin Trietsch
  • 1,662
  • 2
  • 19
  • 31
3
votes
1 answer

Lattice Reduction

I have two matrices A and B with same number of rows. Consider a Lattice generated by the rows of B. I want to reduce B and during the reduction change A accordingly. That is if i-th row and j-th row of B interchanges, need to sweep i-th row and…
user12290
  • 621
  • 1
  • 5
  • 13
3
votes
2 answers

Generating Pythagorean triples using Gaussian (complex) integers

I have only just recently found out about a way of generating Pythagorean triples through this video explaining it, involving the use of Gaussian (complex) integers. I have so far managed to write a function returning a list of Pythagorean triples…
user4891978
2
votes
1 answer

Covering a 2D plotting area with lattice points

My goal is to cover the plotting area with lattice points. In this example we are working in 2D. We call the set Λ ⊆ R^2 a lattice if there exists a basis B ⊆ R^2 with Λ = Λ(B). The set Λ(B) is a set of all integer linear combinations of the basis…
2
votes
1 answer

What is the best way to represent honeycomb lattice?

I am trying to simulate a honeycomb lattice, I.e, each particle interacts with each of it's 3 neighbors. I want to represent in array such that it is automated. I.e, if any atom is picked at random, code should evaluate some parameter based on…
2
votes
3 answers

Points on a Lattice

I got this question on a coding interview. Hanna moves in a lattice where every point can be represented by a pair of integers. She moves from point A to point B and then takes a turn 90 degrees right and starts moving till she reaches the first…
2
votes
0 answers

Finding the smallest (sparsest) solution of a matrix equasion

I plan solving a SLE of a standard form Ax = b, in integers, using LUP-decomposition, using only one thread. A is a matrix of a size about n3 × 2n3, n ≈ 100 (the more the better though). Matrix is really sparse - each column has only 4 non-zero…
mike239x
  • 205
  • 3
  • 11
2
votes
0 answers

Determining unique, site-labeled, lattice-trees (polynomino-like lattice-embedded graphs); not quite polyomino hashing

I am trying to construct a hash of some not-quite polyomino lattice (more bond animal like (see comment at the end) embedded graphs (examples below), but have been running into some problems. For standard polyominos, we have lattice-embedded graphs…
Hobbes
  • 61
  • 4
2
votes
1 answer

Plot lattice tree in Python

I'm seeking ideas to plot a tuple tree t = ((4,), (3, 5,), (2, 4, 6,), (1, 3, 5, 7,)) as the following image (assuming this binomial tree size can change). I'm trying to avoid dependencies on non-core packages (just sticking to pandas, numpy,…
2
votes
0 answers

Is the Fibonacci lattice the very best way to evenly distribute N points on a sphere? So far it seems that it is the best

Over in the thread "Evenly distributing n points on a sphere" this topic is touched upon: Evenly distributing n points on a sphere. But what I would like to know is: "Is the Fibonacci lattice the very best way to evenly distribute N points on a…
1
2 3 4