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:
objectLinear 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 (oracq.algorithms.input_model.operators.BlockEncoding) – Block encoding of the discrete generator G, corresponding to
u' = Gu.initial (oracq.algorithms.input_model.oracles.StatePreparation) – Initial state preparation.
label (str) – Problem label.
- 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
generatorandinitialattributes (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:
objectInput 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 toqodedirectly as a single model, which suits model-level protocols such asPolynomialODE.- 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