Skip to content

Phase vectors

The holographic-vsa wheel is a different package from the SDK: the deterministic quantized-phase vector substrate, imported as holographic_memory. It does not include document search.

holographic_memory

Deterministic, verifiable vector-symbolic (VSA) memory on a quantized-phase substrate.

PhaseHVec

A quantized-phase hypervector: dim phases in Z_N. Binding is phase-add mod N (not self-inverse), bundling is a deterministic integer fold, similarity is the mean cosine of phase differences.

dim property

dim: int

n property

n: int

random staticmethod

random(dim: int, n: int, seed: int) -> PhaseHVec

A random phase vector of dim dimensions at resolution n (phase levels, 2..=65536), deterministic in seed.

bind

bind(other: PhaseHVec) -> PhaseHVec

Bind two vectors (phase-add mod N). Non-self-inverse; inverse is unbind.

unbind

unbind(other: PhaseHVec) -> PhaseHVec

Unbind (phase-sub mod N). a.bind(b).unbind(b) == a.

similarity

similarity(other: PhaseHVec) -> float

Similarity: mean cosine of phase differences, in [-1, 1].

bundle staticmethod

bundle(items: list[PhaseHVec]) -> PhaseHVec

Deterministic superposition (bundle) of a list of phase vectors.

phases

phases() -> list[int]

The raw phase indices as a list of ints in [0, n).

__repr__

__repr__() -> str

resonator_factorize

resonator_factorize(composite: PhaseHVec, codebooks: list[list[PhaseHVec]], max_iter: int = 50) -> list[tuple[int, float]]

Factor a composite bind(f0, f1, ...) into one codebook index per factor via the deterministic resonator. Returns (index, similarity) for each factor.