Skip to content

Passes

Hold the passes of a compilation, the steps of the shared core that turn a system into a problem.

ConservedNoisePass

Bases: BasePass

Pass that lowers every conserved noise law to the divergence of one random flux per link of its field.

FieldFunctionsPass

Bases: BasePass

Pass that writes operators back into the equations and adds flux differences, symmetries, and fixed nodes.

FieldJacobianPass

Bases: BasePass

Pass that adds the conservation laws, symmetries, and fixed nodes of the fields to the exact Jacobian.

FieldProblemPass

Bases: BasePass

Pass that adds the stable step, the linear terms, the finite volumes, the fixed nodes, and the observed fields.

An observable of a field whose expression applies field operators, such as inverse_helmholtz or gradient, is lowered like a law of the field, into a kernel that gives its value at every site.

HilbertSpaceError

Bases: SkcomplexError

An operator system has a Hilbert space larger than its declared limit.

LatticeProblemPass

Bases: BasePass

Pass that adds the steps of local rules, drives, cascades, extremal updates, and Monte Carlo sampling.

LowerFieldsPass

Bases: BasePass

Pass that lowers the differential operators of laws to stencils and notes stable steps and linear terms.

MaskRequestsPass

Bases: BasePass

Pass that makes the requests of update laws vanish on the free rows of capacity layouts.

OperatorCompiler(backend=None, solver=None, observables=(), max_dimension=DEFAULT_MAX_DIMENSION)

Bases: BaseCompiler

Compiler of a system holding operator elements into a problem of the operator form.

Parameters:

Name Type Description Default
backend BaseBackend | None

The backend requested for the problem, which the operator form does not use.

None
solver object

The solver the problem runs on. A solver with a largest dimension of its own limits the Hilbert space.

None
observables Sequence[ObservableSpec]

The observables to compute at every frame, labelled by their path from the root.

()
max_dimension int

The largest dimension of the Hilbert space, for a solver without a largest dimension of its own.

DEFAULT_MAX_DIMENSION

Examples:

>>> from skcomplex.core.system import System
>>> from skcomplex.engine.compile import OperatorCompiler
>>> from skcomplex.models.biology.common.populations import PopulationElement
>>> OperatorCompiler().check().prepare(System(elements=[PopulationElement('rabbits')])).report_.ok
False
Source code in src/skcomplex/engine/compile/passes/_operator_compiler.py
80
81
82
83
84
85
86
87
88
def __init__(
    self,
    backend: BaseBackend | None = None,
    solver: object = None,
    observables: Sequence[ObservableSpec] = (),
    max_dimension: int = DEFAULT_MAX_DIMENSION,
) -> None:
    super().__init__(backend, solver, observables)
    self.max_dimension = max_dimension

RequestJumpsPass

Bases: BasePass

Pass that turns the jumps that request topology changes into jumps of no state change, noting the requests.

SplitRequestsPass

Bases: BasePass

Pass that sets the update laws that request topology changes apart from the laws lowered into kernels.

TopologyFunctionsPass

Bases: BasePass

Pass that compiles the topology changes, leaving out the compiled stepper loops when laws request them.

TopologyProblemPass

Bases: BasePass

Pass that adds the topology changes to the problem.

TowardsPass

Bases: BasePass

Pass that sets apart the weight of the candidate nodes of every request, read through reductions like laws.