PDE models and adapters

oracq.algorithms.qpde.pde

Assembly interface between spatial discretization results and replaceable QODE generators.

class oracq.algorithms.qpde.pde.DiscretePDE(generator, initial, label='linear_pde')[source]

Bases: object

Linear PDE input object after spatial discretization.

It stores only the discrete generator, the initial state preparation, and a label; application metadata such as the grid, boundaries, and dimensions is not carried by this type.

Variables:
generator
initial
label = 'linear_pde'
oracq.algorithms.qpde.pde.make_qpde(qode, discretizer=<function <lambda>>)[source]

Wrap a three-argument linear QODE protocol into a QPDE generation function.

Parameters:
  • qode – A linear solve protocol of the form (generator, initial, time) -> StateOracle.

  • discretizer – A callable mapping the problem object to an object with generator and initial attributes (e.g. DiscretePDE); returns its input unchanged by default.

Returns:

A generation function of the form (problem, final_time) -> StateOracle.

Return type:

callable

class oracq.algorithms.qpde.pde.PDEInput(model, label='open_spatial_discretization')[source]

Bases: object

Input model after spatial discretization; may directly be a PolynomialODE; no dense matrix is required.

model
label = 'open_spatial_discretization'
oracq.algorithms.qpde.pde.qpde_solver(qode, spatial_discretizer=<function <lambda>>)[source]

Wrap a (model, time)-shaped solve protocol into a QPDE generation function.

Unlike make_qpde, the discretization result is passed to qode directly as a single model, which suits model-level protocols such as PolynomialODE.

Parameters:
  • qode – A solve protocol of the form (model, time) -> StateOracle.

  • spatial_discretizer – A callable extracting the model from the problem object; defaults to problem.model.

Returns:

A generation function of the form (problem, time) -> StateOracle.

Return type:

callable