Skip to content

Spaces, neighbourhoods, and times

A space places the members of a group, such as the sites of a lattice or the nodes of a network, and its tag names the kind of structure. A neighbourhood says which members a law reads around one member. A time says how the system advances: in continuous time, in discrete steps, or not at all. A solver runs a system only when it supports the tags of its space and its time. The table lists the tags that each class declares.

Class Kind Tags
AdjacencyNeighborhood neighbourhood none
BaseNeighborhood neighbourhood none
BaseSpace space from a subclass
CellComplexSpace space cell complex
CofaceNeighborhood neighbourhood none
ContinuousSpace space continuous
DelaunayNeighborhood neighbourhood none
LatticeNeighborhood neighbourhood none
LatticeSpace space lattice
NearestNeighborhood neighbourhood none
NetworkSpace space hypergraph, network
PhaseSpace space phase space
RadiusNeighborhood neighbourhood none

Comparison

Class Summary Uses See also
AdjacencyNeighborhood A neighbourhood of the nodes joined to a node by the edges of a network. A person catches a disease from their contacts, a voter copies a friend, and a bus of a power grid trades power with the buses wired to it. NetworkSpace, RadiusNeighborhood
BaseNeighborhood An abstract neighbourhood, the members a law reads around a member of a space. Its subclasses pick the cells around a tree in a forest fire, the contacts of a person in an epidemic, and the birds within sight of a bird in a flock. BaseSpace
BaseSpace An abstract space, where the members of a group live and who neighbours whom. Its subclasses hold the grid of a forest, the contact network of an epidemic, and the box of a gas. LatticeSpace, NetworkSpace, ContinuousSpace, BaseNeighborhood
CellComplexSpace A space of the sites, links, and faces of a lattice, network, or mesh, oriented. Angles live on the links of a lattice in gauge theory, the flows of a road network split into a flow that runs downhill and a flow that circulates, and heat flows through a machine piece meshed into triangles. NetworkSpace, LatticeSpace
CofaceNeighborhood A neighbourhood of the cells of the next degree that contain a cell. Gauge theories sum the squares around each link of a lattice, and flows on a mesh read the faces around each edge. AdjacencyNeighborhood, CellComplexSpace
ContinuousSpace A space of real positions, a box with a boundary or the whole of R^d. Atoms move in the box of a gas, birds fly in a flock, pedestrians walk through a station, and households live in the districts of a city. LatticeSpace, RadiusNeighborhood, NearestNeighborhood
DelaunayNeighborhood A neighbourhood of the members joined by edges of a Delaunay triangulation. Cells in a tissue push on the cells that touch them, bubbles share walls in a foam, and animals guard their territories against the animals next door. RadiusNeighborhood, NearestNeighborhood
LatticeNeighborhood A neighbourhood of the ordered lattice offsets that a local rule reads. A cellular automaton reads a cell and its two neighbours, a river carries a pollutant from the cells upstream, and a queue of traffic reads the car ahead. RadiusNeighborhood, LatticeSpace
LatticeSpace A space of a box of Z^d, or of the triangular lattice in two dimensions. The spins of a magnet sit on a square grid, the trees of a forest fire on a map of cells, and the temperature of a rod on a row of points. NetworkSpace, ContinuousSpace, PhaseSpace
NearestNeighborhood A neighbourhood of the k members of a continuous space closest to a member. Starlings follow their seven nearest neighbours, fish school by their closest neighbours, and the robots of a swarm align with the nearest robots. RadiusNeighborhood, DelaunayNeighborhood
NetworkSpace A space of a graph whose nodes the members occupy, with layers of relations. A disease spreads on a contact network, generators keep in step on a power grid, banks lend to each other, and neurons fire along their synapses. LatticeSpace, LayerSpec, CellComplexSpace
PhaseSpace A space of positions combined with extra axes, such as velocity. Gas molecules are followed over position and velocity, bacteria over position and swimming direction, and cells over position and age. LatticeSpace, AxisSpec
RadiusNeighborhood A neighbourhood of the members within a distance under a metric. Birds align with the flockmates they can see, atoms push on the atoms within a cutoff, a sandpile topples grains onto its four neighbours, and a cell of the Game of Life counts its eight. NearestNeighborhood, LatticeNeighborhood, DelaunayNeighborhood

Fact sheets

AdjacencyNeighborhood

A neighbourhood of the nodes joined to a node by the edges of a network.

BaseNeighborhood

An abstract neighbourhood, the members a law reads around a member of a space.

BaseSpace

An abstract space, where the members of a group live and who neighbours whom.

CellComplexSpace

A space of the sites, links, and faces of a lattice, network, or mesh, oriented.

  • Space tags: cell complex
  • Times: any
  • Solvers: CoSimulationSolver, CrankNicolsonSolver, ETDRK4Solver, EulerMaruyamaSolver, FractionalABMSolver, FractionalEulerMaruyamaSolver, GillespieSolver, GradientFlowSolver, GrunwaldLetnikovSolver, HeunSolver, IMEX2Solver, IMEXEulerSolver, IterationSolver, L1Solver, LammpsSolver, LatticeSolver, MesaSolver, MetropolisSolver, MilsteinSolver, MinimizeSolver, MonteCarloSolver, RK4Solver, RenewalSolver, RootSolver, SSPRKSolver, ScipyODESolver, SplitSolver, VelocityVerletSolver, Yoshida4Solver
  • Backends: NumbaBackend, NumpyBackend
  • Arguments:
    • space: The LatticeSpace or the NetworkSpace the cells derive from, or None for a mesh of points and cells.
    • points: The coordinates of the nodes of a mesh, one column per node and one row per dimension, or None for a complex that derives from space.
    • cells: The node indices of every triangle or tetrahedron of a mesh, one column per cell, or None for a complex that derives from space.
    • faces: The faces of a network: None for a minimum cycle basis, 'hyperedges' for the hyperedges of the network, 'cliques' for its cliques up to dimension, or a sequence of node cycles.
    • dimension: The highest degree of the cells.
    • boundary: The edge of each state of a field on a mesh by name, 'zero-flux' for an insulated wall or ('fixed', value) for a wall held at a value, a number or a function of the node coordinates, such as {'u': ('fixed', 0.0)}.
    • label: The name of the space in its system, such as 'grid'.
  • Errors:
    • SpaceError: A face uses a pair of nodes that the graph does not join, the network has a loop, or the lattice is not square.
    • ValidationError: Neither or both of a space and a mesh are given, or the points or cells of a mesh do not fit.
  • Catalog systems: gauge_arbitrage_market, gauge_network_agents, heat_diffusion, heat_l_shape, lattice_gauge_fields, lattice_yang_mills, topological_kuramoto
  • Field realizations: none yet
  • See also: reference, API

CofaceNeighborhood

A neighbourhood of the cells of the next degree that contain a cell.

ContinuousSpace

A space of real positions, a box with a boundary or the whole of R^d.

  • Space tags: continuous
  • Times: any
  • Solvers: CoSimulationSolver, CrankNicolsonSolver, ETDRK4Solver, EulerMaruyamaSolver, FractionalABMSolver, FractionalEulerMaruyamaSolver, GillespieSolver, GradientFlowSolver, GrunwaldLetnikovSolver, HeunSolver, IMEX2Solver, IMEXEulerSolver, IterationSolver, L1Solver, LammpsSolver, MesaSolver, MetropolisSolver, MilsteinSolver, MinimizeSolver, RK4Solver, RenewalSolver, RootSolver, SSPRKSolver, ScipyODESolver, SplitSolver, VelocityVerletSolver, Yoshida4Solver
  • Backends: NumbaBackend, NumpyBackend
  • Arguments:
    • extent: The side of the box along every dimension, or empty for an unbounded space.
    • n_dim: The number of dimensions of an unbounded space, or None for the number of sides of the box.
    • boundary: What happens at the walls of the box.
    • regions: The polygon of every region, or the polygons of every layer of regions, by name, or None for no regions.
    • label: The name of the space in its system, such as 'grid'.
  • Errors:
    • SpaceError: A region is not a valid polygon in two dimensions, or the space has regions and other than two dimensions, raised by prepare.
  • Catalog systems: active_brownian_particles, active_ornstein_uhlenbeck_particles, active_passive_flocking, ageing_random_walk, aligning_active_brownian_particles, anisotropic_brownian_particles, annealed_transient_time_motion, asep, binary_collision_flocking, bird_swarm, and more in the catalog
  • Field realizations: KerrSpace, LemaitreTolmanBondiSpace, RobertsonWalkerSpace, SchwarzschildSpace, SpacetimeSpace
  • See also: reference, API

DelaunayNeighborhood

A neighbourhood of the members joined by edges of a Delaunay triangulation.

  • Arguments:
    • center: Whether a member is its own neighbour.
    • label: The name of the neighbourhood, such as 'moore'.
  • Errors: none of its own
  • Catalog systems: off_lattice_tumour_growth
  • Field realizations: none yet
  • See also: reference, API

LatticeNeighborhood

A neighbourhood of the ordered lattice offsets that a local rule reads.

LatticeSpace

A space of a box of Z^d, or of the triangular lattice in two dimensions.

  • Space tags: lattice
  • Times: any
  • Solvers: CoSimulationSolver, CrankNicolsonSolver, ETDRK4Solver, EulerMaruyamaSolver, FractionalABMSolver, FractionalEulerMaruyamaSolver, GillespieSolver, GradientFlowSolver, GrunwaldLetnikovSolver, HeunSolver, IMEX2Solver, IMEXEulerSolver, IterationSolver, KineticSolver, L1Solver, LammpsSolver, LatticeSolver, MesaSolver, MetropolisSolver, MilsteinSolver, MinimizeSolver, MonteCarloSolver, RK4Solver, RenewalSolver, RootSolver, SSPRKSolver, ScipyODESolver, SemiLagrangianSolver, SplitSolver, StrangSplittingSolver, VelocityVerletSolver, Yoshida4Solver
  • Backends: NumbaBackend, NumpyBackend
  • Arguments:
    • shape: The number of sites along every dimension.
    • geometry: 'square' for the integer lattice or 'triangular' for the triangular lattice in two dimensions.
    • boundary: The edges of the lattice, or the edge of each state of a field on it by name.
    • discretization: How the operators of a field on the lattice, such as laplacian, become numbers.
    • scheme: The limiter, numerical flux, and wave speed of a finite-volume field, or None for the minmod limiter and the Rusanov flux.
    • symmetry: The parity of each state of a field by name along every axis of a periodic lattice, 'odd', 'even', or None, which the rates keep exactly, such as {'T': ('even', 'odd')}.
    • fill: The value read outside a lattice with fixed edges.
    • spacing: The distance between neighbouring sites, or one distance per dimension.
    • metric: The metric of the ball of radius 1 that agents query.
    • capacity: The largest number of agents in a cell, or None for no limit.
    • label: The name of the space in its system, such as 'grid'.
  • Errors: none of its own
  • Catalog systems: active_gels, active_polymer, active_system_b, active_viscoelastic_gel, active_walkers, adding_machine, agent_based_lotka_volterra, agent_based_sir, aliev_panfilov, allen_cahn, and more in the catalog
  • Field realizations: SimplexSpace
  • See also: reference, API

NearestNeighborhood

A neighbourhood of the k members of a continuous space closest to a member.

  • Arguments:
    • k: The number of neighbours.
    • center: Whether a member is its own neighbour, besides its k nearest others.
    • label: The name of the neighbourhood, such as 'moore'.
  • Errors: none of its own
  • Catalog systems: ginelli_nematics, gregoire_chate, vicsek
  • Field realizations: none yet
  • See also: reference, API

NetworkSpace

A space of a graph whose nodes the members occupy, with layers of relations.

  • Space tags: hypergraph, network
  • Times: any
  • Solvers: CoSimulationSolver, CrankNicolsonSolver, ETDRK4Solver, EulerMaruyamaSolver, FractionalABMSolver, FractionalEulerMaruyamaSolver, GillespieSolver, GradientFlowSolver, GrunwaldLetnikovSolver, HeunSolver, IMEX2Solver, IMEXEulerSolver, IterationSolver, L1Solver, LammpsSolver, LatticeSolver, MesaSolver, MetropolisSolver, MilsteinSolver, MinimizeSolver, MonteCarloSolver, RK4Solver, RenewalSolver, RootSolver, SSPRKSolver, ScipyODESolver, SplitSolver, VelocityVerletSolver, Yoshida4Solver
  • Backends: NumbaBackend, NumpyBackend
  • Arguments:
    • graph: The NetworkX graph, the default layer.
    • layers: The named layers over the nodes of the graph.
    • capacity: The largest number of agents on a node, or None for no limit.
    • fill: The value lattice rules read in the padding slots of nodes with fewer neighbours than the largest degree.
    • hyperedges: The hyperedges of the network, which hyperedge interactions and groups on hyperedges read: sequences of at least two nodes, an XGI Hypergraph, or an XGI SimplicialComplex, whose faces of at least two nodes are its hyperedges.
    • label: The name of the space in its system, such as 'grid'.
  • Errors: none of its own
  • Catalog systems: activity_driven_epidemics, adaptive_delay_network, adaptive_flow_network, adaptive_kuramoto, adaptive_sis, agent_based_sir, bak_sneppen, barabasi_albert, bouchaud_mezard_wealth, cellular_potts, and more in the catalog
  • Field realizations: none yet
  • See also: reference, API

PhaseSpace

A space of positions combined with extra axes, such as velocity.

  • Space tags: phase space
  • Times: any
  • Solvers: CoSimulationSolver, CrankNicolsonSolver, ETDRK4Solver, EulerMaruyamaSolver, FractionalABMSolver, FractionalEulerMaruyamaSolver, GillespieSolver, GradientFlowSolver, GrunwaldLetnikovSolver, HeunSolver, IMEX2Solver, IMEXEulerSolver, IterationSolver, KineticSolver, L1Solver, LammpsSolver, LatticeSolver, MesaSolver, MetropolisSolver, MilsteinSolver, MinimizeSolver, MonteCarloSolver, RK4Solver, RenewalSolver, RootSolver, SSPRKSolver, ScipyODESolver, SemiLagrangianSolver, SplitSolver, StrangSplittingSolver, VelocityVerletSolver, Yoshida4Solver
  • Backends: NumbaBackend, NumpyBackend
  • Arguments:
    • position: The lattice of the positions.
    • axes: The class axes.
    • limit: The largest number of sites of the space.
    • label: The name of the space in its system, such as 'grid'.
  • Errors:
    • PhaseSpaceTooLargeError: The product has more sites than the limit.
  • Catalog systems: bertin_droz_gregoire, bgk_equation, boltzmann_equation, enskog, forest_size_structure, nonlinear_pairwise_group_conflict, trimorphic_multilevel_selection, two_level_replicator, vlasov_equation
  • Field realizations: SimplexSpace
  • See also: reference, API

RadiusNeighborhood

A neighbourhood of the members within a distance under a metric.

The tags of a space and a time

get_tags of a space returns its space tag. A solver compares it with the tags it supports before a run.

from skcomplex.core.components.spaces import LatticeSpace

grid = LatticeSpace((4, 4))
sorted(grid.get_tags().space)
['lattice']

A lattice of 4 by 4 sites has the space tag lattice.