Skip to main content
Ctrl+K

Volumential

  • Getting started
  • Examples
  • User guide
  • Design notes
  • Benchmarks
    • API Reference
    • Development
    • Changelog
  • GitHub
  • Getting started
  • Examples
  • User guide
  • Design notes
  • Benchmarks
  • API Reference
  • Development
  • Changelog
  • GitHub

Section Navigation

  • volumential
    • volumential.box_operators
    • volumential.expansion_wrangler_fpnd
    • volumential.expansion_wrangler_interface
    • volumential.expression_eval
    • volumential.function_extension
    • volumential.gaussian
    • volumential.geometry
    • volumential.interpolation
    • volumential.kernel_cache
    • volumential.lagrange
    • volumential.list1
    • volumential.list1_gallery
    • volumential.list1_symmetry
    • volumential.meshgen
    • volumential.nearfield_potential_table
    • volumential.opcounters
    • volumential.orbit_arithmetic
    • volumential.phase_profile
    • volumential.rke_table_assembly
    • volumential.singular_integral_2d
    • volumential.symbolic
    • volumential.table_manager
    • volumential.tools
    • volumential.tree_interactive_build
    • volumential.version
    • volumential.volume_fmm
    • volumential.wranglers
      • volumential.wranglers.arithmetic_orbits
      • volumential.wranglers.barycentric
      • volumential.wranglers.box_layout
      • volumential.wranglers.device_arrays
      • volumential.wranglers.fmmlib_backend
      • volumential.wranglers.fmmlib_batched
      • volumential.wranglers.helmholtz_split
      • volumential.wranglers.kernel_symmetry
      • volumential.wranglers.kernels
      • volumential.wranglers.nearfield_cache
      • volumential.wranglers.orbit_generated
      • volumential.wranglers.orbit_lookup
      • volumential.wranglers.split_terms
      • volumential.wranglers.sumpy_backend
      • volumential.wranglers.table_data
      • volumential.wranglers.timing
  • API Reference
  • volumential
  • volumential.list1_gallery

volumential.list1_gallery#

Enumeration of the list 1 (near-neighbor) interaction gallery.

This module owns the geometric enumeration of every distinct target-box-center-to-source-box-center displacement that can occur between a box and one of its near neighbors in a level-restricted box tree. The gallery is expressed in integer units of a quarter box width so that all involved lengths stay exact integers, which lets downstream table code index cases by a cheap positional encoding.

class volumential.list1_gallery.TreeBox(center: ndarray, radius: int, child_nlevels: int)[source]#

Bases: object

A minimalistic tree box used only to enumerate the gallery.

Courtesy of: Andreas Klockner

draw() → None[source]#

Draw the box outline with matplotlib (2D boxes only).

volumential.list1_gallery.build_tree(dimensions: int) → TreeBox[source]#

Build the four-level reference tree the gallery is enumerated on.

Four levels deep means box centers land on a 2**4 x 2**4 integer grid.

Courtesy of: Andreas Klockner

volumential.list1_gallery.generate_boxes_on_level(box: TreeBox, ilevel: int) → Iterator[TreeBox][source]#

Yield the descendants of box that sit ilevel levels below it.

Courtesy of: Andreas Klockner

volumential.list1_gallery.generate_boxes(box: TreeBox) → Iterator[TreeBox][source]#

Yield box and all of its descendants.

Courtesy of: Andreas Klockner

volumential.list1_gallery.linf_dist(box1: TreeBox, box2: TreeBox) → float[source]#

Return the \(\ell^\infty\) gap between two boxes (0 if adjacent).

Courtesy of: Andreas Klockner

volumential.list1_gallery.generate_interactions(dimensions: int) → list[tuple[TreeBox, TreeBox]][source]#

Return every (target box, source box) pair that touches, in dimensions.

Target boxes are taken from level 2 of the reference tree and kept away from the domain boundary, so that their neighborhoods are complete. Source boxes are drawn from all levels, which is what makes the gallery cover mixed-level interactions.

Courtesy of: Andreas Klockner

volumential.list1_gallery.postprocess_interactions(near_neighbor_interactions: Sequence[tuple[TreeBox, TreeBox]]) → list[tuple[int, ...]][source]#

Reduce touching box pairs to the sorted set of distinct case vectors.

class volumential.list1_gallery.List1Gallery(vec_list: list[tuple[int, ...]], case_encode: Callable[[Sequence[int]], int], case_indices: ndarray)[source]#

Bases: NamedTuple

The list 1 gallery for one dimension.

vec_list: list[tuple[int, ...]]#

Sorted list of distinct case vectors, each a tuple of integers in units of a quarter of the target box width.

case_encode: Callable[[Sequence[int]], int]#

Maps a case vector to its index into case_indices.

case_indices: ndarray#

Lookup table from encoded case vector to case id, -1 where no case vector maps to that slot.

volumential.list1_gallery.generate_list1_gallery(dim: int) → List1Gallery[source]#

Generate a list1 that serves as the gallery for all possible list1 interactions with given dimension and order.

The returned value is a List1Gallery, which unpacks as the (vec_list, case_encode, case_indices) triple it has always been.

previous

volumential.list1

next

volumential.list1_symmetry

On this page
  • TreeBox
    • TreeBox.draw()
  • build_tree()
  • generate_boxes_on_level()
  • generate_boxes()
  • linf_dist()
  • generate_interactions()
  • postprocess_interactions()
  • List1Gallery
    • List1Gallery.vec_list
    • List1Gallery.case_encode
    • List1Gallery.case_indices
  • generate_list1_gallery()
Show Source

© Copyright 2026, Xiaoyu Wei.

Created using Sphinx 9.1.0.

Built with the PyData Sphinx Theme 0.22.0.