Skip to main content

Module coords

Module coords 

Source
Expand description

Coordinate system helpers for Clay codes

Clay codes use a 3D coordinate system (x, y, z) where:

  • x: position within y-section (0 to q-1)
  • y: y-section index (0 to t-1)
  • z: layer/plane index (0 to α-1)

Key concepts:

  • y-section: Nodes with the same y-coordinate
  • Companion layer: For vertex (x, y, z), its companion is at layer z_sw
  • Intersection Score (IS): Count of erased “red” vertices in a layer
  • Plane vector: The z-coordinates that make up layer z (base-q representation)

Functions§

get_companion_layer
Get the companion (swap) layer for a given vertex
get_max_iscore
Get the maximum intersection score for a set of erased chunks
get_plane_vector
Get the plane (layer) vector for a given z
get_z_y
Get the z_y value (y-th digit of z in base q)
is_unpaired
Check if a vertex is unpaired (red) in its layer
node_to_xy
Convert node index to (x, y) coordinates
set_planes_sequential_decoding_order
Set the decoding order for planes based on intersection score
xy_to_node
Convert (x, y) coordinates to node index