pdft.bases.RichBasis#

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

Bases: CircuitBasis

QFT topology with H + learnable U(4) gates instead of H + CP.

Parameter count at m=n=3 (within an 8x8 block):
  • 3 H gates per dim × 3 free real params (SU(2)) = 9

  • 3 U(4) gates per dim × 15 free real params (SU(4)) = 45

  • total per dim: 54 (BELOW the 63-dim of SU(8) — meaningful structure)

Initialised so the circuit is the QFTBasis operator at training step 0, to rounding (each U(4) starts at the 4×4 controlled-phase diag(1, 1, 1, exp(iφ)) of its corresponding QFT slot). Adam can then deform the U(4) gates into any 4×4 unitary, but the family is a strict 54-dim submanifold of SU(8) and does NOT contain 8×8 DCT exactly (empirically: fit_to_dct plateaus at Frobenius² ≈ 63.7).

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

Methods

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

emit(m, n)

The gate sequence of the rich (H + U(4)) circuit on (2^m, 2^n) images.

forward_transform(pic)

inverse_transform(pic)

conj(tensors) through inv_code, exactly like Julia's basis.inverse_code(conj.(basis.tensors)..., ...).

Attributes

freezes_to_blocked

image_size

inv_tensors

The tensor list itself.

num_parameters

m

n

tensors

program

code

inv_code

static emit(m, n)#

The gate sequence of the rich (H + U(4)) circuit on (2^m, 2^n) images.

Parameters:
Return type:

list[Gate]

freezes_to_blocked: ClassVar[bool] = True#