Operators
kongming provides two core algebraic operations on sparse binary hypervectors.
Bind
Binding () combines two vectors into a result that is dissimilar to both inputs. It is the multiplicative operation in the VSA algebra.
Definition
For codes , bind is segment-wise modular addition of the ON offsets:
where is the offset of the ON bit in the -th segment of . Each segment is handled independently, so the result keeps exactly one ON bit per segment — binding never leaves the segmented space.
Mathematically
Implementation: segment-wise offset addition modulo segment size .
Check out original paper for details.
Check out code snippets from the API reference.
Release
Occasionally we use release, as the equivalent of division.
Note that release is anti-commutative:
Check out code snippets from the API reference.
Bundle
Bundling () creates a superposition of vectors, which is similar to all inputs. It is the additive operation in the VSA algebra.
Definition
For codes with normalized weights (where ):
Bundling is not arithmetic addition. Each segment of the result takes its offset from exactly one operand, chosen with probability :
So every segment still holds exactly one ON bit, and the result stays in the segmented space. Think of it as a lossy compression: retains each operand’s segment-wise offsets in proportion to that operand’s weight, which gives the similarity directly:
With uniform weights , the notation simplifies to the plain sum and each member keeps a share:
This is the capacity limit in one line: bundle members and each survives at overlap , so a member stops being recoverable once approaches the noise floor.
Mathematically
Check out original paper for details on bundle operator.
Check out code snippets from the API reference.