QFVM 的 QMem 直连数据路径

oracq.applications.qfvm_qmem

Direct QMem rewrite of the QFVM data path: state and geometry tables use pointer-style two-dimensional addressing, and the residual tree uses QVector.

The circuit structure is isomorphic to applications/qfvm.py (reversible Roe arithmetic, nine-slot geometry, padding diagonal and in-place position permutation are all preserved), but it no longer goes through abstract database slots and bind: modules declare QRAM-form resources directly, the three conserved variables are merged into a single (field, cell) state table, neighbors cell±1 realize the periodic boundary through pointer arithmetic modulo 2^cell_width, the geometry table is addressed two-dimensionally by (column, slot), and the residual state is prepared by QVector (squared-norm tree plus sign kickback). Semantic equivalence with the existing path is cross-checked amplitude by amplitude on simulate by tests/core/test_qfvm_qmem.py.

oracq.applications.qfvm_qmem.qfvm_qmem_physical(inputs, *, gamma=1.4, entropy_delta=0.125, mass=1.0, dx=1.0)[源代码]

Physical computation of matrix elements: the state table is addressed two-dimensionally by (field, neighbor cell), periodic neighbors use modular-addition pointers.

参数:
  • inputs -- The slot set declared by roe_qfvm_inputs, providing the cell index width and fixed-point format.

  • gamma -- Ratio of specific heats.

  • entropy_delta -- Roe entropy fix coefficient.

  • mass -- The mass term, applied only to the component diagonal of the center block.

  • dx -- Grid step size.

返回:

The matrix element computation circuit with registers source, row, col, band, value, status; status aggregates the failure flags of the arithmetic nodes.

返回类型:

Operation

oracq.applications.qfvm_qmem.qfvm_qmem_location(inputs)[源代码]

CKS in-place position permutation: nine structural slots addressed through the two-dimensional (column, slot) geometry.

参数:

inputs -- The slot set declared by roe_qfvm_inputs, determining the coordinate and geometry word widths.

返回:

The in-place sparse position permutation circuit with registers column, index, work.

返回类型:

Operation

oracq.applications.qfvm_qmem.qfvm_qmem_entry(inputs, *, padding_value=1.0, **entry_options)[源代码]

Arbitrary-coordinate matrix element oracle: same semantics as the entry of qfvm_sparse_access, with the data plane wired directly to QMem.

参数:
  • inputs -- The slot set declared by roe_qfvm_inputs.

  • padding_value -- The padding diagonal value; must be a positive number exactly representable in the fixed-point format.

  • **entry_options -- Arithmetic options forwarded to qfvm_qmem_physical (gamma, mass and so on).

返回:

The matrix element XOR circuit with registers row, column, data; entries outside the structural domain are zero, entries with failed arithmetic are zeroed, and padded coordinates write the padding diagonal.

返回类型:

Operation

class oracq.applications.qfvm_qmem.RoeQmemData(states, *, fmt=None, angle_width=10, gamma=1.4, entropy_delta=0.125, dx=1.0, name='residual')[源代码]

基类:object

Classical-side flow field data: reuses the physical quantities and residuals of RoeFlowData and reorganizes the quantum plane into QMem banks.

property state_bank

address = field*n + cell, and the word is the fixed-point encoding of the conserved variable.

Type:

(field, cell) state table

memories(inputs)[源代码]

Export all runtime memory tables of the QMem direct data path.

参数:

inputs -- The slot set declared by roe_qfvm_inputs, determining the geometry table layout.

返回:

The state state table, the geometry geometry table, plus the angle word and sign banks of the residual QVector snapshot (defaulting to residual_angles and residual_sign; the names follow the name parameter given at construction); the execution entry binds them by name to the QRAM resources declared by modules.

返回类型:

dict

oracq.applications.qfvm_qmem.qfvm_qmem_rhs(data)[源代码]

Residual state preparation: QVector squared-norm tree plus sign phase kickback (replacing the qram_state_prep plus sign combination).

参数:

data -- Classical-side flow field data whose residual QVector provides amplitude and sign information.

返回:

The preparation circuit of the normalized residual state, with negative components carrying the sign via phase kickback.

返回类型:

StatePreparation