PDE 模型与适配¶
oracq.algorithms.input_model.pde
Composable spatial and initial-state inputs for quantum PDE methods.
- class oracq.algorithms.input_model.pde.PDEGrid(*args, **kwargs)[源代码]¶
基类:
SpatialGrid,ProtocolSpatial rows, quantum derivative encodings, and their memory snapshots.
- property qrams¶
QRAM snapshots backing the grid's derivative encodings.
- class oracq.algorithms.input_model.pde.UniformGrid1D(start, stop, points, boundary='periodic', axis='x')[源代码]¶
基类:
objectUniform spatial samples with an explicit interval and boundary convention.
Periodic samples cover
[start, stop)with spacing(stop-start)/points. Zero Dirichlet samples are interior points with spacing(stop-start)/(points+1). Power-of-two periodic grids use shift circuits; other grids use a bounded spatial Pauli expansion of at most five qubits. Only spatial derivatives are materialized, never multilinear PDE ports.- start¶
- stop¶
- points¶
- boundary = 'periodic'¶
- axis = 'x'¶
- property axes¶
Spatial axis names.
- property size¶
Number of physical samples, excluding register padding.
- property spatial_width¶
Address register width, retaining padding for arbitrary point counts.
- property spacing¶
Physical sample spacing.
- property qrams¶
Uniform grids do not require a memory bank.
- class oracq.algorithms.input_model.pde.UnstructuredGridConfig(size, derivative_offsets, value_scale=1.0, axes=('x',))[源代码]¶
基类:
objectLayout of real discrete derivative matrices in a QRAM angle bank.
Each derivative key maps to a base address. A matrix uses
base + row * 2**spatial_width + columnand has entriesvalue_scale*cos(pi*word/2**word_length). Thus a zero entry is an angle word2**(word_length-1), not a zero word. Boundary conditions and geometric discretization are already incorporated in these matrices.- size¶
- derivative_offsets¶
- value_scale = 1.0¶
- axes = ('x',)¶
- encode_matrices(matrices, word_length, *, max_words=1048576)[源代码]¶
Encode physical derivative matrices in this layout, including zero padding.
The amplitude error per entry is at most
value_scale*pi/2**word_length. The negative endpoint is saturated to the largest word instead of wrapping a full turn to zero.
- class oracq.algorithms.input_model.pde.UnstructuredGrid(qram, config)[源代码]¶
基类:
objectA spatial discretization supplied as QRAM derivative matrices.
The quantum adapter uses uniform row/column projection and QRAM angle transduction. Its normalization is
2**spatial_width * value_scale; it supports nonsymmetric real matrices and makes no sparse-access speedup claim. A different storage model can implementPDEGriddirectly.- qram¶
- config¶
- property axes¶
Spatial axis names.
- property size¶
Number of physical nodes.
- property spatial_width¶
Node address width.
- property qrams¶
The registered operator memory.
- class oracq.algorithms.input_model.pde.InitialLayout(grid, fields, max_words=4096)[源代码]¶
基类:
objectPhysical fields and grid nodes, with field-major register padding.
- grid¶
- fields¶
- max_words = 4096¶
- property width¶
Combined component and spatial register width.
- property size¶
Number of physical samples across all fields.
- class oracq.algorithms.input_model.pde.PDEProblem(grid, initial=<factory>, type='burgers', final_time=1.0, viscosity=0.1, known=<factory>)[源代码]¶
基类:
objectA PDE recipe whose grid and physical initial input can be composed independently.
typeacceptsburgers,heat, or an existingPolynomialPDE. Presets use one fielduand the grid's first axis.knownholds physical coefficient/forcing samples. Solver approximations belong to the method configuration, not this problem object.- grid¶
- initial¶
- type = 'burgers'¶
- final_time = 1.0¶
- viscosity = 0.1¶
- known¶
- equation¶