solver

oracq.algorithms.qpde.solver

Prepared quantum PDE instances, backend execution, and physical readout.

class oracq.algorithms.qpde.solver.QHAMConfig(order=1, eta=-1.0, taylor_degree=1, linear_solver=None, max_blocks=256, max_terms=4096, max_initial_words=4096, max_coefficient_words=4096)[source]

Bases: object

HAM truncation and independent linear evolution configuration.

The default linear solver is a finite Taylor polynomial of the lifted generator. HAM convergence, spatial error, angle quantization, and Taylor error remain separate approximation questions. Supply linear_solver to use an existing QODE protocol with its own input requirements.

order = 1
eta = -1.0
taylor_degree = 1
linear_solver = None
max_blocks = 256
max_terms = 4096
max_initial_words = 4096
max_coefficient_words = 4096
class oracq.algorithms.qpde.solver.PreparedPDE(state, report, qrams=(), model=None, amplitude_scale=None)[source]

Bases: object

A method’s generated state oracle and its validated input contract.

amplitude_scale recovers physical values from unnormalized success amplitudes when the chosen method supplies this normalization information. Custom methods may leave it unresolved and still support state readout.

state
report
qrams = ()
model = None
amplitude_scale = None
class oracq.algorithms.qpde.solver.PDEMethod(*args, **kwargs)[source]

Bases: Protocol

An algorithm that owns the contracts and adaptations for its PDE inputs.

Implementations check their own grid, oracle capabilities, and mathematical promises, returning a physical target/signal state oracle. There is no implicit conversion from a raw value query into amplitude preparation.

prepare(problem)[source]

Adapt the problem’s inputs and return the validated state oracle.

class oracq.algorithms.qpde.solver.QHAMMethod(config=QHAMConfig(order=1, eta=-1.0, taylor_degree=1, linear_solver=None, max_blocks=256, max_terms=4096, max_initial_words=4096, max_coefficient_words=4096))[source]

Bases: object

QHAM adaptation from independently chosen grid and initial inputs.

config = QHAMConfig(order=1, eta=-1.0, taylor_degree=1, linear_solver=None, max_blocks=256, max_terms=4096, max_initial_words=4096, max_coefficient_words=4096)
prepare(problem)[source]

Check oracle contracts, lift HAM, and generate the selected QODE circuit.

class oracq.algorithms.qpde.solver.PDECircuit(program, _memory=())[source]

Bases: SolveCircuit

A prepared PDE circuit with shared export, estimation, and execution.

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

Bases: object

Backend state and physical success-channel readout of a prepared PDE.

state
layout
backend
amplitude_scale = None
property success_probability

Joint probability of zero signal and a physical output address.

physical_amplitudes(*, normalize=True)[source]

Read physical samples; optionally normalize the joint success channel.

physical_values()[source]

Recover physical values of the generated approximation when its scale is known.

class oracq.algorithms.qpde.solver.PDESolveInstance(problem, method)[source]

Bases: object

Explicit prepare/inspect/execute lifecycle for a quantum PDE algorithm.

Preparation is cached and imports no optional quantum backend. Execution requires successful preparation and never silently regenerates a circuit.

property problem

The problem whose configuration is captured by this instance.

property method

The algorithm implementation selected for this instance.

property prepared

Inspect the method’s model and checked contract after preparation.

prepare()[source]

Generate and validate once, then resolve every entry QRAM snapshot.

circuit()[source]

Inspect or export the generated circuit after preparation.

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

Execute with the real optional PySparQ backend and registered memory.

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

Export and execute through the real optional UnifiedQuantum backend.

oracq.algorithms.qpde.solver.qpde_solve(problem, *, method='QHAM', config=None)[source]

Create an unprepared solve instance with a named or application-defined method.

Only QHAM is a built-in named method. Other methods implement PDEMethod and own their input contracts; the host lifecycle and backends are shared.