QRAM 指针式读写¶
oracq.infrastructure.qmem
Pointer-style reads and writes of QRAM data structures: C-style base addresses, offsets, multidimensional views and random writes.
- class oracq.infrastructure.qmem.QMem(builder, resource, *, shape=None, _base=None)[源代码]¶
基类:
objectMultidimensional array view of a QRAM resource: row-major flattening, with indices being integers or register views.
- property strides¶
Row-major strides per dimension, i.e. the address increment of advancing one index along that dimension.
- property address_width¶
Address width of the underlying QRAM resource.
- property data_width¶
Data word width of the underlying QRAM resource.
- ptr(base=None)[源代码]¶
Return a pointer; base is an integer offset or a register view holding an address, a quantum pointer.
- 参数:
base -- integer offset, or a register view whose bit width does not exceed the address width; omitted keeps the base address of the current view.
- 返回:
quantum memory pointer to the shifted base address.
- 返回类型:
- 抛出:
ValidationError -- the base is neither an integer nor a register view, or its bit width exceeds the limit.
- class oracq.infrastructure.qmem.QPtr(mem, addr)[源代码]¶
基类:
objectQRAM pointer: base address + offset, dereferenceable for reads (XOR-Load) or random writes (Store).