pyphi.relations.AnalyticalFoldRelations#
- class pyphi.relations.AnalyticalFoldRelations(parent_distinctions, seeds)[source]#
Bases:
AnalyticalRelationsClosed-form sums over the relations incident to a set of seed distinctions within a parent structure.
Every analytical quantity is a sum over relations, and a relation either touches the seed set
For it does not, so the incident total istotal(D) - total(D\F)over two plainAnalyticalRelations. Self-relations ofD\Fcancel in the difference; self-relations of the seeds survive. Enumeration (iteration, faces) is not supported – use concrete relations for that.Equality additionally requires matching seed distinctions: a fold summary with the same parent distinctions but a different seed set describes a different (incident-only) relation set, so it is a distinct value, not just a distinct view.
- sum_phi_by_distinction(distinctions=None)[source]#
Each distinction’s Σφ_r over the incident relations, in closed form.
A fold relation either contains a given distinction or does not, so its incident Σφ_r is the fold total differenced against the fold of the remaining distinctions — with the seed set restricted accordingly, since a relation avoiding a seed distinction is incident to the fold exactly when it touches one of the other seeds. The result is parallel to
distinctions, which defaults to the structure’s own.
Σ over incident relations of
φ_r · |r ∩ F| / |r|, whereFis the seed set.Computed without enumeration: for a single seed
d, the incident apportioned total istotal(D) - total(D\{d})over two closed-formAnalyticalRelationssums, and the share-weighted total overFis the sum of these single-seed incident totals (a relation of degree|r|bindingkseeds is countedktimes atφ_r/|r|).
- num_relations_of_degree(degree)[source]#
Return the number of incident relations with exactly
degreerelata.
- phi_histogram()[source]#
Return
{φ_r: count}over the incident relations.Bucket-wise difference of the parent and seed-free histograms. Each bucket key is
overlap size × densityrounded to the configured precision, where the density is a raw representative of a precision-rounded group of distinctions. The parent and seed-free histograms share bucket keys when these representatives are seed-independent, so the difference is well defined. A representative that is a seed can shift a key between the two histograms; that misalignment surfaces as a negative count and is raised rather than returned.
- binding_matrix()[source]#
Return the atom-pair binding matrix of the incident relations.
Entry-wise difference of the parent and seed-free matrices, on the parent’s atom index (rows for atoms bound only by seed-free relations go to zero).
- Return type:
DataFrame
- max_phi()[source]#
Return the maximum φ_r over the incident relations.
Notes
The incident maximum is attained at an incident pair or a seed’s self-relation: for any incident relation
S, its minimum-density memberd*paired with any seed inSis an incident pair with overlap containingO(S)and the same minimum density.- Return type:
- strongest(k=None, min_phi=None, max_degree=None)[source]#
Yield the incident relations in descending φ_r order.
Filters the parent’s descending stream by seed incidence, so the order is exact; non-incident relations are popped and discarded, so the cost tracks the parent stream’s, not the incident count.
- materialize(max_degree=None, min_phi=None)[source]#
Return the incident relations as an explicit
ConcreteRelations.- Parameters:
- Return type: