pdft.bases.DCT4Basis#

class pdft.bases.DCT4Basis(m, n, tensors=None, code=None, inv_code=None, parametrization='o4')[source]#

Bases: object

DCT-IV tensor-network basis: the real-orthogonal, ancilla-free analogue of QFTBasis.

Mirrors QFTBasis (one tensor list; inverse_transform applies conj(tensors) through inv_code). The gates are emitted by pdft.bases.circuit.dct4.dct4_code(); at initialization the forward operator is the bit-reversed orthonormal DCT-IV per dimension, and — since DCT-IV is self-inverse — the basis reconstructs exactly. tensors holds every gate — the affine R_y rotation layer, the branch Hadamards, the mirror-Q CNOT permutations and the Delta sign — each a learnable leaf on its auto-selected Riemannian manifold (O(2) / O(4) / phase). The gate tensors are real-valued (stored complex128, zero imaginary), so the unitary manifold trains the real-orthogonal subset under a real objective: exact DCT-IV at init, then relaxed, just as QFT relaxes within U.

Pytree contract:

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

Parameters:
__init__(m, n, tensors=None, code=None, inv_code=None, parametrization='o4')[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