Serialization

Serialization#

JSON serialization of a trained QFTBasis (the Julia package’s schema, tensor order and hash, so a basis saved by Julia loads here). Compression of an image in a basis, with its JSON form, is in pdft.tasks.

Serialization (JSON) of trained bases.

Contents

save_basis

Write basis to a JSON file.

load_basis

Read basis from a JSON file.

basis_to_dict

Serialize a QFTBasis to a plain Python dict (JSON-ready).

dict_to_basis

Inverse of basis_to_dict.

basis_hash

SHA256 of a canonical string form, matching Julia's basis_hash(QFTBasis).

format_float_julia_like

Format a Python float the way Julia's string(x::Float64) does.