Skip to content

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.

Notifications You must be signed in to change notification settings

RonanD10/Hypergraphs-and-Orthoalgebras

Repository files navigation

Hypergraphs-and-Orthoalgebras

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.

Table of Contents

Displaying Hasse diagrams

Powersets - ps_hasse

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

alt text

Orthoalgebras (and Boolean Algebras) - oa_hasse

This program allows you to generate the Hasse diagram of an orthoalgebra (or a Boolean algebras). For example:

alt text

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 symmetric matrix with each element either or . If COMP[i,j] == 1, then elements and are compatible.
  • OPLUS is a symmetric matrix with entries satisfying
    • if COMP[i,j] == 1, then OPLUS[i,j] , where is the partial binary operation in the orthoalgebra
    • if COMP[i,j] == 0, then OPLUS[i,j] = -1, i.e. an element not in the orthoalgebra.

Checking Orthoalgebras - oa_check

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.

alt text

An invalid orthoalgebra.

alt text

Generating Orthoalgebras - oa_gen

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 if OPLUS satisfies the orthoalgebra associativity axiom
  • ass_checker checks if certains in OPLUS are associative with all other entries non-negative entries
  • generator checks if a valid OPLUS matrix exists for a specific COMP matrix
  • random_comp creates a random COMP matrix
  • temp_oplus creates a template OPLUS matrix with all necessary entries pre-filled
  • neg creates a valid NEG array of a given length

Examples:

Finding a valid orthoalgebra.

alt text

Determining no solution exists.

alt text

Displaying Hypergraphs - hg_show

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.

alt text

A plane.

alt text

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published