Represents a point in two or three dimensions. Normally, I’d use a namedtuple, because I’m not a psychopath, but I want to use default arguments without getting too fancy. Each point can also contain a value denoting the error which an ErrorModel has applied to that point, and/or a syndrome which results from measurement of an ErrorCorrectingCode on the lattice.
Parameters: |
|
---|
A collection of points. Superclass to SquareLattice, SquareOctagonLattice, UnionJackLattice, whatever other convenient lattices I put in.
Represents a arbitrary-dimensional lattice of points with integer co-ordinates on which a stabilizer code can be defined. Note that, although the word “lattice” is used to describe these objects, the only requirement is that its constituent points have co-ordinates. No property of the graph structure is assumed, especially planarity.
Parameters: |
|
---|
Represents a lattice in which qubits are placed on the edges of a grid of squares with size given by sz_tpl.
Parameters: | rough_sides (tuple of strings) – Denotes which, if any, of the sides of the lattice are to have ‘rough’ boundary conditions. Values in rough_sides must be drawn from ['u', 'd', 'r', 'l', 'f', 'b'] (up, down, left, right, front, back). Default is (‘u’,’r’). |
---|
Returns a canonical minimum distance path on the _primal_ lattice between two points of the _dual_ lattice. This is based on cutting as few corners as possible on the minimum-size bounding box. The final path is the union of minimum distance paths between start, corners, and end.
Returns a list of points which are one unit of distance away from a given location. Convenience method used to define stars and plaquettes below.
June 6, 2014: Only supports closed_boundary
TODO: Make this depend on the distance function, so that it can be made a method of Lattice, overridden by SquareLattice.
Represents a lattice in which qubits are placed on the corners of squares/octagons. This lattice results from allowing each point on the edge of a SquareLattice (TM) to expand into a square. Begins by creating a square grid of points according to a size tuple, identically to SquareLattice, with each coordinate passed through an affine map. Each point in this lattice is then ‘graduated’ to a square consiting of nearest neighbours.
Returns a canonical minimum distance path on the _primal_ lattice between two points of the _dual_ lattice. This is based on finding the path between neighbouring octagons of whatever dual coordinates are fed in, and testing to see which sets of neighbours are optimal.
Gives the dual lattice to the SquareOctagonLattice above.