QODE assembly interface

oracq.algorithms.input_model.ode

Composable generator and physical vector inputs for autonomous linear ODEs.

class oracq.algorithms.input_model.ode.ODELayout(size, components=(), max_words=4096)[source]

Bases: object

Physical components at consecutive addresses, with optional names and zero padding.

size
components = ()
max_words = 4096
property width

The target register width, including the scalar case.

encode(values)[source]

Encode physical components using the same initial inputs as PDEs.

class oracq.algorithms.input_model.ode.PreparedGenerator(encoding, qrams=())[source]

Bases: object

A generator block encoding and its immutable execution memory banks.

encoding
qrams = ()
class oracq.algorithms.input_model.ode.GeneratorInput(*args, **kwargs)[source]

Bases: Protocol

An operator source resolved against the physical ODE vector layout.

property size

Declared physical dimension of the generator’s target vector.

prepare_generator(layout)[source]

Resolve this source against the ODE layout into an encoding and memories.

class oracq.algorithms.input_model.ode.OracleGeneratorInput(encoding, size, qrams=())[source]

Bases: object

An existing block-encoding provider with a declared physical dimension.

encoding
size
qrams = ()
prepare_generator(layout)[source]

Resolve the provider; method contracts check layout and capabilities.

class oracq.algorithms.input_model.ode.QRAMMatrixConfig(size, value_scale=1.0, offset=0)[source]

Bases: object

Real matrix angles at offset + row*2**width + column.

A word represents value_scale*cos(pi*word/2**word_length). Absent words are zero words, representing positive value_scale rather than zero matrix entries. encode_matrix explicitly fills all padding.

size
value_scale = 1.0
offset = 0
encode_matrix(values, word_length)[source]

Quantize a real matrix, saturating the negative endpoint instead of wrapping.

class oracq.algorithms.input_model.ode.QRAMMatrixInput(qram, config)[source]

Bases: object

Coherent real generator matrix access through a registered angle bank.

qram
config
property size

Physical generator dimension.

prepare_generator(layout)[source]

Query and uncompute matrix angles, without materializing a gate expansion.

class oracq.algorithms.input_model.ode.MatrixInput(values, encoding='gates', angle_width=16, value_scale=1.0)[source]

Bases: object

Finite generator matrix, encoded with small Pauli gates or real QRAM angles.

Gate expansion supports at most five target bits. QRAM preparation still stores the supplied dense matrix; it does not imply a sparse-access speedup.

values
encoding = 'gates'
angle_width = 16
value_scale = 1.0
property size

Physical matrix dimension before register padding.

prepare_generator(layout)[source]

Encode G directly, retaining its sign in the convention u’=Gu.

oracq.algorithms.input_model.ode.physical_generator(encoding, layout)[source]

Project padding on both sides, preventing paths through unused components.

class oracq.algorithms.input_model.ode.ODEProblem(generator, initial=<factory>, final_time=1.0, components=(), dissipative=None, evidence='caller_declared_unverified')[source]

Bases: object

Autonomous homogeneous system u’=Gu with replaceable generator and initial inputs.

Dissipativity is an explicit caller declaration, checked by methods that require it. Source terms, time-dependent generators, and nonlinear systems require separate adaptations and are not implicitly frozen or discarded.

generator
initial
final_time = 1.0
components = ()
dissipative = None
evidence = 'caller_declared_unverified'
property size

Physical vector dimension shared by generator, initial state, and readout.