pdft.bases.RealRichBasis#

class pdft.bases.RealRichBasis(m, n, tensors=None, code=None, inv_code=None)[source]#

Bases: object

QFT topology with H + real-orthogonal 2-qubit gates.

The U(4) slots are initialised to the 4×4 identity (real-orthogonal, not the complex controlled-phase) so the basis is NOT bit-identical to QFTBasis at training step 0 — the forward circuit at init is H ⊗ H ⊗ H per dim followed by identity 2-qubit ops, i.e. just the Walsh-Hadamard transform. This is the appropriate starting point for a real-valued search; the Walsh-Hadamard is the simplest real-orthogonal basis and a natural baseline for natural-image transforms.

Pytree contract:

leaves = tensors (one list) aux data = (m, n, len(tensors), code, inv_code)

Parameters:
__init__(m, n, tensors=None, code=None, inv_code=None)[source]#
Parameters:

Methods

__init__(m, n[, tensors, code, inv_code])

forward_transform(pic)

inverse_transform(pic)

Attributes

m: int#
n: int#
tensors: list[Array]#
code: object#
inv_code: object#
property inv_tensors: list[Array]#
property image_size: tuple[int, int]#
property num_parameters: int#
forward_transform(pic)[source]#
Parameters:

pic (Array)

Return type:

Array

inverse_transform(pic)[source]#
Parameters:

pic (Array)

Return type:

Array