solver

oracq.algorithms.qode.solver

Prepared ODE solve instances with replaceable methods and physical vector readout.

class oracq.algorithms.qode.solver.ODEConfig(taylor_degree=2, plan=None, hamiltonian_function=<function taylor_hamiltonian>, max_initial_words=4096)[源代码]

基类:object

Linear evolution settings; approximation choices remain method-specific.

taylor_degree = 2
plan = None
hamiltonian_function(time, *, degree=2)

A closable plain Hamiltonian-function block encoding; replaceable by a QSP/HamSim protocol.

参数:
  • hamiltonian -- Block encoding of the operator.

  • time -- Evolution time, a finite real number.

  • degree -- Taylor truncation order, an integer not less than 0; order 0 keeps only the identity term.

返回:

LCU block encoding of the truncated Taylor series, with correctness marked pending.

返回类型:

BlockEncoding

max_initial_words = 4096
class oracq.algorithms.qode.solver.PreparedODE(state, report, qrams=(), model=None, amplitude_scale=None)[源代码]

基类:object

Method output, checked contracts, memory, and optional physical magnitude scale.

state
report
qrams = ()
model = None
amplitude_scale = None
class oracq.algorithms.qode.solver.ODEMethod(*args, **kwargs)[源代码]

基类:Protocol

A method owns its input adaptations, mathematical requirements, and readout scale.

prepare(problem)[源代码]

Adapt the problem to this method and return the checked executable output.

class oracq.algorithms.qode.solver.LinearODEMethod(solver, max_initial_words=4096, recover_taylor_scale=False)[源代码]

基类:object

Adapt shared ODE inputs to an existing checked QODESolver protocol.

solver
max_initial_words = 4096
recover_taylor_scale = False
prepare(problem)[源代码]

Resolve inputs, enforce method promises, and generate one physical state oracle.

class oracq.algorithms.qode.solver.ODECircuit(program, _memory=())[源代码]

基类:SolveCircuit

A modular ODE circuit sharing export, resource estimates, and backend execution.

class oracq.algorithms.qode.solver.ODEResult(state, layout, backend, amplitude_scale=None)[源代码]

基类:object

Backend state and final-time vector readout, excluding register padding.

state
layout
backend
amplitude_scale = None
property success_probability

Joint probability of zero signal and a physical vector address.

physical_amplitudes(*, normalize=True)[源代码]

Return physical vector amplitudes, optionally conditioned on success.

physical_values()[源代码]

Recover the generated approximation's magnitude when the method supplies its scale.

class oracq.algorithms.qode.solver.ODESolveInstance(problem, method)[源代码]

基类:object

Cached prepare/inspect/execute lifecycle, independent of native quantum backends.

property problem

Captured mathematical problem and input choices.

property method

Selected method and its configuration.

property prepared

Inspect the method's checked model and readout scale after preparation.

prepare()[源代码]

Generate once, check closure and output layout, and resolve QRAM snapshots.

circuit()[源代码]

Inspect the exact prepared circuit used for export and execution.

run_pysparq(*, max_steps=1000000, max_states=65536, native_registry=None)[源代码]

Execute the prepared circuit through the real optional PySparQ backend.

run_originir_ext(*, max_qubits=24, max_steps=1000000)[源代码]

Execute the prepared circuit through the real optional UnifiedQuantum backend.

oracq.algorithms.qode.solver.qode_solve(problem, *, method='taylor', config=None)[源代码]

Select Taylor, LCHS, CBMD, Schrödingerization, or an application-defined method.

Named methods use ODEConfig. A QODESolver keeps its own configuration and preconditions; an ODEMethod owns preparation and physical scale recovery.