旧版兼容入口

oracq.algorithms.qode.legacy

Compatibility implementations of the early evolution factories; new code should use the dedicated entry points of each method.

oracq.algorithms.qode.legacy.make_lchs_qode(ham_sim, times, weights)[源代码]

Wrap a Hamiltonian simulation protocol into an LCHS weighted-sum QODE generation function.

参数:
  • ham_sim -- Hamiltonian simulation protocol taking a block encoding and a duration and returning the implementing operation.

  • times -- Discrete quadrature time sequence.

  • weights -- Complex weight sequence of the same length as times.

返回:

A generation function of the form (generator, initial, final_time) -> StateOracle that combines the per-time evolutions via an LCU with the given weights and applies the result to the initial state.

返回类型:

callable

抛出:

ValidationError -- times and weights have different lengths.

oracq.algorithms.qode.legacy.make_schrodingerisation_qode(embedding, ham_sim, *, extra_width=1)[源代码]

Keep the implementation boundary of the Hamiltonian lift explicit, then assemble the evolution and the physical channel.

参数:
  • embedding -- Hamiltonian lift; maps the generator block encoding to a block encoding enlarged by extra_width bits.

  • ham_sim -- Hamiltonian simulation implementation of the form (BE, time) returning an Operation.

  • extra_width -- Auxiliary bits added by the lift; a positive integer, defaulting to 1.

返回:

A generation function taking the generator, the initial state, and the final time, and outputting the physical-channel readout state oracle.

返回类型:

Callable[[BlockEncoding, StatePreparation, float], StateOracle]