Legacy compatibility entry points

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)[source]

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

Parameters:
  • 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.

Returns:

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.

Return type:

callable

Raises:

ValidationError – times and weights have different lengths.

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

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

Parameters:
  • 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.

Returns:

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

Return type:

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