initial

oracq.algorithms.input_model.initial

Shared physical initial-state inputs for ODE and PDE methods.

class oracq.algorithms.input_model.initial.InitialStateLayout(*args, **kwargs)[源代码]

基类:Protocol

Physical vector size, register width, and bounded sample encoding.

property size

Number of physical samples in the layout's vector.

property width

Address width in qubits indexing the physical samples.

property max_words

Largest number of QRAM words the layout may use for padded samples.

encode(values)[源代码]

Encode flat or per-component sample values into the physical vector.

class oracq.algorithms.input_model.initial.PreparedInitial(preparation, norm, qrams=())[源代码]

基类:object

Reversible amplitude preparation, physical norm, and memory snapshots.

preparation
norm
qrams = ()
class oracq.algorithms.input_model.initial.InitialInput(*args, **kwargs)[源代码]

基类:Protocol

An initial-state source resolved against a method's physical layout.

prepare_initial(layout)[源代码]

Resolve this source against the physical layout into a preparation.

class oracq.algorithms.input_model.initial.UniformInput(value=1.0)[源代码]

基类:object

A constant physical vector, independently of its layout implementation.

value = 1.0
prepare_initial(layout)[源代码]

Prepare uniform amplitudes only over the layout's physical samples.

class oracq.algorithms.input_model.initial.ArrayInput(values, encoding='gates', angle_width=16)[源代码]

基类:object

Physical initial samples, using gates or nonnegative QRAM angle preparation.

values
encoding = 'gates'
angle_width = 16
prepare_initial(layout)[源代码]

Convert physical samples into a normalized preparation and retain their norm.

class oracq.algorithms.input_model.initial.OracleInput(preparation, norm, qrams=())[源代码]

基类:object

An existing preparation oracle with an explicit physical vector norm.

Signed/complex preparations and application-specific loaders can use this interface. Memory snapshots must use the oracle's leaf resource names.

preparation
norm
qrams = ()
prepare_initial(layout)[源代码]

Return the supplied oracle; the consuming method checks capabilities and width.

class oracq.algorithms.input_model.initial.QRAMInputConfig(state_width, norm, offset=0)[源代码]

基类:object

Rotation-tree layout: node 2**depth-1+prefix plus a base offset.

Words encode Ry angles in units of 2*pi/2**word_length. The physical norm is supplied separately; this is amplitude access, not raw value access.

state_width
norm
offset = 0
class oracq.algorithms.input_model.initial.QRAMInput(qram, config)[源代码]

基类:object

Initial amplitude preparation from a registered rotation-tree bank.

qram
config
prepare_initial(layout)[源代码]

Load and uncompute each angle while retaining resource names and widths.