QPMS
Electromagnetic multiple scattering library and toolkit.
Data Structures | Functions | Variables
qpms.lattices2d Namespace Reference

Data Structures

class  LatticeType
 

Functions

def reduceBasisSingle (b1, b2)
 
def shortestBase3 (b1, b2)
 
def shortestBase46 (b1, b2, tolerance=1e-13)
 
def is_obtuse (b1, b2, tolerance=1e-13)
 
def classifyLatticeSingle (b1, b2, tolerance=1e-13)
 
def range2D (maxN, mini=1, minj=0, minN=0)
 
def generateLattice (b1, b2, maxlayer=5, include_origin=False, order='leaves')
 
def generateLatticeDisk (b1, b2, r, include_origin=False, order='leaves')
 
def cellCornersWS (b1, b2)
 
def cutWS (points, b1, b2, scale=1., tolerance=1e-13)
 
def filledWS (b1, b2, density=10, scale=1.)
 
def reciprocalBasis1 (*pargs)
 
def reciprocalBasis2pi (*pargs)
 
def filledWS2 (b1, b2, density=10, scale=1.)
 
def change_basis (srcbasis, destbasis, srccoords, srccoordsaxis=-1, lattice=True)
 

Variables

 nx = None
 

Detailed Description

These functions are mostly deprecated by the C counterparts from lattices.h.
This file is still kept for reference, but might be removed in the future.

Function Documentation

◆ cellCornersWS()

def qpms.lattices2d.cellCornersWS (   b1,
  b2 
)
Given basis vectors, returns the corners of the Wigner-Seitz unit cell
(w1, w2, -w1, w2) for rectangular and square lattice or
(w1, w2, w3, -w1, -w2, -w3) otherwise

◆ classifyLatticeSingle()

def qpms.lattices2d.classifyLatticeSingle (   b1,
  b2,
  tolerance = 1e-13 
)
Given two basis vectors, returns 2D Bravais lattice type.
Tolerance is relative.
TODO doc

◆ cutWS()

def qpms.lattices2d.cutWS (   points,
  b1,
  b2,
  scale = 1.,
  tolerance = 1e-13 
)
From given points, return only those that are inside (or on the edge of)
the Wigner-Seitz cell of a (scale*b1, scale*b2)-based lattice.

◆ filledWS()

def qpms.lattices2d.filledWS (   b1,
  b2,
  density = 10,
  scale = 1. 
)
TODO doc
TODO more intelligent generation, anisotropy balancing etc.

◆ range2D()

def qpms.lattices2d.range2D (   maxN,
  mini = 1,
  minj = 0,
  minN = 0 
)
"Triangle indices"
Generates pairs of non-negative integer indices (i, j) such that
minN ≤ i + j ≤ maxN, i ≥ mini, j ≥ minj.
TODO doc and possibly different orderings

◆ reduceBasisSingle()

def qpms.lattices2d.reduceBasisSingle (   b1,
  b2 
)
Lagrange-Gauss reduction of a 2D basis.
cf. https://www.math.auckland.ac.nz/~sgal018/crypto-book/ch17.pdf
inputs and outputs are (2,)-shaped numpy arrays
The output shall satisfy |b1| <= |b2| <= |b2 - b1| 
TODO doc

TODO perhaps have the (on-demand?) guarantee of obtuse angle between b1, b2?
TODO possibility of returning the (in-order, no-obtuse angles) b as well?

◆ shortestBase3()

def qpms.lattices2d.shortestBase3 (   b1,
  b2 
)
returns the "ordered shortest triple" of base vectors (each pair from 
the triple is a base) and there may not be obtuse angle between b1, b2
and between b2, b3