QFVM direct QMem data path

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)[source]

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

Parameters:
  • 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.

Returns:

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

Return type:

Operation

oracq.applications.qfvm_qmem.qfvm_qmem_location(inputs)[source]

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

Parameters:

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

Returns:

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

Return type:

Operation

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

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

Parameters:
  • 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).

Returns:

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.

Return type:

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')[source]

Bases: 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)[source]

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

Parameters:

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

Returns:

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.

Return type:

dict

oracq.applications.qfvm_qmem.qfvm_qmem_rhs(data)[source]

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

Parameters:

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

Returns:

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

Return type:

StatePreparation