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

Bases: 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.

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

Returns:

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

Return type:

BlockEncoding

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

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

Bases: Protocol

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

prepare(problem)[source]

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

Bases: object

Adapt shared ODE inputs to an existing checked QODESolver protocol.

solver
max_initial_words = 4096
recover_taylor_scale = False
prepare(problem)[source]

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

class oracq.algorithms.qode.solver.ODECircuit(program, _memory=())[source]

Bases: SolveCircuit

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

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

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

Return physical vector amplitudes, optionally conditioned on success.

physical_values()[source]

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

class oracq.algorithms.qode.solver.ODESolveInstance(problem, method)[source]

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

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

circuit()[source]

Inspect the exact prepared circuit used for export and execution.

run_pysparq(*, max_steps=1000000, max_states=65536, native_registry=None)[source]

Execute the prepared circuit through the real optional PySparQ backend.

run_originir_ext(*, max_qubits=24, max_steps=1000000)[source]

Execute the prepared circuit through the real optional UnifiedQuantum backend.

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

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.