QPMS
Electromagnetic multiple scattering library and toolkit.
|
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 | |
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.
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
def qpms.lattices2d.classifyLatticeSingle | ( | b1, | |
b2, | |||
tolerance = 1e-13 |
|||
) |
Given two basis vectors, returns 2D Bravais lattice type. Tolerance is relative. TODO doc
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.
def qpms.lattices2d.filledWS | ( | b1, | |
b2, | |||
density = 10 , |
|||
scale = 1. |
|||
) |
TODO doc TODO more intelligent generation, anisotropy balancing etc.
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
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?
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