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 list
Returns
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.
NEG
is an-element list such that it contains only the elements
.
COMP
is a symmetricmatrix with each element either
or
. If
COMP[i,j] == 1
, then elementsand
are compatible.
OPLUS
is 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_check2
checks ifOPLUS
satisfies the orthoalgebra associativity axiomass_checker
checks if certains inOPLUS
are associative with all other entries non-negative entriesgenerator
checks if a validOPLUS
matrix exists for a specificCOMP
matrixrandom_comp
creates a randomCOMP
matrixtemp_oplus
creates a templateOPLUS
matrix with all necessary entries pre-filledneg
creates a validNEG
array of a given length
Examples:
Finding a valid orthoalgebra.
Determining no solution exists.
This program display hypergraphs.
Explanation of datatypes:
ATOMS
is a list of strings (which correspond points in the graph)LINES
is a list containing 3-element lists (which correspond to the lines in the graph)PLANES
is a list containing 7-element lists (which correspond to the planes in the graph)
Examples:
A point and a line.
A plane.