wmayner / pyphi

A toolbox for integrated information theory.
https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1006343
Other
380 stars 97 forks source link

put strong connectivity check in config.SHORTCIRCUIT_SIA. #114

Open Astrocytes120 opened 11 months ago

Astrocytes120 commented 11 months ago

As Will advised, I changed the code in order to work in the SHORTCIRCUIT_SIA. As a result, it works in the same way as before, but let an user know the reason why the subsystem is trivial. If you have the other advice for trivial cases, please let me know it.

It works like this: tpm = np.array( [ [1, 0, 0], [1, 0, 0], [1, 0, 0], [1, 0, 0], [1, 0, 0], [1, 0, 0], [1, 1, 1], [1, 1, 1], ] )

cm = np.array([ [0,0,0], [0,1,1], [0,1,1], ])

labels= ["A", "B","C"] state0= (1,1,1)

For all possible subsystems, ┌────────────────────────────────────────┐ │ NullSystemIrreducibilityAnalysis │ │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ │ │ Subsystem: A,B,C │ │ Φ: 0.0 │ │ CAUSE: (0,1,1) │ │ II_c: 1.0 │ │ EFFECT: (1,1,1) │ │ II_e: 2.0 │ │ Reasons: NOT_STRONGLY_CONNECTED │ └────────────────────────────────────────┘ Subsystem(B, C) ┌──────────────────────────────────┐ │ SystemIrreducibilityAnalysis │ │ ━━━━━━━━━━━━━━━━━━━━━━━ │ │ Subsystem: B,C │ │ Current state: (1,1) │ │ φ_s: 2.0 │ │ Normalized φ_s: 1.0 │ │ CAUSE: (1,1) │ │ II_c: 2.0 │ │ EFFECT: (1,1) │ │ II_e: 2.0 │ │ #(tied MIPs): 0 │ │ Partition: │ │ 2 parts: {B,C} │ │ [[0 1] │ │ [1 0]] │ └──────────────────────────────────┘

Subsystem(A) ┌─────────────────────────────────────┐ │ NullSystemIrreducibilityAnalysis │ │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ │ │ Subsystem: A │ │ Φ: 0.0 │ │ CAUSE: (0) │ │ II_c: 0.0 │ │ EFFECT: (0) │ │ II_e: 0.0 │ │ Reasons: NO_CAUSE, NO_EFFECT │ └─────────────────────────────────────┘