Carleman 线性化

oracq.algorithms.qnlss.carleman

Finite-order tensor lifting of polynomial ODEs, initial states, and physical channel selection.

class oracq.algorithms.qnlss.carleman.PolynomialODE(width, coefficients, initial, initial_norm=1.0)[源代码]

基类:object

Polynomial ODE input model and the input declarations needed for Carleman assembly.

变量:
  • width (int) -- Width d of a single-level state vector (register bits).

  • coefficients (tuple[tuple[int, oracq.algorithms.input_model.operators.BlockEncoding], ...]) -- Sequence of (degree p, block encoding F_p) pairs; degrees are distinct and the sequence is nonempty; F_p acts on the d^p-dimensional tensor power, with width max(1, p) * width.

  • initial (oracq.algorithms.input_model.oracles.StatePreparation) -- Preparation of the initial state u(0).

  • initial_norm (float) -- Initial state norm used to weight each tensor level; defaults to 1.0.

抛出:

ValidationError -- Raised at construction when width/degree/norm values are invalid, the coefficient table is empty or has duplicate degrees, an F_p width mismatches, or the initial-state layout does not match.

width
coefficients
initial
initial_norm = 1.0
oracq.algorithms.qnlss.carleman.carleman_lift(problem, *, cutoff=2)[源代码]

Assemble the block encoding of the truncated Carleman linear embedding.

Placement terms are enumerated for each target tensor level and polynomial degree and combined by an equal-weight LCU; the output attributes record cutoff and the padded-row zero assumption (padding rows outside the first d rows and columns outside d^p are zero).

参数:
  • problem -- A PolynomialODE input model.

  • cutoff -- Carleman truncation order; must be positive.

返回:

The embedding operator acting on cutoff * width data bits plus the level register.

返回类型:

BlockEncoding

抛出:

ValidationError -- problem is not a PolynomialODE, or cutoff is invalid.

oracq.algorithms.qnlss.carleman.carleman_initial(problem, *, cutoff=2)[源代码]

Construct the zero-input preparation of the tensor initial state.

The level register is prepared weighted by powers of initial_norm, then the initial state is copied into the first k levels under control, forming the tensor power vector of u(0).

参数:
  • problem -- A PolynomialODE input model.

  • cutoff -- Carleman truncation order; must be positive.

返回:

Target is cutoff * width data bits plus the level register; the work space is reused per level at the width of initial.

返回类型:

StatePreparation

抛出:

ValidationError -- problem is not a PolynomialODE, or cutoff is invalid.

oracq.algorithms.qnlss.carleman.carleman_qode(problem, time, linear_solver, *, cutoff=2)[源代码]

Hand the Carleman embedding to a linear solver and project back to the first level.

It first assembles carleman_lift and carleman_initial, then evolves to time time via linear_solver, and finally selects the first tensor level as the solution state; the effect of the truncated tail terms is recorded as pending under truncation_assumption.

参数:
  • problem -- A PolynomialODE input model.

  • time -- Target evolution time; non-negative.

  • linear_solver -- A callable linear solver of the form (generator, initial, time) -> StateOracle.

  • cutoff -- Carleman truncation order; must be positive.

返回:

The first-level solution state of width problem.width.

返回类型:

StateOracle

抛出:

ValidationError -- Input types or values are invalid, linear_solver is not callable, or its output is not a StateOracle.