A repository of the programs used in my summer project about hypergraphs and orthoalgebras. In particular, the programs are mostly for displaying graphs of certain algebras, and for checking validity of candidate orthoalgebras.
It is necessary to have Graphviz installed in order to display the graphs. Info on Graphviz can be found here: https://graphviz.readthedocs.io/en/stable/manual.html.
- Displaying Hasse diagrams
- Checking Orthoalgebras - oa_check
- Generating Orthoalgebras - oa_gen
- Displaying Hypergraphs - hg_show
This program allows you to generate the Hasse diagram of a powerset. For example:
list = powerset([1,2]) # returns [[1,2],[1],[2],[]]
ps_hasse(list, 2) # returns Hasse diagram of listReturns
This program allows you to generate the Hasse diagram of an orthoalgebra (or a Boolean algebras). For example:
A note about the datatypes NEG, COMP, and OPLUS. Suppose the orthoalgebra in question contains elements.
NEGis an-element list such that it contains only the elements
.
COMPis a symmetricmatrix with each element either
or
. If
COMP[i,j] == 1, then elementsand
are compatible.
OPLUSis a symmetricmatrix with entries satisfying
This program allows you to check if an algebra (in the datatype defined above) is an orthoalgebra (or a Boolean algebra) or not. It does this by checking the axioms in the definition an orthoalgebra.
Examples:
A valid orthoalgebra.
An invalid orthoalgebra.
The program generates orthoalgebras by searching for an OPLUS matrix (if any) which satisfies the orthoalgebra axioms and corresponds to a given COMP matrix.
Explanation of functions:
oa_check2checks ifOPLUSsatisfies the orthoalgebra associativity axiomass_checkerchecks if certains inOPLUSare associative with all other entries non-negative entriesgeneratorchecks if a validOPLUSmatrix exists for a specificCOMPmatrixrandom_compcreates a randomCOMPmatrixtemp_opluscreates a templateOPLUSmatrix with all necessary entries pre-fillednegcreates a validNEGarray of a given length
Examples:
Finding a valid orthoalgebra.
Determining no solution exists.
This program display hypergraphs.
Explanation of datatypes:
ATOMSis a list of strings (which correspond points in the graph)LINESis a list containing 3-element lists (which correspond to the lines in the graph)PLANESis a list containing 7-element lists (which correspond to the planes in the graph)
Examples:
A point and a line.
A plane.







