MCPcopy Create free account
hub / github.com/NanoComp/meep / cartesian_to_reciprocal

Function cartesian_to_reciprocal

python/geom.py:1603–1609  ·  view source on GitHub ↗
(x, lat)

Source from the content-addressed store, hash-verified

1601
1602
1603def cartesian_to_reciprocal(x, lat):
1604 s = Vector3(*[1 if v == 0 else v for v in lat.size])
1605
1606 m = Matrix(Vector3(s.x), Vector3(y=s.y), Vector3(z=s.z))
1607 Rst = (lat.basis * m).transpose()
1608
1609 return Rst * x if isinstance(x, Vector3) else (Rst * x) * Rst.inverse()
1610
1611
1612def lattice_to_reciprocal(x, lat):

Callers 2

rotate_reciprocalMethod · 0.85
lattice_to_reciprocalFunction · 0.85

Calls 4

Vector3Class · 0.85
MatrixClass · 0.85
transposeMethod · 0.80
inverseMethod · 0.80

Tested by

no test coverage detected