\newif\ifws
%\wstrue
\ifws

\documentclass{article}

\usepackage{graphicx}        % standard LaTeX graphics tool
\usepackage[dvipsnames]{xcolor}
\usepackage[normalem]{ulem}

\usepackage{hyperref}
\hypersetup{
    colorlinks,
    linkcolor={blue!80!black},
    citecolor={red!75!black},
    urlcolor={blue!80!black}
}

% Damit die Verwendung der deutschen Sprache nicht ganz so umst\"andlich wird,
% sollte man die folgenden Pakete einbinden:


%German
%\usepackage[latin1]{inputenc}% erm\"oglich die direkte Eingabe der Umlaute
%\usepackage[T1]{fontenc} % das Trennen der Umlaute
%\usepackage{ngerman} % hiermit werden deutsche Bezeichnungen genutzt und
                     % die W\"orter werden anhand der neue Rechtschreibung
                     % automatisch getrennt.
\title{Exploring Quantum Contextuality with the Quantum M\"obius--Escher--Penrose hypergraph}
\author{Mirko Navara \\
        Faculty of Electrical Engineering
Czech Technical University in Prague,
Technick\'a 2,
CZ-166~27 Prague 6,
Czech Republic
        }
\author{Karl Svozil \\
        Institute for Theoretical Physics,
TU Wien,  \\
Wiedner Hauptstrasse 8-10/136,
1040 Vienna,  Austria
        }

\date{\today}
% Hinweis: \title{um was auch immer es geht}, \author{wer es auch immer
% geschrieben hat} und  \date{wann auch immer das war} k\"onnen vor
% oder nach dem  Kommando \begin{document} stehen
% Aber der \maketitle Befehl mu\ss{} nach dem \begin{document} Kommando stehen!

\newcommand{%!
\new}[1]{{\color{magenta}#1}}
\newcommand{%!
\deleted}[1]{{\color{magenta}\sout{#1}}}


\begin{document}

\maketitle


\begin{abstract}
This paper presents the quantum M\"obius--Escher--Penrose hypergraph, drawing inspiration from paradoxical constructs such as the M\"obius strip and Penrose's `impossible objects'. The hypergraph is constructed using faithful orthogonal representations in Hilbert space, thereby embedding the graph within a quantum framework. Additionally, a quasi-classical realization is achieved through two-valued states and partition logic, leading to an embedding within a~Boolean algebra. This dual representation delineates the distinctions between classical and quantum embeddings, with a particular focus on contextuality, highlighted by violations of exclusivity and completeness, quantified through classical and quantum probabilities. The study also examines violations of Boole's conditions of possible experience using correlation polytopes, underscoring the inherent contextuality of the hypergraph. These results offer deeper insights into quantum contextuality and its intricate relationship with classical logic structures.
\end{abstract}


\else
\PassOptionsToPackage{dvipsnames}{xcolor}
\documentclass[
% reprint,
  preprint,
 % twocolumn,
 %superscriptaddress,
 %groupedaddress,
 %unsortedaddress,
 %runinaddress,
 %frontmatterverbose,
 showpacs,
 showkeys,
 preprintnumbers,
 %nofootinbib,
 %nobibnotes,
 %bibnotes,
 amsmath,amssymb,
 aps,
 % prl,
  pra,
 % prb,
 % rmp,
 %prstab,
 %prstper,
 longbibliography,
 floatfix,
 %lengthcheck,
 ]{revtex4-2}

%\usepackage{cdmtcs-pdf}

\usepackage{mathptmx}% http://ctan.org/pkg/mathptmx



\usepackage{amssymb,amsthm,amsmath}

\usepackage{mathbbol}

\usepackage{tikz}
\usetikzlibrary{calc,math,decorations.shapes}
\usepackage {pgfplots}
\pgfplotsset {compat=1.8}
\usepackage{graphicx}% Include figure files
%\usepackage{url}

\usepackage{xcolor}
\usepackage[normalem]{ulem}

\usepackage{hyperref}
\hypersetup{
    colorlinks,
    linkcolor={blue},
    citecolor={red!75!black},
    urlcolor={blue}
}

\newcommand{%!
\new}[1]{{\color{magenta}#1}}
\newcommand{%!
\deleted}[1]{{\color{magenta}\sout{#1}}}


\begin{document}


\title{Exploring Quantum Contextuality with the Quantum M\"obius--Escher--Penrose hypergraph}

\author{Mirko Navara}
\email{navara@fel.cvut.cz}
\homepage{https://cmp.felk.cvut.cz/~navara}

\affiliation{Faculty of Electrical Engineering,
Czech Technical University in Prague,
Technick\'a 2,
CZ-166~27 Prague 6,
Czech Republic}

\author{Karl Svozil}
\email{karl.svozil@tuwien.ac.at}
\homepage{http://tph.tuwien.ac.at/~svozil}

\affiliation{Institute for Theoretical Physics,
TU Wien,
Wiedner Hauptstrasse 8-10/136,
1040 Vienna,  Austria}



\date{\today}

\begin{abstract}
This paper presents the quantum M\"obius--Escher--Penrose hypergraph, drawing inspiration from paradoxical constructs such as the M\"obius strip and Penrose's `impossible objects'. The hypergraph is constructed using faithful orthogonal representations in Hilbert space, thereby embedding the graph within a quantum framework. Additionally, a quasi-classical realization is achieved through two-valued states and partition logic, leading to an embedding within a~Boolean algebra. This dual representation delineates the distinctions between classical and quantum embeddings, with a particular focus on contextuality, highlighted by violations of exclusivity and completeness, quantified through classical and quantum probabilities. The paper also examines violations of Boole's conditions of possible experience using correlation polytopes, underscoring the inherent contextuality of the hypergraph. These results offer deeper insights into quantum contextuality and its intricate relationship with classical logic structures.
\end{abstract}

%\pacs{03.65.Aa, 03.65.Ta, 03.65.Ud, 03.67.-a}
\keywords{contextuality, two-valued states, quantum states}
%\preprint{CDMTCS preprint nr. x}

\maketitle

\newpage
\fi

\section{Introduction}

In this paper, we discuss a quantum analogue of the concept termed `impossible object' by Lionel Sharples Penrose and Roger Penrose~\cite{PENROSE_1958},
which was inspired by the paradoxical drawings of Maurits Cornelis Escher,
such as his  lithographs `Trappenhuis Stairs' and `Relativity'~\cite[plate 27]{Escher1954}.
These drawings depict structures that cannot exist in three-dimensional space,
leading to intriguing mathematical and artistic explorations.

The M\"obius strip, a related concept, has historically been represented in art and culture,
dating back to antiquity~\cite{cartwright-2016}.
With its single surface and edge, it challenges our conventional understanding of geometry
and has been a source of fascination and inspiration.

Building on these ideas, we introduce the M\"obius--Escher--Penrose hypergraph,
a structure depicted in Figure~\ref{2023-e-f1}.
This hypergraph was first introduced in a previous publication~\cite[Fig.~3, Eq.~(5)]{2023-navara-svozil},
where it was constructed using orthogonality hypergraphs.

The (hyper)edges of these hypergraphs represent the largest possible sets of mutually exclusive events,
which we will also refer to as contexts.
In quantum mechanics, all hyperedges (contexts) contain the same number of elements,
which can be identified with orthonormal bases, thereby forming uniform hypergraphs.
Contexts can intertwine when they contain more than two elements,
corresponding to orthonormal bases that share common elements.

The M\"obius--Escher--Penrose hypergraph
captures a very specific
structural connectivity of such intertwining contexts:
If one follows the context path (henceforth written in terms of the indices of their respective elements)
\(\{1,2,3\}-\{3,4,5\}-\{5,6,7\}-\{7,8,9\}-\{9,10,11\}-\{11,12,13\}-\{13,14,15\}-\{15,16,17\}-\{17,18,1\}-\{1,2,3\}\),
one realizes that these contexts `spiral back' to the original context \(\{1,2,3\}\) after a period of nine.
They are further intertwined by two additional contexts, \(\{2,8,14\}\) and \(\{4,10,16\}\).

If the two-valued measures separate elements on its edges, quasiclassical models of the propositional structure exist~\cite[Theorem~0]{kochen1}.
If these measures are derived from a quantum mechanical framework through orthogonal representations in Hilbert space,
the elements can be identified with vectors and their respective orthogonal projection operators.

In what follows we shall present  a more detailed exploration of the M\"obius--Escher--Penrose hypergraph,
highlighting its unique properties and its significance in understanding quantum contextuality
and the intricate relationship between classical logic structures and quantum mechanical systems.
In the next section, we elucidate how the hypergraph can be represented using quantum mechanics concepts such as vectors and operators.
The hypergraph is embedded into a quantum mechanical framework through orthogonal representations in Hilbert space.
Each edge of the hypergraph corresponds to an orthonormal basis,
ensuring a faithful embedding that respects the principles of quantum mechanics.

We introduce a classical counterpart to the quantum realization of the hypergraph.
By computing two-valued states and creating a partition logic,
we establish an embedding into a Boolean algebra.
This quasiclassical approach allows for a comparative analysis between classical and quantum embeddings,
highlighting the unique features and distinctions of quantum mechanical systems.

Next we demonstrate that certain classical aspects of the M\"obius--Escher--Penrose hypergraph involving quasicontexts
introduced in~\cite{2023-navara-svozil} violate the principle of exclusivity,
a cornerstone of classical probability theory.
These violations, however, are shown to be compatible with quantum mechanics.

Quantum contextuality can be expressed in terms of violations of George Boole's `conditions of possible experience'.
By translating binary value assignments into quantum mechanical expectations,
we show that the M\"obius--Escher--Penrose hypergraph violates these conditions in ways that classical physics cannot account for.
This exploration highlights the inherent contextuality of the hypergraph and the limitations
of classical explanations in capturing the vector space based probabilities of quantum systems.


\section{Quantum realization}

A faithful orthogonal representation (FOR) of a (hyper)graph involves labeling the graph with vectors, where adjacency corresponds to orthogonality \cite{lovasz-79,GroetschelLovaszSchrijver1986,Portillo-2015}. The associated quantum observables consist of orthogonal (self-adjoint) projection operators formed by dyadic products of these vectors. Thus, hypergraph edges correspond to contexts identified with orthonormal bases of Hilbert space.

Without loss of generality, a faithful orthogonal representation of the M\"obius--Escher--Penrose hypergraph depicted in Figure~\ref{2023-e-f1} can be constructed by beginning with an orthogonal tripod of vectors
$
v_4 = \begin{pmatrix} \sqrt{2}, 0, 1 \end{pmatrix}^\intercal
$,
$
v_{16} = \begin{pmatrix} -1, \sqrt{3}, \sqrt{2} \end{pmatrix}^\intercal
$, and
$
v_{10} = \begin{pmatrix} -1, -\sqrt{3}, \sqrt{2} \end{pmatrix}^\intercal
$,
where $^\intercal$ stands for transposition.
This tripod is rotated around the $z$-axis
$
\vert z\rangle = \begin{pmatrix} 0,0,1 \end{pmatrix}^\intercal
$ by the angle
\begin{equation}
\label{2024-e-alpha}
\alpha
=
2 \cot ^{-1}\left(\sqrt{\frac{11}{9}+\frac{1}{81}
   \sqrt[3]{2262816-69984 \sqrt{69}}+\frac{2^{5/3}}{9}
   \sqrt[3]{97+3 \sqrt{69}}}\right),
\end{equation}
resulting in the tripod of vectors
$v_2$, $v_{14}$, and $v_8$, respectively.
The construction progresses by taking the successive cross products
$v_3  =  v_4 \times v_2          $,
$v_{15} =  v_{16} \times v_{14}        $,
$v_9 =  v_{10} \times v_8          $,
$v_5  =   v_3 \times v_4         $,
$v_{17} =   v_{15} \times v_{16}       $,
$v_{11} =   v_9 \times v_{10}        $,
$v_1 =   v_3 \times v_2          $,
$v_{13} =   v_{15} \times v_{14}       $,
$v_7 =   v_9 \times v_8          $,
$v_6 =   v_7 \times v_5          $,
$v_{12} =   v_{13} \times v_{11}       $,  and
$v_{18} =   v_1 \times v_{17}        $.



\begin{figure}
\begin{center}
\begin{tabular}{ccc}
\resizebox{.46\textwidth}{!}{
\begin{tikzpicture} [scale=2]
\tikzstyle{every path}=[line width=2pt]

    % Define the coordinates for the vertices of the hexagon
    \coordinate (9) at (90:2);    % Vertex 9
    \coordinate (8) at (30:2);    % Vertex 8
    \coordinate (2) at (-30:2);   % Vertex 2
    \coordinate (3) at (-90:2);   % Vertex 3
    \coordinate (4) at (-150:2);  % Vertex 4
    \coordinate (10) at (150:2);   % Vertex 10



    % Label the vertices radiating from the origin
    \node at ($(9) + (90:0.3)$) {9};
    \node at ($(8) + (30:0.3)$) {8};
    \node at ($(2) + (-30:0.3)$) {2};
    \node at ($(3) + (-90:0.3)$) {3};
    \node at ($(4) + (-150:0.3)$) {4};
    \node at ($(10) + (150:0.3)$) {10};



    % Define the coordinates for the midpoints of the sides of the hexagon
    \coordinate (7) at ($(9)!0.5!(8)$); % Midpoint between A and B
    \coordinate (14) at ($(8)!0.5!(2)$); % Midpoint between B and C
    \coordinate (1) at ($(2)!0.5!(3)$); % Midpoint between C and D
    \coordinate (5) at ($(3)!0.5!(4)$); % Midpoint between D and E
    \coordinate (16) at ($(4)!0.5!(10)$); % Midpoint between E and F
    \coordinate (11) at ($(10)!0.5!(9)$); % Midpoint between F and A

    % Draw and fill circles at the midpoints

    % Label the midpoints radiating from the origin
    \node at ($(7) + (60:0.3)$) {7};
    \node at ($(14) + (0:0.3)$) {14};
    \node at ($(1) + (-60:0.3)$) {1};
    \node at ($(5) + (-120:0.3)$) {5};
    \node at ($(16) + (180:0.3)$) {16};
    \node at ($(11) + (120:0.3)$) {11};



    \coordinate (15) at (90:1);    % Vertex 15
    \node at ($(15) + (90:0.3)$) {15};

    \draw[orange]  (16) --  (15);
    \coordinate (17) at ($(16)!0.5!(15)$); % Midpoint between A and B
    \node at ($(17) + (170:0.3)$) {17};

    \draw[green]  (15) -- (14);
    \coordinate (13) at ($(15)!0.5!(14)$); % Midpoint between A and B
    \node at ($(13) + (10:0.3)$) {13};

    \draw[gray]  (7) -- (5);
    \coordinate (6) at ($(7)!0.5!(5)$); % Midpoint between A and B
    \node at ($(6) + (0:0.3)$) {6};

    \draw[brown]  (17) -- (1);
    \coordinate (18) at ($(17)!0.7!(1)$); % Midpoint between A and B
    \node at ($(18) + (190:0.3)$) {18};

    %\draw  (11) -- (13);
    %\coordinate (12) at (100:0.5); % Midpoint between A and B
    %\node at ($(12) + (90:0.3)$) {12};
    % Draw the Bezier curve from A to B through C
    \draw[violet] (11) .. controls (100:0.5) .. (13);
    % Calculate the point halfway along the curve
    \path (11) .. controls (100:0.5) .. (13) coordinate[pos=0.14] (12);

    % Draw a point at the midpoint
    \node at ($(12) + (75:0.3)$) {12};


    % Draw the hexagon
    %\draw (9) -- (8) -- (2) -- (3) -- (4) -- (10) -- cycle;
    \draw [red] (1) -- (3);
    \draw [red] (1) -- (2);

    \draw [blue] (3) -- (5);
    \draw [blue] (4) -- (5);

    %\draw [green] (13) -- (15);
    %\draw [orange] (15) -- (17);

    \draw [magenta] (7) -- (9);
    \draw [magenta] (7) -- (8);

    \draw [cyan] (9) -- (11);
    \draw [cyan] (10) -- (11);


    \draw [olive] (4) -- (10);
    \draw [teal] (8) -- (2);


    \draw [ultra thick,gray,dotted] (5) -- (11);
    \draw [ultra thick,gray,dotted] (1) -- (7);



    \fill[red    ] (1) circle  (3pt);
    \fill[red    ] (2) circle  (3pt);
    \fill[red    ] (3) circle  (3pt);
    \fill[blue   ] (4) circle  (3pt);
    \fill[blue   ] (5) circle  (3pt);
    \fill[gray   ] (6) circle  (3pt);
    \fill[magenta] (7) circle  (3pt);
    \fill[magenta] (8) circle  (3pt);
    \fill[cyan   ] (9) circle  (3pt);
    \fill[cyan   ] (10) circle (3pt);
    \fill[cyan   ] (11) circle (3pt);
    \fill[violet ] (12) circle (3pt);
    \fill[green  ] (13) circle (3pt);
    \fill[green  ] (14) circle (3pt);
    \fill[orange ] (15) circle (3pt);
    \fill[orange ] (16) circle (3pt);
    \fill[orange ] (17) circle (3pt);
    \fill[brown  ] (18) circle (3pt);

    \fill[brown  ] (1) circle  (2pt);
    \fill[teal   ] (2) circle  (2pt);
    \fill[blue   ] (3) circle  (2pt);
    \fill[olive  ] (4) circle  (2pt);
    \fill[gray   ] (5) circle  (2pt);

    \fill[gray   ] (7) circle  (2pt);
    \fill[teal   ] (8) circle  (2pt);
    \fill[magenta] (9) circle  (2pt);
    \fill[olive  ] (10) circle (2pt);
    \fill[violet ] (11) circle (2pt);

    \fill[violet ] (13) circle (2pt);
    \fill[teal   ] (14) circle (2pt);
    \fill[green  ] (15) circle (2pt);
    \fill[olive  ] (16) circle (2pt);
    \fill[brown  ] (17) circle (2pt);


\end{tikzpicture}
}
&$\qquad$&
\resizebox{.46\textwidth}{!}{\begin{tikzpicture}  [scale=1] %,label distance=1pt
\tikzstyle{every path}=[line width=2pt]

\tikzmath{\a = 1; \b = 2; \c = 0;}


\newdimen\ms
\ms=0.05cm


\tikzstyle{c3}=[circle,inner sep={\ms/8},minimum size=8*\ms]
\tikzstyle{c2}=[circle,inner sep={\ms/8},minimum size=5*\ms]
\tikzstyle{c1}=[circle,inner sep={\ms/8},minimum size=0.8*\ms]

\coordinate (1) at ({2*( \a +  \a + \b ) + 2*\c},{( \a +  \a + \b ) + 2*\c});
\coordinate (3) at ({( \a +  \a + \b )},0);
\coordinate (2) at ($(1)!0.5!(3)$);
\coordinate (5) at ({0-2*\c},{( \a +  \a + \b )+2*\c});
\coordinate (4) at ($(3)!0.5!(5)$);
\coordinate (13) at ({2*( \a +  \a + \b )-\a+\c},{( \a +  \a + \b )+\c});
\coordinate (15) at ({( \a +  \a + \b )},\a);
\coordinate (14) at ($(13)!0.5!(15)$);
\coordinate (17) at ({\a-\c},{( \a +  \a + \b )+\c});
\coordinate (16) at ($(15)!0.5!(17)$);
\coordinate (7) at ({2*( \a +  \a + \b )-2*\a},{( \a +  \a + \b )});
\coordinate (9) at ({( \a +  \a + \b )},{2*\a});
\coordinate (8) at ($(7)!0.5!(9)$);
\coordinate (11) at ({2*\a},{( \a +  \a + \b )});
\coordinate (10) at ($(9)!0.5!(11)$);

%\coordinate (6) at ($(5)!0.915!(7)$);
 \coordinate (12) at ($(11)!0.5!(13)$);
 \coordinate (18) at ($(17)!0.5!(1)$);

\draw [red] (1) -- (3);
\draw [blue] (3) -- (5);

\draw [green] (13) -- (15);
\draw [orange] (15) -- (17);

\draw [magenta] (7) -- (9);
\draw [cyan] (9) -- (11);


\draw [olive] (4) -- (10);
\draw [teal] (8) -- (2);


\draw [ultra thick,gray,dotted] (5) -- (11);
\draw [ultra thick,gray,dotted] (1) -- (7);


\draw [gray] (5) .. controls (\a,{1.6*( \a +  \a + \b )}) and ({ 2*( \a +  \a + \b ) - 2} ,{1.6*( \a +  \a + \b )}) .. (7)
                coordinate [pos=0.3] (6);
%              node[pos=0.3, c3,fill=gray, label={above left: $6$}] {};

\draw [brown] (17) .. controls ({ ( \a +  \a + \b ) - 2},{1.5*( \a +  \a + \b )}) and ({  ( \a +  \a + \b ) + 2} ,{1.5*( \a +  \a + \b )}) .. (1)
                coordinate [pos=0.8] (18);
%              node[pos=0.3, c3,fill=gray, label={above left: $6$}] {};

\draw [violet] (11) .. controls ({ ( \a +  \a + \b ) - 2},{1.3*( \a +  \a + \b )}) and ({ ( \a +  \a + \b ) + 2} ,{1.3*( \a +  \a + \b )}) .. (13)
                coordinate [pos=0.2] (12);
%              node[pos=0.3, c3,fill=gray, label={above left: $6$}] {};


\draw (1)  coordinate[c3,fill=red     ,label={below right: $1$}];
\draw (2)  coordinate[c3,fill=red     ,label={below right: $2$}];
\draw (3)  coordinate[c3,fill=red     ,label={below: $3$}];
\draw (4)  coordinate[c3,fill=blue    ,label={below: $4$}];
\draw (5)  coordinate[c3,fill=blue    ,label={below: $5$}];
\draw (6)  coordinate[c3,fill=gray    ,label={above left: $6$}];
\draw (7)  coordinate[c3,fill=magenta ,label={below: $7$}];
\draw (8)  coordinate[c3,fill=magenta ,label={below: $8$}];
\draw (9)  coordinate[c3,fill=cyan    ,label={below: $9$}];
\draw (10) coordinate[c3,fill=cyan    ,label={below: $10$}];
\draw (11) coordinate[c3,fill=cyan    ,label={below: $11$}];
\draw (12) coordinate[c3,fill=violet  ,label={below: $12$}];
\draw (13) coordinate[c3,fill=green   ,label={below: $13$}];
\draw (14) coordinate[c3,fill=green   ,label={below: $14$}];
\draw (15) coordinate[c3,fill=orange  ,label={below: $15$}];
\draw (16) coordinate[c3,fill=orange  ,label={below: $16$}];
\draw (17) coordinate[c3,fill=orange  ,label={below: $17$}];
\draw (18) coordinate[c3,fill=brown   ,label={above: $18$}];


\draw (1)  coordinate[c2,fill=brown  ];
\draw (2)  coordinate[c2,fill=teal   ];
\draw (3)  coordinate[c2,fill=blue   ];
\draw (4)  coordinate[c2,fill=olive  ];
\draw (5)  coordinate[c2,fill=gray   ];

\draw (7)  coordinate[c2,fill=gray   ];
\draw (8)  coordinate[c2,fill=teal   ];
\draw (9)  coordinate[c2,fill=magenta];
\draw (10) coordinate[c2,fill=olive  ];
\draw (11) coordinate[c2,fill=violet ];

\draw (13) coordinate[c2,fill=violet ];
\draw (14) coordinate[c2,fill=teal   ];
\draw (15) coordinate[c2,fill=green  ];
\draw (16) coordinate[c2,fill=olive  ];
\draw (17) coordinate[c2,fill=brown  ];



\end{tikzpicture}}
\end{tabular}
\end{center}
\caption{\label{2023-e-f1}
Equivalent representations of the M\"obius--Escher--Penrose hypergraph include smooth or straight lines to denote contexts,
while dotted lines represent pseudocontexts~\cite{2023-navara-svozil}.
The (index) labels $i$ stand for vectors $v_i$ or, more generally, elements $a_i$.
}
\end{figure}






\section{Quasiclassical realization}


A~\emph{state} $m$, representing the probabilistic or truth-value assignments, must
yield  the sum of~$1$ over all elements of a~context $\{a_1,\ldots,a_n\}$:
\begin{equation}\label{eq.context}
m(a_1) + \cdots + m(a_n)
= 1.
\end{equation}

A~\emph{two-valued state} has the range of $\{0,1\}$. Therefore, it selects exactly one $i$ such that ${m(a_i)=1}$.
This requirement is split to two elementary properties:
\begin{itemize}
    \item[(i)] \emph{Exclusivity}: There is at most one $i$ such that $m(a_i)=1$,
    \item[(ii)] \emph{Completeness}: There exists $i$ such that $m(a_i)=1$.
\end{itemize}

A~\emph{partition logic} is based on a set of partitions of a given finite set (without loss of generality, set of natural numbers).
Each partition is interpreted as a Boolean algebra whose atoms correspond to elementary propositions of that algebra.
In a final step, all of these algebras (corresponding to the partitions) are~\emph{pasted} together to form the partition logic.
As an elementary example, consider the set of two partitions
$
\Bigl\{\bigl\{\{1,2\},\{3,4\}\bigr\},\bigl\{\{1,3\},\{2,4\}\bigr\}\Bigr\}
$
of the four-element set $\{1,2,3,4\}$.
These partitions correspond to two Boolean algebras, each isomorphic to $2^2$:
one with atoms $\{1,2\}$ and $\{3,4\}$, and the other with atoms $\{1,3\}$ and $\{2,4\}$.
Their pasting~\cite{nav:91} forms a \emph{horizontal sum}, often referred to as a `Chinese lantern', with two common elements:
the maximal element $\{1,2,3,4\}$ and the minimal element $\emptyset$.
The order relation is defined by set-theoretic inclusion.
Such a logic can still be considered `classical' and noncontextual because it allows a faithful embedding into a Boolean algebra.
However, it also exhibits \emph{complementarity}, as the measurement of one subalgebra entails no knowledge of the other.


A quasiclassical embedding of the M\"obius--Escher--Penrose hypergraph is achieved by computing all $12$ two-valued states,
noticing that they are separating~\cite[Theorem~0]{kochen1}; and by constructing a partition logic
based on the set of indices of nonvanishing states associated with each hypergraph element~\cite{svozil-2001-eua}.
Table~\ref{2024-e-t1} enumerates the vector labels in both quasiclassical terms, represented by partition elements,
and quantum terms, represented by vectors.

\begin{table}
\caption{\label{2024-e-t1}Partition logic and vector label representations
of the  M\"obius--Escher--Penrose hypergraph.
$R\bigl(   \vert z\rangle , \alpha \bigr)$
 stands for the rotation matrix around the $z$-axis $\begin{pmatrix} 0,0,1 \end{pmatrix}^\intercal$
by the angle
$\alpha$ defined in~(\ref{2024-e-alpha}).
}
\begin{ruledtabular}
\begin{tabular}{ccc}
$a_i$ & partition element & vector $v_i$\\
\hline
$a_{1 }$& $\{1,2,3\}$            & $v_3 \times v_2          $                                                     \\
$a_{2 }$& $\{4,5,6,7\}$          & $R\bigl(   \vert z\rangle , \alpha \bigr) v_4    $        \\
$a_{3 }$& $\{8,9,10,11,12\}$     & $v_4 \times v_2          $                                                     \\
$a_{4 }$& $\{1,4,5,6\}$          & $\begin{pmatrix} \sqrt{2}, 0, 1 \end{pmatrix}^\intercal$                               \\
$a_{5 }$& $\{2,3,7\}$            & $v_3 \times v_4         $                                                      \\
$a_{6 }$& $\{1,4,5,8,9,10\}$     & $v_7 \times v_5          $                                                     \\
$a_{7 }$& $\{6,11,12\}$          & $v_9 \times v_8          $                                                     \\
$a_{8 }$& $\{1,2,8,9\}$          & $R\bigl(   \vert z\rangle , \alpha \bigr) v_{10}    $     \\
$a_{9 }$& $\{3,4,5,7,10\}$       & $v_{10} \times v_8          $                                                  \\
$a_{10}$& $\{2,8,9,11\}$         & $\begin{pmatrix} -1, -\sqrt{3}, \sqrt{2} \end{pmatrix}^\intercal$                      \\
$a_{11}$& $\{1,6,12\}$           & $v_9 \times v_{10}        $                                                    \\
$a_{12}$& $\{2,3,4,8,10,11\}$    & $v_{13} \times v_{11}       $                                                  \\
$a_{13}$& $\{5,7,9\}$            & $v_{15} \times v_{14}       $                                                  \\
$a_{14}$& $\{3,10,11,12\}$       & $R\bigl(   \vert z\rangle , \alpha \bigr) v_{16}    $     \\
$a_{15}$& $\{1,2,4,6,8\}$        & $v_{16} \times v_{14}        $                                                 \\
$a_{16}$& $\{3,7,10,12\}$        & $\begin{pmatrix} -1, \sqrt{3}, \sqrt{2} \end{pmatrix}^\intercal$                       \\
$a_{17}$& $\{5,9,11\}$           & $v_{15} \times v_{16}       $                                                  \\
$a_{18}$& $\{4,6,7,8,10,12\}$    & $v_1 \times v_{17}        $                                                    \\
\end{tabular}
\end{ruledtabular}
\end{table}



The construction of the quasiclassical faithful (homomorphic) embedding into a Boolean algebra \( 2^{12} \)~\cite{ZirlSchl-65}
is facilitated by a separating~\cite[Theorem~0]{kochen1} set of two-valued states.
The Travis matrix~\cite{travis-mt-62,greechie-66-PhD}
is a~matrix whose columns correspond to vertices of a~hypergraph (vectors in FOR) and rows correspond to two-valued states.
The matrix contains entries $0$ and $1$ depending on the evaluation of the vertex by the respective state.
The Travis matrix for the $12$ two-valued states on the hypergraph in Figure~\ref{2023-e-f1}
is enumerated in Table~\ref{2024-e-t2}.



\begin{table}
\caption{\label{2024-e-t2}Twelve two-valued (binary) states on the M\"obius--Escher--Penrose hypergraph.
}
\begin{ruledtabular}
\begin{tabular}{c|ccccccccccccccccccccccccccc}
$a_i$/\#&$a_{1}$&$a_{2}$&$a_{3}$&$a_{4}$&$a_{5}$&$a_{6}$&$a_{7}$&$a_{8}$&$a_{9}$&$a_{10}$&$a_{11}$&$a_{12}$&$a_{13}$&$a_{14}$&$a_{15}$&$a_{16}$&$a_{17}$&$a_{18}$\\
\hline
1  & 1& 0& 0& 1& 0& 1& 0& 1& 0& 0& 1& 0& 0& 0& 1& 0& 0& 0  \\
2  & 1& 0& 0& 0& 1& 0& 0& 1& 0& 1& 0& 1& 0& 0& 1& 0& 0& 0  \\
3  & 1& 0& 0& 0& 1& 0& 0& 0& 1& 0& 0& 1& 0& 1& 0& 1& 0& 0  \\
4  & 0& 1& 0& 1& 0& 1& 0& 0& 1& 0& 0& 1& 0& 0& 1& 0& 0& 1  \\
5  & 0& 1& 0& 1& 0& 1& 0& 0& 1& 0& 0& 0& 1& 0& 0& 0& 1& 0  \\
6  & 0& 1& 0& 1& 0& 0& 1& 0& 0& 0& 1& 0& 0& 0& 1& 0& 0& 1  \\
7  & 0& 1& 0& 0& 1& 0& 0& 0& 1& 0& 0& 0& 1& 0& 0& 1& 0& 1  \\
8  & 0& 0& 1& 0& 0& 1& 0& 1& 0& 1& 0& 1& 0& 0& 1& 0& 0& 1  \\
9  & 0& 0& 1& 0& 0& 1& 0& 1& 0& 1& 0& 0& 1& 0& 0& 0& 1& 0  \\
10 & 0& 0& 1& 0& 0& 1& 0& 0& 1& 0& 0& 1& 0& 1& 0& 1& 0& 1  \\
11 & 0& 0& 1& 0& 0& 0& 1& 0& 0& 1& 0& 1& 0& 1& 0& 0& 1& 0  \\
12 & 0& 0& 1& 0& 0& 0& 1& 0& 0& 0& 1& 0& 0& 1& 0& 1& 0& 1  \\
\end{tabular}
\end{ruledtabular}
\end{table}



\section{Contextuality by violation of exclusivity}



Let us consider an orthogonal basis $\{a_1, \ldots, a_n\}$.
As noted earlier, it represents a~\emph{context}, a maximal
set of events that can be simultaneously tested in one experiment.
Their states---representing the probabilistic or truth-value assignments---satisfy
\begin{equation}\label{eq.context1}
m(a_1) + \cdots + m(a_n)
= 1.
\end{equation}
for any state~$m$. % that assigns the value $m_i$ to $a_i$.
% \deletedkarl{ As a consequence, exclusivity holds: If $m_1 = 1$, then $m_2\cdots = m_n = 0$.
% }

Equations such as~\eqref{eq.context} or ~\eqref{eq.context1} %or~\eqref{eq.pseudocontext}
can hold also for collections of  elements
called pseudocontexts~\cite{2023-navara-svozil}
which are complementary, and, in the quantum context, do not satisfy any orthogonality relation.
% \deleted{; we call them pseudocontexts.}
% \deletedkarl{A~\emph{pseudocontext} is a~set of mutually nonorthogonal  vectors that satisfies some linear equality for the values of
% \emph{all} states.}
They contain collections of elements in a
hypergraph that have a total probability sum equal to that of other collections of elements in the same hypergraph.
Because they are complementary, elements in such pseudocontexts are not necessarily mutually exclusive.
Their probability measures do not necessarily sum to one.

In what follows we shall specify this condition by exemplifying
two pseudocontexts as two sets of three vectors, where the probability sum of the first three equals the probability
sum of the second three for all quantum states.


%
%In general, pseudocontexts (or pseudoblocks) are collections of elements (or vertices)
%in a hypergraph that do not belong to any hyperedge yet exhibit a state-independent total probability sum.
%Consequently,
%\begin{itemize}
%    \item[(i)] The number of elements does not necessarily coincide with the number of elements or vertices in each hyperedge
%          of the uniform hypergraph.
%    \item[(ii)] The state (probability) sums are not necessarily equal to one.
%    \item[(iii)] The elements or vertices are mutually complementary and thus cannot be mutually exclusive.
%    \item[(iv)] Pseudocontexts may, but need not, coincide with other collections in the hypergraph.
%\end{itemize}
%The notions of exclusivity and completeness extend naturally to pseudocontexts, where they need not hold in general.
%
%In what follows, we adopt a more restrictive definition of pseudocontext by refining conditions (i) and (iv).
%Specifically, we consider only sets of vertices whose cardinality matches that of the uniform hypergraph.
%Additionally, we examine multiple pseudocontexts within the same hypergraph.
%In particular, the M\"obius--Escher--Penrose hypergraph contains two pseudocontexts of cardinality three.
%
%This property remains valid even in quasiclassical representations of the hypergraph.
Classically, for two-valued states, the two pseudocontexts $\{5,11,17\}$ and $\{1,7,13\}$ (henceforth written in terms of the indices of their elements) obey exclusivity:
if one of their elements has value $1$, the others must be $0$.
This property arises because the pairs of their elements form a true-implies-false (TIFS) gadget~\cite{2018-minimalYIYS},
specifically a Specker bug~\cite[Fig.~1, p.~182]{kochen2} (reprinted in Ref.~\cite{specker-ges}].
This can be verified by inspecting the set of two-valued states in Table~\ref{2024-e-t2}
or by proof by contradiction:
Assume both elements have value $1$ and follow admissibility until a contradiction is reached,
such as all elements of a context having value $0$ or two elements in a context having value $1$.

The pseudocontexts do not satisfy completeness, as all elements can have value $0$.
Consequently, we derive an upper bound on the classical probabilistic or truth-value assignments on pseudocontexts:
\begin{equation}
m(a_5) + m(a_{11}) + m(a_{17}) = m(a_1) + m(a_7) + m(a_{13}) \le 1.
\label{2014-e-bfapc}
\end{equation}



These bounds are maximally violated by the quantum probabilities for states perpendicular to the rotation axis
$\vert z\rangle = \begin{pmatrix} 0,0,1 \end{pmatrix}^\intercal$,
as the (multiple, identical) eigenvalue of $E_5+E_{11}+E_{17}=E_1+E_7+E_{13}$
with $E_i = \vert v_i \rangle \langle v_i \vert /  \langle v_i \vert   v_i \rangle$,
for the $\vert x\rangle = \begin{pmatrix} 1,0,0 \end{pmatrix}^\intercal$ and $\vert y\rangle = \begin{pmatrix} 0,1,0 \end{pmatrix}^\intercal$ axes,
is
\begin{equation}
\begin{aligned}
&\langle x \vert E_5+E_{11}+E_{17} \vert x \rangle = \langle x \vert E_1+E_7+E_{13}  \vert x \rangle
\\
&\quad = \langle y \vert E_5+E_{11}+E_{17} \vert y \rangle = \langle y \vert E_1+E_7+E_{13}  \vert y \rangle
\\
&\quad =\frac{1}{6} \left(10-10 \sqrt[3]{\frac{2}{3 \sqrt{69}-11}}+2^{2/3} \sqrt[3]{3 \sqrt{69}-11}\right)
\\
&\quad \approx 1.43016
.
\end{aligned}
\label{2014-e-bfapc-q}
\end{equation}
This two-dimensional form of quantum contextuality is
in-between Hardy-type paradoxes~\cite{Cabello-2013-Hardylike,2018-minimalYIYS}
that operate with a single TIFS resulting in violations for a one-dimensional subspace of Hilbert space,
and Yu and Oh's state-independent proof of {K}ochen-{S}pecker Theorem~\cite{Yu-2012,cabello2021contextuality}.


The TIFS pairs
$(2,10)$,
$(4,14)$
and $(8,16)$,
require the `paradoxical periodic closure' of the hypergraph.

\section{Contextuality by violation of {B}oole's `Conditions of Possible Experience'}

In addition to the primary constraints on probabilities \( p_i \) of events---namely,
that they should not be negative or greater than one---there are ``other conditions'' that will, as Boole pointed out~\cite[p.~229]{Boole-62},
\emph{``be capable of expression by
equations or inequations reducible to the general (linear) form
\(a_1p_1+a_2p_2+\cdots a_n p_n+a \ge 0, \)
$a_1, a_2, \ldots a_n, a$
being numerical constants which differ for the different conditions in
question.''}
This applies also to joint probabilities, and affine---in particular, linear---transformations thereof.


In what follows we shall transcribe binary value assignments into expectations and operator values
by the affine transformation
$ A = 1 - 2 s $ which, for each context or hyperedge, produces two values $1$ and a~single value~$-1$, corresponding
to $s$ being $0$ and~$1$, respectively.
Quantum mechanically this translates into Householder transformations~\cite{svozil-2021-hh}
$\mathbf{A} = \mathbb{1}_3 - 2 \vert x \rangle \langle x \vert $,
where $\vert x \rangle$ is the unit vector corresponding to the quantum state
$\vert x \rangle \langle x \vert$
associated with a two-valued state~$s$ \cite{Klyachko-2008,cabello:210401}.
Note that the way it is constructed $\mathbf{A}$ has a unit eigenvector $\vert x \rangle$ with eigenvalue~$-1$;
more explicitly, $\mathbf{A}\vert x \rangle =   \mathbb{1}_3 \vert x \rangle - 2 \vert x \rangle \underbrace{\langle x  \vert x \rangle}_{1}
= - \vert x \rangle$.
The (multiple) eigenvalue~$1$ is obtained for any orthonormal basis spanning the (hyper)plane orthogonal to $\vert x \rangle$:
Take, for instance, any unit vector $\vert y \rangle$ with $ \langle x \vert y \rangle =0$.
Then  $\mathbf{A}\vert y \rangle =   \mathbb{1}_3 \vert y \rangle - 2 \vert x \rangle \underbrace{\langle x  \vert y \rangle}_{0}
=   \vert y \rangle$.


A systematic route to
{B}oole's `conditions of possible experience'~\cite{Boole-62,Pit-94}
is via (correlation) polytopes: First the `extreme' cases are computed
which are then encoded into vectors.
In a~second step `mixed' classical probabilities or correlations are obtained
by a~convex sum over those extreme cases, and vectors.
The latter convex linear combination of vectors forms a correlation polytope.
In a third and final stage, the polytope is represented
by an equivalent representation in term of its faces---its hull~\cite{ziegler}.
The transcription of vertex to the latter representation
is called the hull problem.
The classical bounds---{B}oole's
`conditions of possible experience'---can then be
identified with the face (in)equalities
obtained from solving the hull problem~\cite{froissart-81,pitowsky-86},
also, in a generalized form, for  intertwining (pasted~\cite{nav:91}) contexts~\cite{svozil-2001-cesena,Klyachko-2008}.


Although the polytope method is systematic, the particular choice of the correlations yielding deviations with {B}oole's
conditions of possible experience appears to be heuristic and \textit{ad hoc.}
Let us, for instance, form 12 vectors $w_i$ with the index $1 \le i \le 12$ referring to the $i$th  two-valued state
enumerated in Table~\ref{2024-e-t2}.
The components of $w_i$  are the products of two  elements of the same context---the ones that intertwine with the next context, following
a M\"obius--Escher--Penrose path $1-3-5-7-9-11-13-15-17-1$ of contexts:
\begin{equation}
w_i =
\begin{pmatrix}
A_{1 } A_{3 }  ,
A_{3 } A_{5 }  ,
A_{5 } A_{7 }  ,
A_{7 } A_{9 }  ,
A_{9 } A_{11}  ,
A_{11} A_{13}  ,
A_{13} A_{15}  ,
A_{15} A_{17}  ,
A_{17} A_{1 }
\end{pmatrix}^\intercal_i
\label{2024-e-booleconfig}
\end{equation}
Components $w_1 , \ldots , w_{12}$ can be interpreted as nine-dimensional vertices of a convex polytope
$\lambda_1 w_1 + \cdots  +\lambda_{12} w_{12}$
with the convex sum $\lambda_1  + \cdots  + \lambda_{12} =1$ for
$0\le \lambda_i \le 1$, and $1 \le i \le 12$.


\subsection{Hull equalities}


Solving the hull problem yields 30 faces~\cite{cdd-pck,pycddlib},
among them two equalities
\begin{equation}
\begin{split}
 \langle A_{3}A_{5 } \rangle + \langle A_{9}A_{11 } \rangle + \langle A_{15}A_{17 } \rangle = -1 \,,  \\
 \langle A_{1}A_{3 } \rangle + \langle A_{7}A_{9 } \rangle  + \langle A_{13}A_{15 } \rangle = -1 \,.  \\
\end{split}
\label{2024-e-Booleequal}
\end{equation}
Classically, they are  consequences of exclusivity and completeness (admissibility):
Exactly one of the elements of the contexts
$\{4,10,16\}$
and
$\{2,8,14\}$
has to be assigned the value $s=1$ and thus $A=-1$, and two elements $s=0$ and thus $A=1$.
As a consequence the product of the other two elements of the three context intertwining with, say,
$\{4,10,16\}$, needs to be once $1 \times 1=1$ and twice $-1 \times 1= -1$.

This argument does not need the full structure of the M\"obius--Escher--Penrose hypergraph:
A~`pruned' subset consisting of four contexts and depicted in Figure~\ref{2023-e-fsubs4con} suffices.
The quantum double of this pruned configuration is
%\begin{equation}
%\begin{split}
$
 \mathbf{B}_{4}\mathbf{B}_{5 }
+   \mathbf{B}_{6}\mathbf{B}_{7}
+   \mathbf{B}_{8}\mathbf{B}_{9}
= - \mathbb{1}_3
$
%\end{split}
%\label{2024-e-Booleequal-quantumprooned}
%\end{equation}
which is satisfied also for
$
\mathbf{A}_3\mathbf{A}_5
+\mathbf{A}_5\mathbf{A}_9
+\mathbf{A}_9\mathbf{A}_{11}
= - \mathbb{1}_3
$, as well as for
$\mathbf{A}_{11}\mathbf{A}_{15}
+\mathbf{A}_{15}\mathbf{A}_{17}
+\mathbf{A}_{17}\mathbf{A}_1
= - \mathbb{1}_3
$.
Hence, no discrepancy with classical expectations,
and, therefore, no quantum contextuality
can be derived from the two hull equalities~(\ref{2024-e-Booleequal}).

Nevertheless, these equalities yield an intuitive understanding
of the pseudocontexts~\cite{2023-navara-svozil}:
because two such gadgets as the one depicted in Figure~\ref{2023-e-fsubs4con}, `tied together'
at three elements---in this case $3$, $9$, and $15$---with equal sums, require
the respective sum of the `open ends'
$\{1,7,13\}$ and
$\{5,11,17\}$ are also equal.

\begin{figure}
\begin{center}
\resizebox{.35\textwidth}{!}{
\begin{tikzpicture}
\tikzstyle{every path}=[line width=2.5pt]

% Draw horizontal base line
\draw [red] (0,0) -- (10,0);

% Draw vertical lines at the ends and middle of the horizontal line
\draw [blue] (0,0) -- (0,6);
\draw [orange] (5,0) -- (5,6);
\draw [green] (10,0) -- (10,6);

% Points on the horizontal line
\fill [red] (0,0) circle (6pt) node[below=0.23cm] {\color{black}1};
\fill [red] (5,0) circle (6pt) node[below=0.23cm] {\color{black}2};
\fill [red] (10,0) circle (6pt) node[below=0.23cm] {\color{black}3};

\fill [blue] (0,0) circle (4pt);
\fill [orange] (5,0) circle (4pt);
\fill [green] (10,0) circle (4pt);

% Points on the vertical lines
\fill [blue] (0,3) circle (4pt) node[right=0.15cm] {\color{black}4};
\fill [orange] (5,3) circle (4pt) node[right=0.15cm] {\color{black}6};
\fill [green] (10,3) circle (4pt) node[right=0.15cm] {\color{black}8};

\fill [blue] (0,6) circle (4pt) node[right=0.15cm] {\color{black}5};
\fill [orange] (5,6) circle (4pt) node[right=0.15cm] {\color{black}7};
\fill [green] (10,6) circle (4pt) node[right=0.15cm] {\color{black}9};

\end{tikzpicture}
}
\end{center}
\caption{\label{2023-e-fsubs4con}
Gadget formed from a subset of the M\"obius--Escher--Penrose hypergraph reproducing equalities~\eqref{2024-e-Booleequal}.
The operator-valued equality from the hull computation in this pruned configuration is
$\langle B_{4}B_{5 } \rangle + \langle B_{6}B_{7} \rangle + \langle B_{8}B_{9} \rangle = -1$,
with $B_{i} = 1-2 v_i$.
}
\end{figure}


\subsection{Hull inequalities}

The remaining 28 hull inequalities can be grouped to collections of descending number of summands:
%\begin{equation}
%\begin{aligned}
%-1&\le A_5A_7 + A_{11}A_{13} + A_{17}A_{1}                                             ,  \\
%-3&\le 2A_3A_5 - A_5A_7 + 2A_9A_{11} + A_{11}A_{13} + A_{17}A_{1}                      ,  \\
%-3&\le 2A_3A_5 - A_5A_7 + 2A_7A_9 + A_{11}A_{13} + A_{17}A_{1}                         ,  \\
%-3&\le 2A_1A_3 - A_5A_7 + 2A_7A_9 + A_{11}A_{13} + A_{17}A_{1}                         ,  \\
%-1&\le A_3A_5 - A_7A_9 + A_9A_{11}                                                     ,  \\
%-1&\le A_3A_5                                                                          ,  \\
%-1&\le A_1A_3                                                                          ,  \\
%-1&\le 2A_1A_3 - 2A_3A_5 + A_5A_7 - 2A_9A_{11} + A_{11}A_{13} - A_{17}A_{1}            ,  \\
%-1&\le A_5A_7 - 2A_9A_{11} + A_{11}A_{13} - A_{17}A_{1}                                ,  \\
%-1&\le A_5A_7 - 2A_7A_9 + A_{11}A_{13} - A_{17}A_{1}                                   ,  \\
%-1&\le - 2A_3A_5 + A_5A_7 - A_{11}A_{13} + A_{17}A_{1}                                 ,  \\
%-1&\le - 2A_1A_3 + A_5A_7 - A_{11}A_{13} + A_{17}A_{1}                                 ,  \\
%-1&\le - 2A_1A_3 + A_5A_7 - 2A_7A_9 + 2A_9A_{11} - A_{11}A_{13} + A_{17}A_{1}          ,  \\
%-1&\le A_5A_7 - 2A_7A_9 + 2A_9A_{11} - A_{11}A_{13} - A_{17}A_{1}                      ,  \\
%-1&\le A_5A_7 - A_{11}A_{13} - A_{17}A_{1}                                             ,  \\
%-1&\le  2A_1A_3 - 2A_3A_5 + A_5A_7 - A_{11}A_{13} - A_{17}A_{1}                        ,  \\
%-1&\le - A_5A_7 - A_{11}A_{13} + A_{17}A_{1}                                           ,  \\
%-1&\le - 2A_1A_3 + 2A_3A_5 - A_5A_7 - A_{11}A_{13} + A_{17}A_{1}                       ,  \\
%-1&\le - 2A_1A_3 + 2A_3A_5 - A_5A_7 - 2A_7A_9 + 2A_9A_{11} - A_{11}A_{13} + A_{17}A_{1},  \\
%-1&\le  A_1A_3 - A_3A_5 + A_7A_9                                                       ,  \\
%-1&\le  A_7A_9                                                                         ,  \\
%-1&\le  A_9A_{11}                                                                      ,  \\
%-0&\le - A_3A_5 - A_9A_{11}                                                            ,  \\
%-0&\le - A_1A_3 - A_9A_{11}                                                            ,  \\
%-0&\le - A_1A_3 - A_7A_9                                                               ,  \\
%-1&\le  2A_1A_3 - 2A_3A_5 - A_5A_7 + 2A_7A_9 - 2A_9A_{11} + A_{11}A_{13} - A_{17}A_{1} ,  \\
%-1&\le - A_5A_7 + 2A_7A_9 - 2A_9A_{11} + A_{11}A_{13} - A_{17}A_{1}                    ,  \\
%-1&\le - A_5A_7 + A_{11}A_{13} - A_{17}A_{1}                                           .
%\end{aligned}
%\end{equation}
\begin{equation}
\begin{aligned}
1:-1&\le 2 \langle A_1A_3\rangle - 2 \langle A_3A_5\rangle - \langle A_5A_7\rangle + 2 \langle A_7A_9\rangle - 2 \langle A_9A_{11}\rangle + \langle A_{11}A_{13}\rangle - \langle A_{17}A_{1} \rangle ,\\
2:\phantom{-}1&\ge  2 \langle A_1A_3\rangle - 2 \langle A_3A_5\rangle + \langle A_5A_7\rangle + 2 \langle A_7A_9\rangle - 2 \langle A_9A_{11}\rangle + \langle A_{11}A_{13}\rangle - \langle A_{17}A_{1}\rangle ,\\
3:-1&\le 2 \langle A_1A_3\rangle - 2 \langle A_3A_5\rangle + \langle A_5A_7\rangle - 2 \langle A_9A_{11}\rangle + \langle A_{11}A_{13}\rangle - \langle A_{17}A_{1}\rangle ,\\
4:-1&\le  - 2 \langle A_1A_3\rangle + \langle A_5A_7\rangle - 2 \langle A_7A_9\rangle + 2 \langle A_9A_{11}\rangle - \langle A_{11}A_{13}\rangle + \langle A_{17}A_{1}\rangle ,\\
5:-3&\le 2 \langle A_3A_5\rangle - \langle A_5A_7\rangle + 2 \langle A_9A_{11}\rangle + \langle A_{11}A_{13}\rangle + \langle A_{17}A_{1}\rangle ,\\
6:-3&\le 2 \langle A_3A_5\rangle - \langle A_5A_7\rangle + 2 \langle A_7A_9\rangle + \langle A_{11}A_{13}\rangle + \langle A_{17}A_{1} \rangle ,\\
7:-3&\le 2 \langle A_1A_3\rangle - \langle A_5A_7\rangle + 2 \langle A_7A_9\rangle + \langle A_{11}A_{13}\rangle + \langle A_{17}A_{1} \rangle ,\\
8:-1&\le 2 \langle A_1A_3\rangle - 2 \langle A_3A_5\rangle + \langle A_5A_7\rangle - \langle A_{11}A_{13}\rangle - \langle A_{17}A_{1}\rangle ,\\
9:-1&\le  - 2 \langle A_1A_3\rangle + 2 \langle A_3A_5\rangle - \langle A_5A_7\rangle - \langle A_{11}A_{13}\rangle + \langle A_{17}A_{1} \rangle ,\\
10:-1&\le \langle A_5A_7\rangle - 2 \langle A_7A_9\rangle + 2 \langle A_9A_{11}\rangle - \langle A_{11}A_{13}\rangle - \langle A_{17}A_{1}\rangle ,\\
11:-1&\le  - \langle A_5A_7\rangle + 2 \langle A_7A_9\rangle - 2 \langle A_9A_{11}\rangle + \langle A_{11}A_{13}\rangle - \langle A_{17}A_{1}\rangle ,\\
12-15:-1&\le \{ - 2 \langle A_3A_5\rangle + \langle A_5A_7\rangle - \langle A_{11}A_{13}\rangle + \langle A_{17}A_{1} \rangle , - 2 \langle A_1A_3\rangle + \langle A_5A_7\rangle \\
 & \qquad - \langle A_{11}A_{13}\rangle + \langle A_{17}A_{1} \rangle, \langle A_5A_7\rangle - 2 \langle A_9A_{11}\rangle + \langle A_{11}A_{13}\rangle - \langle A_{17}A_{1}\rangle , \\
 & \qquad \langle A_5A_7\rangle - 2 \langle A_7A_9\rangle + \langle A_{11}A_{13}\rangle - \langle A_{17}A_{1} \rangle \},\\
16-19:-1&\le \{ \langle A_5A_7\rangle + \langle A_{11}A_{13}\rangle + \langle A_{17}A_{1} \rangle, \langle A_5A_7\rangle - \langle A_{11}A_{13}\rangle - \langle A_{17}A_{1} \rangle ,\\
  & \qquad  - \langle A_5A_7\rangle - \langle A_{11}A_{13}\rangle + \langle A_{17}A_{1} \rangle ,  - \langle A_5A_7\rangle + \langle A_{11}A_{13}\rangle - \langle A_{17}A_{1} \rangle \}, \\
20,21:-1&\le \{\langle A_3A_5\rangle - \langle A_7A_9\rangle + \langle A_9A_{11} \rangle , \langle A_1A_3\rangle - \langle A_3A_5\rangle + \langle A_7A_9 \rangle \} ,\\
22-24:\phantom{-}0&\le  \{ - \langle A_3A_5\rangle - \langle A_9A_{11}\rangle , - \langle A_1A_3\rangle - \langle A_9A_{11}\rangle ,  - \langle A_1A_3\rangle - \langle A_7A_9 \rangle \} ,\\
25-28:-1&\le \{ \langle A_3A_5\rangle ,  \langle A_1A_3\rangle ,  \langle A_7A_9 \rangle ,   \langle A_9A_{11}\rangle \} .
\end{aligned}
\label{2024-e-bbti}
\end{equation}
Heuristically, the `longest' such summations are the `most likely' to be violated quantum mechanically,
whereas the `shortest' are, according to Boole, just rules
from the requirement for probability  `of being positive proper fractions'~\cite[p.~229]{Boole-62}.
Table~\ref{2024-e-contextualities} enumerates the  violations of Boole's generalized (for multiple intertwining context) conditions of possible experience:
\begin{table}
\caption{\label{2024-e-contextualities}Contextuality by violation of Boole's generalized
(for multiple intertwining context) conditions of possible experience.}
\begin{ruledtabular}
\begin{tabular}{cccccccccccccccccccccccccccc}
\# & eigenvalue of maximal violation & eigenvector \\
from Eq.~(\ref{2024-e-bbti})& (numerical) & (numerical) \\
\hline
1  & -3 & $\begin{pmatrix}0.981557, 0.173328, -0.0806446\end{pmatrix}^\intercal$  \\
5  & -3.89807 & $\begin{pmatrix}0.491309, -0.837518, -0.239123\end{pmatrix}^\intercal$  \\
6  & -3.89807 & $\begin{pmatrix}0.95734, -0.162235, -0.239123\end{pmatrix}^\intercal$  \\
7  & -2.26894 & $\begin{pmatrix}0.195441, -0.683898, -0.702913\end{pmatrix}^\intercal$  \\
12  & -1.89807 & $\begin{pmatrix}0.970966, 0.00672715, 0.239123\end{pmatrix}^\intercal$  \\
13  & -1.89807 & $\begin{pmatrix}0.619169, 0.747964, 0.239123\end{pmatrix}^\intercal$  \\
14  & -1.89807 & $\begin{pmatrix}0.479657, 0.844245, -0.239123\end{pmatrix}^\intercal$  \\
15  & -2.12744 & $\begin{pmatrix}0.553247, -0.811751, 0.187022\end{pmatrix}^\intercal$  \\
16  & -1.36373 & $\begin{pmatrix}0.0343782, 0.426292, -0.903932\end{pmatrix}^\intercal$  \\
17  & -1.36373 & $\begin{pmatrix}0.351991, -0.242918, -0.903932\end{pmatrix}^\intercal$  \\
18  & -1.36373 & $\begin{pmatrix}0.0343782, 0.426292, -0.903932\end{pmatrix}^\intercal$  \\
19  & -1.36373 & $\begin{pmatrix}0.386369, 0.183374, 0.903932\end{pmatrix}^\intercal$  \\
20  & -1.64944 & $\begin{pmatrix}0.428768, -0.903415, 0\end{pmatrix}^\intercal$  \\
21  & -1.64944 & $\begin{pmatrix}0.996764, -0.0803837, 0\end{pmatrix}^\intercal$  \\
23  & -0.64944 & $\begin{pmatrix}0.567996, 0.823031, 0\end{pmatrix}^\intercal$
\end{tabular}
\end{ruledtabular}
\end{table}




\section{Chromatic contextuality}
If contexts are considered representations of maximal empirical knowledge about a quantum state and are identified with maximal observables \cite[Satz~8, p.~221f]{v-neumann-31} (for a contemporary review, see Halmos \cite[\S84, p.171f]{halmos-vs}), then the study of chromatic numbers and hypergraph colorings \cite{svozil-2021-chroma,svozil-2025-color} becomes highly significant. In particular, each color corresponds to a distinct measurement outcome when measuring a context associated with a maximal observable. This observable's nondegenerate spectrum includes all orthogonal projection operators corresponding to the vectors labeling the hypergraph vertices.


A brute-force computation yields \(3! \times 3 = 18\) possible colorings of the M\"obius--Escher--Penrose hypergraph,
as enumerated in Table~\ref{2024-e-t-chroma} and depicted in Figure~\ref{2023-e-f-color}.
The factor \(3!\) accounts for permutations of colors, which do not provide any structural information.
Consequently, the remaining three distinct colorings (up to permutations) represent the fundamental chromatic modes of the hypergraph.

\begin{table}
\caption{\label{2024-e-t-chroma}Three non-isomorphic (with respect to permutations of colors) colorings (up to permutations of the colors) of the M\"obius--Escher--Penrose hypergraph.
}
\begin{ruledtabular}
\begin{tabular}{c|ccccccccccccccccccccccccccc}
$a_i$/\#&$a_{1}$&$a_{2}$&$a_{3}$&$a_{4}$&$a_{5}$&$a_{6}$&$a_{7}$&$a_{8}$&$a_{9}$&$a_{10}$&$a_{11}$&$a_{12}$&$a_{13}$&$a_{14}$&$a_{15}$&$a_{16}$&$a_{17}$&$a_{18}$\\
\hline
1 &  1& 2& 3& 1& 2& 1& 3& 1& 2& 3& 1& 3& 2& 3& 1& 2& 3& 2 \\
2 &  1& 2& 3& 2& 1& 2& 3& 1& 2& 1& 3& 1& 2& 3& 1& 3& 2& 3 \\
3 &  1& 2& 3& 2& 1& 3& 2& 3& 1& 3& 2& 1& 3& 1& 2& 1& 3& 2
\end{tabular}
\end{ruledtabular}
\end{table}

\begin{figure}
\begin{center}
\begin{tabular}{ccccc}
\resizebox{.27\textwidth}{!}{
\begin{tikzpicture} [scale=2]
\tikzstyle{every path}=[line width=2pt]

    % Define the coordinates for the vertices of the hexagon
    \coordinate (9) at (90:2);    % Vertex 9
    \coordinate (8) at (30:2);    % Vertex 8
    \coordinate (2) at (-30:2);   % Vertex 2
    \coordinate (3) at (-90:2);   % Vertex 3
    \coordinate (4) at (-150:2);  % Vertex 4
    \coordinate (10) at (150:2);   % Vertex 10



    % Label the vertices radiating from the origin
    \node at ($(9) + (90:0.3)$) {\color{black}9};
    \node at ($(8) + (30:0.3)$) {\color{black}8};
    \node at ($(2) + (-30:0.3)$) {\color{black}2};
    \node at ($(3) + (-90:0.3)$) {\color{black}3};
    \node at ($(4) + (-150:0.3)$) {\color{black}4};
    \node at ($(10) + (150:0.3)$) {\color{black}10};



    % Define the coordinates for the midpoints of the sides of the hexagon
    \coordinate (7) at ($(9)!0.5!(8)$); % Midpoint between A and B
    \coordinate (14) at ($(8)!0.5!(2)$); % Midpoint between B and C
    \coordinate (1) at ($(2)!0.5!(3)$); % Midpoint between C and D
    \coordinate (5) at ($(3)!0.5!(4)$); % Midpoint between D and E
    \coordinate (16) at ($(4)!0.5!(10)$); % Midpoint between E and F
    \coordinate (11) at ($(10)!0.5!(9)$); % Midpoint between F and A

    % Draw and fill circles at the midpoints

    % Label the midpoints radiating from the origin
    \node at ($(7) + (60:0.3)$) {\color{black}7};
    \node at ($(14) + (0:0.3)$) {\color{black}14};
    \node at ($(1) + (-60:0.3)$) {\color{black}1};
    \node at ($(5) + (-120:0.3)$) {\color{black}5};
    \node at ($(16) + (180:0.3)$) {\color{black}16};
    \node at ($(11) + (120:0.3)$) {\color{black}11};



    \coordinate (15) at (90:1);    % Vertex 15
    \node at ($(15) + (90:0.3)$) {\color{black}15};

    \draw[orange]  (16) --  (15);
    \coordinate (17) at ($(16)!0.5!(15)$); % Midpoint between A and B
    \node at ($(17) + (170:0.3)$) {\color{black}17};

    \draw[green]  (15) -- (14);
    \coordinate (13) at ($(15)!0.5!(14)$); % Midpoint between A and B
    \node at ($(13) + (10:0.3)$) {\color{black}13};

    \draw[gray]  (7) -- (5);
    \coordinate (6) at ($(7)!0.5!(5)$); % Midpoint between A and B
    \node at ($(6) + (0:0.3)$) {\color{black}6};

    \draw[brown]  (17) -- (1);
    \coordinate (18) at ($(17)!0.7!(1)$); % Midpoint between A and B
    \node at ($(18) + (190:0.3)$) {\color{black}18};

    %\draw  (11) -- (13);
    %\coordinate (12) at (100:0.5); % Midpoint between A and B
    %\node at ($(12) + (90:0.3)$) {\color{black}12};
    % Draw the Bezier curve from A to B through C
    \draw[violet] (11) .. controls (100:0.5) .. (13);
    % Calculate the point halfway along the curve
    \path (11) .. controls (100:0.5) .. (13) coordinate[pos=0.14] (12);

    % Draw a point at the midpoint
    \node at ($(12) + (75:0.3)$) {\color{black}12};


    % Draw the hexagon
    %\draw (9) -- (8) -- (2) -- (3) -- (4) -- (10) -- cycle;
    \draw [red] (1) -- (3);
    \draw [red] (1) -- (2);

    \draw [blue] (3) -- (5);
    \draw [blue] (4) -- (5);

    %\draw [green] (13) -- (15);
    %\draw [orange] (15) -- (17);

    \draw [magenta] (7) -- (9);
    \draw [magenta] (7) -- (8);

    \draw [cyan] (9) -- (11);
    \draw [cyan] (10) -- (11);


    \draw [olive] (4) -- (10);
    \draw [teal] (8) -- (2);


    \draw [ultra thick,gray,dotted] (5) -- (11);
    \draw [ultra thick,gray,dotted] (1) -- (7);


    \fill[red, decorate, decoration=zigzag ] (1) circle  (4pt);
    \fill[green] (2) circle  (4pt);
    \node[blue, fill, minimum width=14pt, minimum height=14pt] at  (3) {};
    \fill[red, decorate, decoration=zigzag  ] (4) circle  (4pt);
    \fill[green] (5) circle  (4pt);
    \fill[red, decorate, decoration=zigzag  ] (6) circle  (4pt);
    \node[blue, fill, minimum width=14pt, minimum height=14pt] at  (7) {};
    \fill[red, decorate, decoration=zigzag  ] (8) circle  (4pt);
    \fill[green] (9) circle  (4pt);
    \node[blue, fill, minimum width=14pt, minimum height=14pt] at  (10) {};
    \fill[red, decorate, decoration=zigzag  ] (11) circle (4pt);
    \node[blue, fill, minimum width=14pt, minimum height=14pt] at  (12) {};
    \fill[green] (13) circle (4pt);
    \node[blue, fill, minimum width=14pt, minimum height=14pt] at  (14) {};
    \fill[red, decorate, decoration=zigzag  ] (15) circle (4pt);
    \fill[green] (16) circle (4pt);
    \node[blue, fill, minimum width=14pt, minimum height=14pt] at  (17) {};
    \fill[green] (18) circle (4pt);

\end{tikzpicture}
}
&$\qquad$&
\resizebox{.27\textwidth}{!}{
\begin{tikzpicture} [scale=2]
\tikzstyle{every path}=[line width=2pt]

    % Define the coordinates for the vertices of the hexagon
    \coordinate (9) at (90:2);    % Vertex 9
    \coordinate (8) at (30:2);    % Vertex 8
    \coordinate (2) at (-30:2);   % Vertex 2
    \coordinate (3) at (-90:2);   % Vertex 3
    \coordinate (4) at (-150:2);  % Vertex 4
    \coordinate (10) at (150:2);   % Vertex 10



    % Label the vertices radiating from the origin
    \node at ($(9) + (90:0.3)$) {\color{black}9};
    \node at ($(8) + (30:0.3)$) {\color{black}8};
    \node at ($(2) + (-30:0.3)$) {\color{black}2};
    \node at ($(3) + (-90:0.3)$) {\color{black}3};
    \node at ($(4) + (-150:0.3)$) {\color{black}4};
    \node at ($(10) + (150:0.3)$) {\color{black}10};



    % Define the coordinates for the midpoints of the sides of the hexagon
    \coordinate (7) at ($(9)!0.5!(8)$); % Midpoint between A and B
    \coordinate (14) at ($(8)!0.5!(2)$); % Midpoint between B and C
    \coordinate (1) at ($(2)!0.5!(3)$); % Midpoint between C and D
    \coordinate (5) at ($(3)!0.5!(4)$); % Midpoint between D and E
    \coordinate (16) at ($(4)!0.5!(10)$); % Midpoint between E and F
    \coordinate (11) at ($(10)!0.5!(9)$); % Midpoint between F and A

    % Draw and fill circles at the midpoints

    % Label the midpoints radiating from the origin
    \node at ($(7) + (60:0.3)$) {\color{black}7};
    \node at ($(14) + (0:0.3)$) {\color{black}14};
    \node at ($(1) + (-60:0.3)$) {\color{black}1};
    \node at ($(5) + (-120:0.3)$) {\color{black}5};
    \node at ($(16) + (180:0.3)$) {\color{black}16};
    \node at ($(11) + (120:0.3)$) {\color{black}11};



    \coordinate (15) at (90:1);    % Vertex 15
    \node at ($(15) + (90:0.3)$) {\color{black}15};

    \draw[orange]  (16) --  (15);
    \coordinate (17) at ($(16)!0.5!(15)$); % Midpoint between A and B
    \node at ($(17) + (170:0.3)$) {\color{black}17};

    \draw[green]  (15) -- (14);
    \coordinate (13) at ($(15)!0.5!(14)$); % Midpoint between A and B
    \node at ($(13) + (10:0.3)$) {\color{black}13};

    \draw[gray]  (7) -- (5);
    \coordinate (6) at ($(7)!0.5!(5)$); % Midpoint between A and B
    \node at ($(6) + (0:0.3)$) {\color{black}6};

    \draw[brown]  (17) -- (1);
    \coordinate (18) at ($(17)!0.7!(1)$); % Midpoint between A and B
    \node at ($(18) + (190:0.3)$) {\color{black}18};

    %\draw  (11) -- (13);
    %\coordinate (12) at (100:0.5); % Midpoint between A and B
    %\node at ($(12) + (90:0.3)$) {\color{black}12};
    % Draw the Bezier curve from A to B through C
    \draw[violet] (11) .. controls (100:0.5) .. (13);
    % Calculate the point halfway along the curve
    \path (11) .. controls (100:0.5) .. (13) coordinate[pos=0.14] (12);

    % Draw a point at the midpoint
    \node at ($(12) + (75:0.3)$) {\color{black}12};


    % Draw the hexagon
    %\draw (9) -- (8) -- (2) -- (3) -- (4) -- (10) -- cycle;
    \draw [red] (1) -- (3);
    \draw [red] (1) -- (2);

    \draw [blue] (3) -- (5);
    \draw [blue] (4) -- (5);

    %\draw [green] (13) -- (15);
    %\draw [orange] (15) -- (17);

    \draw [magenta] (7) -- (9);
    \draw [magenta] (7) -- (8);

    \draw [cyan] (9) -- (11);
    \draw [cyan] (10) -- (11);


    \draw [olive] (4) -- (10);
    \draw [teal] (8) -- (2);


    \draw [ultra thick,gray,dotted] (5) -- (11);
    \draw [ultra thick,gray,dotted] (1) -- (7);



    \fill[red, decorate, decoration=zigzag  ] (1) circle  (4pt);
    \fill[green] (2) circle  (4pt);
    \node[blue, fill, minimum width=14pt, minimum height=14pt] at  (3) {};
    \fill[green] (4) circle  (4pt);
    \fill[red, decorate, decoration=zigzag  ] (5) circle  (4pt);
    \fill[green] (6) circle  (4pt);
    \node[blue, fill, minimum width=14pt, minimum height=14pt] at  (7) {};
    \fill[red, decorate, decoration=zigzag  ] (8) circle  (4pt);
    \fill[green] (9) circle  (4pt);
    \fill[red, decorate, decoration=zigzag  ] (10) circle (4pt);
    \node[blue, fill, minimum width=14pt, minimum height=14pt] at  (11) {};
    \fill[red, decorate, decoration=zigzag  ] (12) circle (4pt);
    \fill[green] (13) circle (4pt);
    \node[blue, fill, minimum width=14pt, minimum height=14pt] at  (14) {};
    \fill[red, decorate, decoration=zigzag  ] (15) circle (4pt);
    \node[blue, fill, minimum width=14pt, minimum height=14pt] at  (16) {};
    \fill[green] (17) circle (4pt);
    \node[blue, fill, minimum width=14pt, minimum height=14pt] at  (18) {};

\end{tikzpicture}
}
&$\qquad$&
\resizebox{.27\textwidth}{!}{
\begin{tikzpicture} [scale=2]
\tikzstyle{every path}=[line width=2pt]

    % Define the coordinates for the vertices of the hexagon
    \coordinate (9) at (90:2);    % Vertex 9
    \coordinate (8) at (30:2);    % Vertex 8
    \coordinate (2) at (-30:2);   % Vertex 2
    \coordinate (3) at (-90:2);   % Vertex 3
    \coordinate (4) at (-150:2);  % Vertex 4
    \coordinate (10) at (150:2);   % Vertex 10



    % Label the vertices radiating from the origin
    \node at ($(9) + (90:0.3)$) {\color{black}9};
    \node at ($(8) + (30:0.3)$) {\color{black}8};
    \node at ($(2) + (-30:0.3)$) {\color{black}2};
    \node at ($(3) + (-90:0.3)$) {\color{black}3};
    \node at ($(4) + (-150:0.3)$) {\color{black}4};
    \node at ($(10) + (150:0.3)$) {\color{black}10};



    % Define the coordinates for the midpoints of the sides of the hexagon
    \coordinate (7) at ($(9)!0.5!(8)$); % Midpoint between A and B
    \coordinate (14) at ($(8)!0.5!(2)$); % Midpoint between B and C
    \coordinate (1) at ($(2)!0.5!(3)$); % Midpoint between C and D
    \coordinate (5) at ($(3)!0.5!(4)$); % Midpoint between D and E
    \coordinate (16) at ($(4)!0.5!(10)$); % Midpoint between E and F
    \coordinate (11) at ($(10)!0.5!(9)$); % Midpoint between F and A

    % Draw and fill circles at the midpoints

    % Label the midpoints radiating from the origin
    \node at ($(7) + (60:0.3)$) {\color{black}7};
    \node at ($(14) + (0:0.3)$) {\color{black}14};
    \node at ($(1) + (-60:0.3)$) {\color{black}1};
    \node at ($(5) + (-120:0.3)$) {\color{black}5};
    \node at ($(16) + (180:0.3)$) {\color{black}16};
    \node at ($(11) + (120:0.3)$) {\color{black}11};



    \coordinate (15) at (90:1);    % Vertex 15
    \node at ($(15) + (90:0.3)$) {\color{black}15};

    \draw[orange]  (16) --  (15);
    \coordinate (17) at ($(16)!0.5!(15)$); % Midpoint between A and B
    \node at ($(17) + (170:0.3)$) {\color{black}17};

    \draw[green]  (15) -- (14);
    \coordinate (13) at ($(15)!0.5!(14)$); % Midpoint between A and B
    \node at ($(13) + (10:0.3)$) {\color{black}13};

    \draw[gray]  (7) -- (5);
    \coordinate (6) at ($(7)!0.5!(5)$); % Midpoint between A and B
    \node at ($(6) + (0:0.3)$) {\color{black}6};

    \draw[brown]  (17) -- (1);
    \coordinate (18) at ($(17)!0.7!(1)$); % Midpoint between A and B
    \node at ($(18) + (190:0.3)$) {\color{black}18};

    %\draw  (11) -- (13);
    %\coordinate (12) at (100:0.5); % Midpoint between A and B
    %\node at ($(12) + (90:0.3)$) {\color{black}12};
    % Draw the Bezier curve from A to B through C
    \draw[violet] (11) .. controls (100:0.5) .. (13);
    % Calculate the point halfway along the curve
    \path (11) .. controls (100:0.5) .. (13) coordinate[pos=0.14] (12);

    % Draw a point at the midpoint
    \node at ($(12) + (75:0.3)$) {\color{black}12};


    % Draw the hexagon
    %\draw (9) -- (8) -- (2) -- (3) -- (4) -- (10) -- cycle;
    \draw [red] (1) -- (3);
    \draw [red] (1) -- (2);

    \draw [blue] (3) -- (5);
    \draw [blue] (4) -- (5);

    %\draw [green] (13) -- (15);
    %\draw [orange] (15) -- (17);

    \draw [magenta] (7) -- (9);
    \draw [magenta] (7) -- (8);

    \draw [cyan] (9) -- (11);
    \draw [cyan] (10) -- (11);


    \draw [olive] (4) -- (10);
    \draw [teal] (8) -- (2);


    \draw [ultra thick,gray,dotted] (5) -- (11);
    \draw [ultra thick,gray,dotted] (1) -- (7);



    \fill[red, decorate, decoration=zigzag  ] (1) circle  (4pt);
    \fill[green] (2) circle  (4pt);
    \node[blue, fill, minimum width=14pt, minimum height=14pt] at  (3) {};
    \fill[green] (4) circle  (4pt);
    \fill[red, decorate, decoration=zigzag  ] (5) circle  (4pt);
    \node[blue, fill, minimum width=14pt, minimum height=14pt] at  (6) {};
    \fill[green] (7) circle  (4pt);
    \node[blue, fill, minimum width=14pt, minimum height=14pt] at  (8) {};
    \fill[red, decorate, decoration=zigzag  ] (9) circle  (4pt);
    \node[blue, fill, minimum width=14pt, minimum height=14pt] at  (10) {};
    \fill[green] (11) circle (4pt);
    \fill[red, decorate, decoration=zigzag  ] (12) circle (4pt);
    \node[blue, fill, minimum width=14pt, minimum height=14pt] at  (13) {};
    \fill[red, decorate, decoration=zigzag  ] (14) circle (4pt);
    \fill[green] (15) circle (4pt);
    \fill[red, decorate, decoration=zigzag  ] (16) circle (4pt);
    \node[blue, fill, minimum width=14pt, minimum height=14pt] at  (17) {};
    \fill[green] (18) circle (4pt);

\end{tikzpicture}
}
\\
(1)&&(2)&&(3)
\end{tabular}
\end{center}
\caption{\label{2023-e-f-color}
Three non-isomorphic (with respect to permutations of colors) colorings of the M\"obius--Escher--Penrose hypergraph, as enumerated in Table~\ref{2024-e-t-chroma}. The colors are represented by distinct shapes: circles, stars, and squares, respectively.
}
\end{figure}

Any such coloring is also a valid coloring of the pseudocontexts
\(\{1,7,13\}\) and \(\{5,11,17\}\), as all three colors appear in each pseudocontext for all legal colorings of the hypergraph.
This is particularly remarkable because any `reduced' two-valued state---based on colorings, where
a single color is mapped to the value \(1\) and the remaining two colors to \(0\)---effectively
transforms the pseudocontexts into classical contexts.
That is, for such reduced measures on pseudocontexts, the sum of the measures must equal one.

Three of the two-valued measures---specifically, state numbers 4, 8, and 10, as listed in Table~\ref{2024-e-t2} and illustrated
in Figure~\ref{2023-e-f-color-tws}---cannot be extended to a 3-coloring.
Their sums vanish on the pseudocontexts.
Consequently, removing them in the set-theoretic embedding, where a partition logic is represented in Table~\ref{2024-e-t1},
results in two complete partitions---and thus, contexts.

Therefore, with this reduced set of two-valued states we obtain classical predictions that yield
\begin{equation}
m(a_1)+m(a_7)+m(a_{13})=m(a_5)+m(a_{11})+m(a_{17})=1,
\label{2014-e-spcredtvs}
\end{equation}
for the sum of states of each set---as compared to the upper bound of one in Equation~(\ref{2014-e-bfapc}).
%This deviates from the quantum mechanical predictions for all states that differ from the six vectors
%$v_1,v_5,v_7,v_{11},v_{13},v_{17}$ of the pseudocontexts
%as enumerated in Table~\ref{2024-e-t1}.
%The maximum violation of the quantum probability sums occurs with a state corresponding to the $z$--axis:
%\begin{equation}
%\begin{split}
%\vert \langle z \vert v_1 \rangle \vert^2 +
%\vert \langle z \vert v_7 \rangle \vert^2 +
%\vert \langle z \vert v_{13} \rangle \vert^2 =
%\vert \langle z \vert v_5 \rangle \vert^2 +
%\vert \langle z \vert v_{11} \rangle \vert^2 +
%\vert \langle z \vert v_{17} \rangle \vert^2 \\
%=\frac{1}{3} \left(-1-10 \sqrt[3]{\frac{2}{11+3
%   \sqrt{69}}}+2^{2/3} \sqrt[3]{11+3 \sqrt{69}}\right)\approx 0.139681<1.
%\end{split}
%\label{2014-e-spcredtvsqm}
%\end{equation}



\begin{figure}
\begin{center}
\begin{tabular}{ccccc}
\resizebox{.27\textwidth}{!}{
\begin{tikzpicture} [scale=2]
\tikzstyle{every path}=[line width=2pt]

    % Define the coordinates for the vertices of the hexagon
    \coordinate (9) at (90:2);    % Vertex 9
    \coordinate (8) at (30:2);    % Vertex 8
    \coordinate (2) at (-30:2);   % Vertex 2
    \coordinate (3) at (-90:2);   % Vertex 3
    \coordinate (4) at (-150:2);  % Vertex 4
    \coordinate (10) at (150:2);   % Vertex 10



    % Label the vertices radiating from the origin
    \node at ($(9) + (90:0.3)$) {\color{black}9};
    \node at ($(8) + (30:0.3)$) {\color{black}8};
    \node at ($(2) + (-30:0.3)$) {\color{black}2};
    \node at ($(3) + (-90:0.3)$) {\color{black}3};
    \node at ($(4) + (-150:0.3)$) {\color{black}4};
    \node at ($(10) + (150:0.3)$) {\color{black}10};



    % Define the coordinates for the midpoints of the sides of the hexagon
    \coordinate (7) at ($(9)!0.5!(8)$); % Midpoint between A and B
    \coordinate (14) at ($(8)!0.5!(2)$); % Midpoint between B and C
    \coordinate (1) at ($(2)!0.5!(3)$); % Midpoint between C and D
    \coordinate (5) at ($(3)!0.5!(4)$); % Midpoint between D and E
    \coordinate (16) at ($(4)!0.5!(10)$); % Midpoint between E and F
    \coordinate (11) at ($(10)!0.5!(9)$); % Midpoint between F and A

    % Draw and fill circles at the midpoints

    % Label the midpoints radiating from the origin
    \node at ($(7) + (60:0.3)$) {\color{black}7};
    \node at ($(14) + (0:0.3)$) {\color{black}14};
    \node at ($(1) + (-60:0.3)$) {\color{black}1};
    \node at ($(5) + (-120:0.3)$) {\color{black}5};
    \node at ($(16) + (180:0.3)$) {\color{black}16};
    \node at ($(11) + (120:0.3)$) {\color{black}11};



    \coordinate (15) at (90:1);    % Vertex 15
    \node at ($(15) + (90:0.3)$) {\color{black}15};

    \draw[orange]  (16) --  (15);
    \coordinate (17) at ($(16)!0.5!(15)$); % Midpoint between A and B
    \node at ($(17) + (170:0.3)$) {\color{black}17};

    \draw[green]  (15) -- (14);
    \coordinate (13) at ($(15)!0.5!(14)$); % Midpoint between A and B
    \node at ($(13) + (10:0.3)$) {\color{black}13};

    \draw[gray]  (7) -- (5);
    \coordinate (6) at ($(7)!0.5!(5)$); % Midpoint between A and B
    \node at ($(6) + (0:0.3)$) {\color{black}6};

    \draw[brown]  (17) -- (1);
    \coordinate (18) at ($(17)!0.7!(1)$); % Midpoint between A and B
    \node at ($(18) + (190:0.3)$) {\color{black}18};

    %\draw  (11) -- (13);
    %\coordinate (12) at (100:0.5); % Midpoint between A and B
    %\node at ($(12) + (90:0.3)$) {\color{black}12};
    % Draw the Bezier curve from A to B through C
    \draw[violet] (11) .. controls (100:0.5) .. (13);
    % Calculate the point halfway along the curve
    \path (11) .. controls (100:0.5) .. (13) coordinate[pos=0.14] (12);

    % Draw a point at the midpoint
    \node at ($(12) + (75:0.3)$) {\color{black}12};


    % Draw the hexagon
    %\draw (9) -- (8) -- (2) -- (3) -- (4) -- (10) -- cycle;
    \draw [red] (1) -- (3);
    \draw [red] (1) -- (2);

    \draw [blue] (3) -- (5);
    \draw [blue] (4) -- (5);

    %\draw [green] (13) -- (15);
    %\draw [orange] (15) -- (17);

    \draw [magenta] (7) -- (9);
    \draw [magenta] (7) -- (8);

    \draw [cyan] (9) -- (11);
    \draw [cyan] (10) -- (11);


    \draw [olive] (4) -- (10);
    \draw [teal] (8) -- (2);


    \draw [ultra thick,gray,dotted] (5) -- (11);
    \draw [ultra thick,gray,dotted] (1) -- (7);



    \fill[green ] (1) circle  (4pt);
    \fill[red, decorate, decoration=zigzag] (2) circle  (4pt);
    \fill[green] (3) circle  (4pt);
    \fill[red, decorate, decoration=zigzag] (4) circle  (4pt);
    \fill[green] (5) circle  (4pt);
    \fill[red, decorate, decoration=zigzag] (6) circle  (4pt);
    \fill[green] (7) circle  (4pt);
    \fill[green ] (8) circle  (4pt);
    \fill[red, decorate, decoration=zigzag] (9) circle  (4pt);
    \fill[green] (10) circle (4pt);
    \fill[green ] (11) circle (4pt);
    \fill[red, decorate, decoration=zigzag] (12) circle (4pt);
    \fill[green] (13) circle (4pt);
    \fill[green] (14) circle (4pt);
    \fill[red, decorate, decoration=zigzag ] (15) circle (4pt);
    \fill[green] (16) circle (4pt);
    \fill[green] (17) circle (4pt);
    \fill[red, decorate, decoration=zigzag] (18) circle (4pt);

\end{tikzpicture}
}
&$\qquad$&
\resizebox{.27\textwidth}{!}{
\begin{tikzpicture} [scale=2]
\tikzstyle{every path}=[line width=2pt]

    % Define the coordinates for the vertices of the hexagon
    \coordinate (9) at (90:2);    % Vertex 9
    \coordinate (8) at (30:2);    % Vertex 8
    \coordinate (2) at (-30:2);   % Vertex 2
    \coordinate (3) at (-90:2);   % Vertex 3
    \coordinate (4) at (-150:2);  % Vertex 4
    \coordinate (10) at (150:2);   % Vertex 10



    % Label the vertices radiating from the origin
    \node at ($(9) + (90:0.3)$) {\color{black}9};
    \node at ($(8) + (30:0.3)$) {\color{black}8};
    \node at ($(2) + (-30:0.3)$) {\color{black}2};
    \node at ($(3) + (-90:0.3)$) {\color{black}3};
    \node at ($(4) + (-150:0.3)$) {\color{black}4};
    \node at ($(10) + (150:0.3)$) {\color{black}10};



    % Define the coordinates for the midpoints of the sides of the hexagon
    \coordinate (7) at ($(9)!0.5!(8)$); % Midpoint between A and B
    \coordinate (14) at ($(8)!0.5!(2)$); % Midpoint between B and C
    \coordinate (1) at ($(2)!0.5!(3)$); % Midpoint between C and D
    \coordinate (5) at ($(3)!0.5!(4)$); % Midpoint between D and E
    \coordinate (16) at ($(4)!0.5!(10)$); % Midpoint between E and F
    \coordinate (11) at ($(10)!0.5!(9)$); % Midpoint between F and A

    % Draw and fill circles at the midpoints

    % Label the midpoints radiating from the origin
    \node at ($(7) + (60:0.3)$) {\color{black}7};
    \node at ($(14) + (0:0.3)$) {\color{black}14};
    \node at ($(1) + (-60:0.3)$) {\color{black}1};
    \node at ($(5) + (-120:0.3)$) {\color{black}5};
    \node at ($(16) + (180:0.3)$) {\color{black}16};
    \node at ($(11) + (120:0.3)$) {\color{black}11};



    \coordinate (15) at (90:1);    % Vertex 15
    \node at ($(15) + (90:0.3)$) {\color{black}15};

    \draw[orange]  (16) --  (15);
    \coordinate (17) at ($(16)!0.5!(15)$); % Midpoint between A and B
    \node at ($(17) + (170:0.3)$) {\color{black}17};

    \draw[green]  (15) -- (14);
    \coordinate (13) at ($(15)!0.5!(14)$); % Midpoint between A and B
    \node at ($(13) + (10:0.3)$) {\color{black}13};

    \draw[gray]  (7) -- (5);
    \coordinate (6) at ($(7)!0.5!(5)$); % Midpoint between A and B
    \node at ($(6) + (0:0.3)$) {\color{black}6};

    \draw[brown]  (17) -- (1);
    \coordinate (18) at ($(17)!0.7!(1)$); % Midpoint between A and B
    \node at ($(18) + (190:0.3)$) {\color{black}18};

    %\draw  (11) -- (13);
    %\coordinate (12) at (100:0.5); % Midpoint between A and B
    %\node at ($(12) + (90:0.3)$) {\color{black}12};
    % Draw the Bezier curve from A to B through C
    \draw[violet] (11) .. controls (100:0.5) .. (13);
    % Calculate the point halfway along the curve
    \path (11) .. controls (100:0.5) .. (13) coordinate[pos=0.14] (12);

    % Draw a point at the midpoint
    \node at ($(12) + (75:0.3)$) {\color{black}12};


    % Draw the hexagon
    %\draw (9) -- (8) -- (2) -- (3) -- (4) -- (10) -- cycle;
    \draw [red] (1) -- (3);
    \draw [red] (1) -- (2);

    \draw [blue] (3) -- (5);
    \draw [blue] (4) -- (5);

    %\draw [green] (13) -- (15);
    %\draw [orange] (15) -- (17);

    \draw [magenta] (7) -- (9);
    \draw [magenta] (7) -- (8);

    \draw [cyan] (9) -- (11);
    \draw [cyan] (10) -- (11);


    \draw [olive] (4) -- (10);
    \draw [teal] (8) -- (2);


    \draw [ultra thick,gray,dotted] (5) -- (11);
    \draw [ultra thick,gray,dotted] (1) -- (7);



    \fill[green ] (1) circle  (4pt);
    \fill[green] (2) circle  (4pt);
    \fill[red, decorate, decoration=zigzag] (3) circle  (4pt);
    \fill[green] (4) circle  (4pt);
    \fill[green ] (5) circle  (4pt);
    \fill[red, decorate, decoration=zigzag] (6) circle  (4pt);
    \fill[green] (7) circle  (4pt);
    \fill[red, decorate, decoration=zigzag ] (8) circle  (4pt);
    \fill[green] (9) circle  (4pt);
    \fill[red, decorate, decoration=zigzag ] (10) circle (4pt);
    \fill[green] (11) circle (4pt);
    \fill[red, decorate, decoration=zigzag ] (12) circle (4pt);
    \fill[green] (13) circle (4pt);
    \fill[green] (14) circle (4pt);
    \fill[red, decorate, decoration=zigzag ] (15) circle (4pt);
    \fill[green] (16) circle (4pt);
    \fill[green] (17) circle (4pt);
    \fill[red, decorate, decoration=zigzag] (18) circle (4pt);

\end{tikzpicture}
}
&$\qquad$&
\resizebox{.27\textwidth}{!}{
\begin{tikzpicture} [scale=2]
\tikzstyle{every path}=[line width=2pt]

    % Define the coordinates for the vertices of the hexagon
    \coordinate (9) at (90:2);    % Vertex 9
    \coordinate (8) at (30:2);    % Vertex 8
    \coordinate (2) at (-30:2);   % Vertex 2
    \coordinate (3) at (-90:2);   % Vertex 3
    \coordinate (4) at (-150:2);  % Vertex 4
    \coordinate (10) at (150:2);   % Vertex 10



    % Label the vertices radiating from the origin
    \node at ($(9) + (90:0.3)$) {\color{black}9};
    \node at ($(8) + (30:0.3)$) {\color{black}8};
    \node at ($(2) + (-30:0.3)$) {\color{black}2};
    \node at ($(3) + (-90:0.3)$) {\color{black}3};
    \node at ($(4) + (-150:0.3)$) {\color{black}4};
    \node at ($(10) + (150:0.3)$) {\color{black}10};



    % Define the coordinates for the midpoints of the sides of the hexagon
    \coordinate (7) at ($(9)!0.5!(8)$); % Midpoint between A and B
    \coordinate (14) at ($(8)!0.5!(2)$); % Midpoint between B and C
    \coordinate (1) at ($(2)!0.5!(3)$); % Midpoint between C and D
    \coordinate (5) at ($(3)!0.5!(4)$); % Midpoint between D and E
    \coordinate (16) at ($(4)!0.5!(10)$); % Midpoint between E and F
    \coordinate (11) at ($(10)!0.5!(9)$); % Midpoint between F and A

    % Draw and fill circles at the midpoints

    % Label the midpoints radiating from the origin
    \node at ($(7) + (60:0.3)$) {\color{black}7};
    \node at ($(14) + (0:0.3)$) {\color{black}14};
    \node at ($(1) + (-60:0.3)$) {\color{black}1};
    \node at ($(5) + (-120:0.3)$) {\color{black}5};
    \node at ($(16) + (180:0.3)$) {\color{black}16};
    \node at ($(11) + (120:0.3)$) {\color{black}11};



    \coordinate (15) at (90:1);    % Vertex 15
    \node at ($(15) + (90:0.3)$) {\color{black}15};

    \draw[orange]  (16) --  (15);
    \coordinate (17) at ($(16)!0.5!(15)$); % Midpoint between A and B
    \node at ($(17) + (170:0.3)$) {\color{black}17};

    \draw[green]  (15) -- (14);
    \coordinate (13) at ($(15)!0.5!(14)$); % Midpoint between A and B
    \node at ($(13) + (10:0.3)$) {\color{black}13};

    \draw[gray]  (7) -- (5);
    \coordinate (6) at ($(7)!0.5!(5)$); % Midpoint between A and B
    \node at ($(6) + (0:0.3)$) {\color{black}6};

    \draw[brown]  (17) -- (1);
    \coordinate (18) at ($(17)!0.7!(1)$); % Midpoint between A and B
    \node at ($(18) + (190:0.3)$) {\color{black}18};

    %\draw  (11) -- (13);
    %\coordinate (12) at (100:0.5); % Midpoint between A and B
    %\node at ($(12) + (90:0.3)$) {\color{black}12};
    % Draw the Bezier curve from A to B through C
    \draw[violet] (11) .. controls (100:0.5) .. (13);
    % Calculate the point halfway along the curve
    \path (11) .. controls (100:0.5) .. (13) coordinate[pos=0.14] (12);

    % Draw a point at the midpoint
    \node at ($(12) + (75:0.3)$) {\color{black}12};


    % Draw the hexagon
    %\draw (9) -- (8) -- (2) -- (3) -- (4) -- (10) -- cycle;
    \draw [red] (1) -- (3);
    \draw [red] (1) -- (2);

    \draw [blue] (3) -- (5);
    \draw [blue] (4) -- (5);

    %\draw [green] (13) -- (15);
    %\draw [orange] (15) -- (17);

    \draw [magenta] (7) -- (9);
    \draw [magenta] (7) -- (8);

    \draw [cyan] (9) -- (11);
    \draw [cyan] (10) -- (11);


    \draw [olive] (4) -- (10);
    \draw [teal] (8) -- (2);


    \draw [ultra thick,gray,dotted] (5) -- (11);
    \draw [ultra thick,gray,dotted] (1) -- (7);



    \fill[green ] (1) circle  (4pt);
    \fill[green] (2) circle  (4pt);
    \fill[red, decorate, decoration=zigzag] (3) circle  (4pt);
    \fill[green] (4) circle  (4pt);
    \fill[green ] (5) circle  (4pt);
    \fill[red, decorate, decoration=zigzag] (6) circle  (4pt);
    \fill[green] (7) circle  (4pt);
    \fill[green] (8) circle  (4pt);
    \fill[red, decorate, decoration=zigzag ] (9) circle  (4pt);
    \fill[green] (10) circle (4pt);
    \fill[green] (11) circle (4pt);
    \fill[red, decorate, decoration=zigzag] (12) circle (4pt);
    \fill[green] (13) circle (4pt);
    \fill[red, decorate, decoration=zigzag] (14) circle (4pt);
    \fill[green] (15) circle (4pt);
    \fill[red, decorate, decoration=zigzag] (16) circle (4pt);
    \fill[green] (17) circle (4pt);
    \fill[red, decorate, decoration=zigzag] (18) circle (4pt);


\end{tikzpicture}
}
\\
(1)&&(2)&&(3)
\end{tabular}
\end{center}
\caption{\label{2023-e-f-color-tws}
Three two-valued states---numbers 4, 8, and 10---of the M\"obius-Escher-Penrose hypergraph, as listed in Table~\ref{2024-e-t2},
cannot be extended to a 3-coloring.
}
\end{figure}




\section{Loosening tightness}


Some hypergraphs with less interwining contexts than the M\"obius--Escher--Penrose hypergraph
are shown
in Figure~\ref{2023-e-f3}:\\
(a) A variant with two fewer contexts but incorporating an additional intertwining context.\\
(b) A periodic diagram featuring nine cyclically intertwining contexts, with two contexts absent.\\
(c) A periodic diagram with six cyclically intertwining contexts, effectively forming a hexagon.

\begin{figure}
\begin{center}
\begin{tabular}{ccc}
\resizebox{.3\textwidth}{!}{\begin{tikzpicture}  [scale=1] %,label distance=1pt
\tikzstyle{every path}=[line width=2pt]

\tikzmath{\a = 1; \b = 2; \c = 0;}


\newdimen\ms
\ms=0.05cm


\tikzstyle{c3}=[circle,inner sep={\ms/8},minimum size=6*\ms]
\tikzstyle{c2}=[circle,inner sep={\ms/8},minimum size=4*\ms]
\tikzstyle{c1}=[circle,inner sep={\ms/8},minimum size=0.8*\ms]

\coordinate (1) at ({2*( \a +  \a + \b ) + 2*\c},{( \a +  \a + \b ) + 2*\c});
\coordinate (3) at ({( \a +  \a + \b )},0);
\coordinate (2) at ($(1)!0.5!(3)$);
\coordinate (5) at ({0-2*\c},{( \a +  \a + \b )+2*\c});
\coordinate (4) at ($(3)!0.5!(5)$);
\coordinate (13) at ({2*( \a +  \a + \b )-\a+\c},{( \a +  \a + \b )+\c});
\coordinate (15) at ({( \a +  \a + \b )},\a);
\coordinate (14) at ($(13)!0.5!(15)$);
\coordinate (17) at ({\a-\c},{( \a +  \a + \b )+\c});
\coordinate (16) at ($(15)!0.5!(17)$);
\coordinate (7) at ({2*( \a +  \a + \b )-2*\a},{( \a +  \a + \b )});
\coordinate (9) at ({( \a +  \a + \b )},{2*\a});
\coordinate (8) at ($(7)!0.5!(9)$);
\coordinate (11) at ({2*\a},{( \a +  \a + \b )});
\coordinate (10) at ($(9)!0.5!(11)$);

%\coordinate (6) at ($(5)!0.915!(7)$);
 \coordinate (12) at ($(11)!0.5!(13)$);
 \coordinate (18) at ($(17)!0.5!(1)$);

\draw [red] (1) -- (3);
\draw [blue] (3) -- (5);

\draw [green] (13) -- (15);
\draw [orange] (15) -- (17);

\draw [magenta] (7) -- (9);
\draw [cyan] (9) -- (11);



\draw [gray] (5) .. controls (\a,{1.6*( \a +  \a + \b )}) and ({ 2*( \a +  \a + \b ) - 2} ,{1.6*( \a +  \a + \b )}) .. (7)
                coordinate [pos=0.3] (6);
%              node[pos=0.3, c3,fill=gray, label={above left: $6$}] {};

\draw [brown] (17) .. controls ({ ( \a +  \a + \b ) - 2},{1.5*( \a +  \a + \b )}) and ({  ( \a +  \a + \b ) + 2} ,{1.5*( \a +  \a + \b )}) .. (1)
                coordinate [pos=0.223] (18);
%              node[pos=0.3, c3,fill=gray, label={above left: $6$}] {};

\draw [violet] (11) .. controls ({ ( \a +  \a + \b ) - 2},{1.3*( \a +  \a + \b )}) and ({ ( \a +  \a + \b ) + 2} ,{1.3*( \a +  \a + \b )}) .. (13)
                coordinate [pos=0.2] (12);
%              node[pos=0.3, c3,fill=gray, label={above left: $6$}] {};

\draw [teal] (6) -- (12);

\draw (1) coordinate[c3,fill=red,label={below right: $1$}];
\draw (2) coordinate[c3,fill=red,label={below right: $2$}];
\draw (3) coordinate[c3,fill=red,label={below: $3$}];
\draw (4) coordinate[c3,fill=blue,label={below: $4$}];
\draw (5) coordinate[c3,fill=blue,label={below: $5$}];
\draw (6) coordinate[c3,fill=gray,label={above left: $6$}];
\draw (7) coordinate[c3,fill=magenta,label={below: $7$}];
\draw (8) coordinate[c3,fill=magenta,label={below: $8$}];
\draw (9) coordinate[c3,fill=cyan,label={below: $9$}];
\draw (10) coordinate[c3,fill=cyan,label={below: $10$}];
\draw (11) coordinate[c3,fill=cyan,label={below: $11$}];
\draw (12) coordinate[c3,fill=violet,label={below: $12$}];
\draw (13) coordinate[c3,fill=green,label={below: $13$}];
\draw (14) coordinate[c3,fill=green,label={below: $14$}];
\draw (15) coordinate[c3,fill=orange,label={below: $15$}];
\draw (16) coordinate[c3,fill=orange,label={below: $16$}];
\draw (17) coordinate[c3,fill=orange,label={below: $17$}];
\draw (18) coordinate[c3,fill=brown,label={left: $18$}];



\draw (9) coordinate[c2,fill=magenta];
\draw (15) coordinate[c2,fill=green];
\draw (3) coordinate[c2,fill=blue];

\draw (5) coordinate[c2,fill=gray];
\draw (17) coordinate[c2,fill=brown];
\draw (11) coordinate[c2,fill=violet];

\draw (7) coordinate[c2,fill=gray];
\draw (1) coordinate[c2,fill=brown];
\draw (13) coordinate[c2,fill=violet];

\draw (12) coordinate[c2,fill=teal];
\draw (18) coordinate[c2,fill=teal];
\draw (6) coordinate[c2,fill=teal];


\end{tikzpicture}}
&
\resizebox{.3\textwidth}{!}{\begin{tikzpicture}  [scale=1] %,label distance=1pt
\tikzstyle{every path}=[line width=2pt]

\tikzmath{\a = 1; \b = 2; \c = 0;}


\newdimen\ms
\ms=0.05cm


\tikzstyle{c3}=[circle,inner sep={\ms/8},minimum size=6*\ms]
\tikzstyle{c2}=[circle,inner sep={\ms/8},minimum size=4*\ms]
\tikzstyle{c1}=[circle,inner sep={\ms/8},minimum size=0.8*\ms]

\coordinate (1) at ({2*( \a +  \a + \b ) + 2*\c},{( \a +  \a + \b ) + 2*\c});
\coordinate (3) at ({( \a +  \a + \b )},0);
\coordinate (2) at ($(1)!0.5!(3)$);
\coordinate (5) at ({0-2*\c},{( \a +  \a + \b )+2*\c});
\coordinate (4) at ($(3)!0.5!(5)$);
\coordinate (13) at ({2*( \a +  \a + \b )-\a+\c},{( \a +  \a + \b )+\c});
\coordinate (15) at ({( \a +  \a + \b )},\a);
\coordinate (14) at ($(13)!0.5!(15)$);
\coordinate (17) at ({\a-\c},{( \a +  \a + \b )+\c});
\coordinate (16) at ($(15)!0.5!(17)$);
\coordinate (7) at ({2*( \a +  \a + \b )-2*\a},{( \a +  \a + \b )});
\coordinate (9) at ({( \a +  \a + \b )},{2*\a});
\coordinate (8) at ($(7)!0.5!(9)$);
\coordinate (11) at ({2*\a},{( \a +  \a + \b )});
\coordinate (10) at ($(9)!0.5!(11)$);

%\coordinate (6) at ($(5)!0.915!(7)$);
 \coordinate (12) at ($(11)!0.5!(13)$);
 \coordinate (18) at ($(17)!0.5!(1)$);

\draw [red] (1) -- (3);
\draw [blue] (3) -- (5);

\draw [green] (13) -- (15);
\draw [orange] (15) -- (17);

\draw [magenta] (7) -- (9);
\draw [cyan] (9) -- (11);





\draw [gray] (5) .. controls (\a,{1.6*( \a +  \a + \b )}) and ({ 2*( \a +  \a + \b ) - 2} ,{1.6*( \a +  \a + \b )}) .. (7)
                coordinate [pos=0.3] (6);
%              node[pos=0.3, c3,fill=gray, label={above left: $6$}] {};

\draw [brown] (17) .. controls ({ ( \a +  \a + \b ) - 2},{1.5*( \a +  \a + \b )}) and ({  ( \a +  \a + \b ) + 2} ,{1.5*( \a +  \a + \b )}) .. (1)
                coordinate [pos=0.8] (18);
%              node[pos=0.3, c3,fill=gray, label={above left: $6$}] {};

\draw [violet] (11) .. controls ({ ( \a +  \a + \b ) - 2},{1.3*( \a +  \a + \b )}) and ({ ( \a +  \a + \b ) + 2} ,{1.3*( \a +  \a + \b )}) .. (13)
                coordinate [pos=0.2] (12);
%              node[pos=0.3, c3,fill=gray, label={above left: $6$}] {};


\draw (1) coordinate[c3,fill=red,label={below right: $1$}];
\draw (2) coordinate[c3,fill=red,label={below right: $2$}];
\draw (3) coordinate[c3,fill=red,label={below: $3$}];
\draw (4) coordinate[c3,fill=blue,label={below: $4$}];
\draw (5) coordinate[c3,fill=blue,label={below: $5$}];
\draw (6) coordinate[c3,fill=gray,label={above left: $6$}];
\draw (7) coordinate[c3,fill=magenta,label={below: $7$}];
\draw (8) coordinate[c3,fill=magenta,label={below: $8$}];
\draw (9) coordinate[c3,fill=cyan,label={below: $9$}];
\draw (10) coordinate[c3,fill=cyan,label={below: $10$}];
\draw (11) coordinate[c3,fill=cyan,label={below: $11$}];
\draw (12) coordinate[c3,fill=violet,label={below: $12$}];
\draw (13) coordinate[c3,fill=green,label={below: $13$}];
\draw (14) coordinate[c3,fill=green,label={below: $14$}];
\draw (15) coordinate[c3,fill=orange,label={below: $15$}];
\draw (16) coordinate[c3,fill=orange,label={below: $16$}];
\draw (17) coordinate[c3,fill=orange,label={below: $17$}];
\draw (18) coordinate[c3,fill=brown,label={above: $18$}];



\draw (9) coordinate[c2,fill=magenta];
\draw (15) coordinate[c2,fill=green];
\draw (3) coordinate[c2,fill=blue];

\draw (5) coordinate[c2,fill=gray];
\draw (17) coordinate[c2,fill=brown];
\draw (11) coordinate[c2,fill=violet];

\draw (7) coordinate[c2,fill=gray];
\draw (1) coordinate[c2,fill=brown];
\draw (13) coordinate[c2,fill=violet];


\end{tikzpicture}}
&
\resizebox{.3\textwidth}{!}{\begin{tikzpicture}  [scale=1] %,label distance=1pt
\tikzstyle{every path}=[line width=2pt]

\tikzmath{\a = 1; \b = 2; \c = 0;}


\newdimen\ms
\ms=0.05cm


\tikzstyle{c3}=[circle,inner sep={\ms/8},minimum size=6*\ms]
\tikzstyle{c2}=[circle,inner sep={\ms/8},minimum size=4*\ms]
\tikzstyle{c1}=[circle,inner sep={\ms/8},minimum size=0.8*\ms]

\coordinate (1) at ({2*( \a +  \a + \b ) + 2*\c},{( \a +  \a + \b ) + 2*\c});
\coordinate (3) at ({( \a +  \a + \b )},0);
\coordinate (2) at ($(1)!0.5!(3)$);
\coordinate (5) at ({0-2*\c},{( \a +  \a + \b )+2*\c});
\coordinate (4) at ($(3)!0.5!(5)$);
\coordinate (13) at ({2*( \a +  \a + \b )-\a+\c},{( \a +  \a + \b )+\c});
\coordinate (15) at ({( \a +  \a + \b )},\a);
\coordinate (14) at ($(13)!0.5!(15)$);
\coordinate (17) at ({\a-\c},{( \a +  \a + \b )+\c});
\coordinate (16) at ($(15)!0.5!(17)$);
\coordinate (7) at ({2*( \a +  \a + \b )-2*\a},{( \a +  \a + \b )});
\coordinate (9) at ({( \a +  \a + \b )},{2*\a});
\coordinate (8) at ($(7)!0.5!(9)$);
\coordinate (11) at ({2*\a},{( \a +  \a + \b )});
\coordinate (10) at ($(9)!0.5!(11)$);

%\coordinate (6) at ($(5)!0.915!(7)$);
 \coordinate (12) at ($(11)!0.5!(13)$);
 \coordinate (18) at ($(17)!0.5!(1)$);

\draw [red] (1) -- (3);
\draw [blue] (3) -- (5);

\draw [magenta] (7) -- (9);
\draw [cyan] (9) -- (11);




\draw [gray] (5) .. controls (\a,{1.6*( \a +  \a + \b )}) and ({ 2*( \a +  \a + \b ) - 2} ,{1.6*( \a +  \a + \b )}) .. (7)
                coordinate [pos=0.3] (6);
%              node[pos=0.3, c3,fill=gray, label={above left: $6$}] {};

\draw [violet] (11) .. controls ({ ( \a +  \a + \b ) - 2},{1.6*( \a +  \a + \b )}) and ({ ( \a +  \a + \b ) + 2} ,{1.6*( \a +  \a + \b )}) .. (1)
                coordinate [pos=0.7] (12);
%              node[pos=0.3, c3,fill=gray, label={above left: $6$}] {};


\draw (1) coordinate[c3,fill=red,label={below right: $1$}];
\draw (2) coordinate[c3,fill=red,label={below right: $2$}];
\draw (3) coordinate[c3,fill=red,label={below: $3$}];
\draw (4) coordinate[c3,fill=blue,label={below: $4$}];
\draw (5) coordinate[c3,fill=blue,label={below: $5$}];
\draw (6) coordinate[c3,fill=gray,label={above left: $6$}];
\draw (7) coordinate[c3,fill=magenta,label={below: $7$}];
\draw (8) coordinate[c3,fill=magenta,label={below: $8$}];
\draw (9) coordinate[c3,fill=cyan,label={below: $9$}];
\draw (10) coordinate[c3,fill=cyan,label={below: $10$}];
\draw (11) coordinate[c3,fill=cyan,label={below: $11$}];
\draw (12) coordinate[c3,fill=violet,label={above: $12$}];



\draw (9) coordinate[c2,fill=magenta];
\draw (3) coordinate[c2,fill=blue];

\draw (5) coordinate[c2,fill=gray];
\draw (11) coordinate[c2,fill=violet];

\draw (7) coordinate[c2,fill=gray];
%\draw (13) coordinate[c2,fill=violet];


\end{tikzpicture}}
\\
(a)&(b)&(c)
\end{tabular}
\end{center}
\caption{\label{2023-e-f3}
Some hypergraphs with less intertwining contexts than the M\"obius--Escher--Penrose hypergraph:
(a) A variant with two fewer contexts but incorporating an additional intertwining context.
(b) A periodic diagram featuring nine cyclically intertwining contexts, with two contexts absent.
(c) A periodic diagram with six cyclically intertwining contexts, effectively forming a hexagon.
}
\end{figure}



We have found the following coordinatization of the hypergraph from Figure~\ref{2023-e-f3}(a):

We start from the context $\{1,17,18\}$, chosen as
\begin{align*}
\vert v_1 \rangle & = \vert y \rangle = \begin{pmatrix}
0,1,0\end{pmatrix}^\intercal\,, \\
\vert v_{17} \rangle &= \begin{pmatrix}1/\sqrt{3}, 0, -\sqrt{2/3}\end{pmatrix}^\intercal\,, \\
\vert v_{18} \rangle &= \begin{pmatrix}\sqrt{2/3}, 0, 1/\sqrt{3}\end{pmatrix}^\intercal\,.
\end{align*}
Contexts $\{7,5,6\}$ and $\{13,11,12\}$
(in this order of elements) are obtained by the rotation of the context $\{1,17,18\}$ around the $z$-axis by $(2/3)\pi$ and $(4/3)\pi$, respectively.
Trough these rotations, the vectors $v_{18}$,
$v_6=\begin{pmatrix}-1/\sqrt{6},1/\sqrt{2},1/\sqrt{3}\end{pmatrix}^\intercal$,
and
$v_{12}=\begin{pmatrix}-1/\sqrt{6},-1/\sqrt{2},1/\sqrt{3}\end{pmatrix}^\intercal$
form an orthonormal basis, representing the context $\{6,12,18\}$.
The remaining vectors are now uniquely determined (up to the orientation, which is unimportant) and can be computed by cross products.
Vector $v_3$ is a~unit vector in the direction $v_1 \times v_5$ (these are not orthogonal) and
$v_2 = v_1 \times v_3$,
$v_4 = v_5 \times v_3$.
Analogously,
$v_9,v_8,v_{10}$ are constructed from $v_7,v_{11}$
and
$v_{15},v_{14},v_{16}$ from $v_{13},v_{17}$.
We checked that all the $18$ vectors are distinct and satisfy no other orthogonality relations than those denoted in Figure~\ref{2023-e-f3}(a).



\section{Summary}


In this paper, we have introduced and explored the quantum M\"obius--Escher--Penrose hypergraph,
a quantum analog inspired by paradoxical drawings and concepts such as the M\"obius strip and Penrose's `impossible object'.
We have provided a detailed construction of this hypergraph using orthogonal representations
where edges correspond to orthonormal bases in Hilbert space, ensuring a faithful embedding of the graph into a quantum mechanical framework.

The hypergraph can also be realized quasiclassically
by computing two-valued states and creating a partition logic,
establishing an embedding into a Boolean algebra.
This dual approach highlights the distinction between classical and quantum mechanical
embeddings and the emergence of contextuality.

Contextuality, a hallmark of quantum mechanics,
is evidenced by the violation of exclusivity and completeness in certain contexts,
demonstrated both through the inspection of two-valued states and proof by contradiction.
We have quantified these violations using classical probability bounds and show maximal
violations with quantum probabilities for specific states.

Further, we have explored violations of Boole's `conditions of possible experience' through correlation polytopes,
translating binary value assignments into quantum mechanical expectations.
The study reveals multiple hull inequalities,
with the longest summations showing significant quantum violations, thus illustrating the inherent contextuality of the hypergraph.

Our findings contribute to a deeper understanding of quantum contextuality,
extending beyond traditional Hardy-type paradoxes and state-independent proofs,
and underscore the intricate relationship between classical logic structures and quantum mechanical systems.





\begin{acknowledgments}
We are grateful to Josef Tkadlec for providing a {\em Pascal} program that computes and analyses the set of two-valued states of collections of contexts.
We are also grateful to  Norman D. Megill and Mladen Pavi{\v{c}}i{\'{c}} for providing a {\em C++} program that heuristically computes the faithful orthogonal representations of hypergraphs written in MMP format, given possible vector components.

MN was supported by the CTU institutional support (Future Fund).
KS was funded in whole or in part by the Austrian Science Fund (FWF) [Grant DOI:10.55776/I4579].

The authors declare no conflict of interest.
\end{acknowledgments}


\bibliography{svozil}
\ifws

\bibliographystyle{spmpsci}

\else
%\bibliographystyle{apsrev4-2}

\fi

\end{document}





%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



1={2,4,-5},
2={1,2,2},
3={2,-1,0},
4={0,0,1},
5={1,2,0},
6={2, -1, 5},
7={-2,1,1},
8={0,1,-1},
9={1,1,1},
A={1,-1,0},
B={1,1,-2},
C={-45, 15, -15},
D={6, 21, 3},
E={4,-1,-1},
F={-1,1,-5},
G={1,1,0},
H={-10,10,4},
I={11,7,10}

FORUnnormalized={
{2,4,-5},
{1,2,2},
{2,-1,0},
{0,0,1},
{1,2,0},
{2, -1, 5},
{-2,1,1},
{0,1,-1},
{1,1,1},
{1,-1,0},
{1,1,-2},
{-45, 15, -15},
{6, 21, 3},
{4,-1,-1},
{-1,1,-5},
{1,1,0},
{-10,10,4},
{11,7,10}
};
FOR = Table[ Normalize[ FORUnnormalized[[i]] ],{i,1,Length[FORUnnormalized]}]

Length[FOR]==Length[Union[FOR]]

(* should be mutually orthogonal within contexts/blocks *)

checkorthogonality[a_,b_,c_] := {a.b,a.c,b.c};

FullSimplify[checkorthogonality[FOR[[  1 ]] , FOR[[2  ]] , FOR[[ 3 ]]]]
FullSimplify[checkorthogonality[FOR[[  3 ]] , FOR[[ 4 ]] , FOR[[ 5 ]]]]
FullSimplify[checkorthogonality[FOR[[ 5  ]] , FOR[[ 6 ]] , FOR[[ 7 ]]]]
FullSimplify[checkorthogonality[FOR[[ 7  ]] , FOR[[ 8 ]] , FOR[[ 9 ]]]]
FullSimplify[checkorthogonality[FOR[[ 9  ]] , FOR[[ 10 ]] , FOR[[ 11 ]]]]
FullSimplify[checkorthogonality[FOR[[ 11  ]] , FOR[[ 12 ]] , FOR[[ 13  ]]]]
FullSimplify[checkorthogonality[FOR[[ 13  ]] , FOR[[ 14 ]] , FOR[[ 15 ]]]]
FullSimplify[checkorthogonality[FOR[[ 15  ]] , FOR[[ 16 ]] , FOR[[ 17 ]]]]
FullSimplify[checkorthogonality[FOR[[ 17  ]] , FOR[[ 18 ]] , FOR[[ 1 ]]]]
FullSimplify[checkorthogonality[FOR[[ 4  ]] , FOR[[ 16 ]] , FOR[[ 10 ]]]]
FullSimplify[checkorthogonality[FOR[[ 2  ]] , FOR[[ 14 ]] , FOR[[ 8 ]]]]











%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


(*


Mirko Navara degenerate left side
18 atoms
11 blocks
 0 proper subsets of blocks
 3   1  2  3
 3   3  4  5
 3   5  6  7
 3   7  8  9
 3   9 10 11
 3  11 12 13
 3  13 14 15
 3  15 16 17
 3  17 18  1
 3   4 10 16
 3   2 14  8
12 2-valued evaluations of atoms:
1 0 0 1 0 1 0 1 0 0 1 0 0 0 1 0 0 0
1 0 0 0 1 0 0 1 0 1 0 1 0 0 1 0 0 0
1 0 0 0 1 0 0 0 1 0 0 1 0 1 0 1 0 0
0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 1
0 1 0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0
0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 1
0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 1
0 0 1 0 0 1 0 1 0 1 0 1 0 0 1 0 0 1
0 0 1 0 0 1 0 1 0 1 0 0 1 0 0 0 1 0
0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 1
0 0 1 0 0 0 1 0 0 1 0 1 0 1 0 0 1 0
0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 1 0 1

set of 2-valued evaluations of atoms:
nonempty: yes
unital: yes
separating atoms: yes
separating: yes
1s on nonorthogonal atoms (=OD if no noncomplete block): no for atoms
 1/7 1/13 2/10 4/14 5/11 5/17 7/13 8/16 11/17
order determining: no for sets of atoms (ordered elements?)
 2/9+11
 7/2+3
 13/2+3
 1/5+6
 1/11+12
 10/1+3
 5/9+10
 5/15+16
 4/13+15
 14/3+5
 11/3+4
 17/3+4
 7/11+12
 13/5+6
 8/15+17
 16/7+9
 11/15+16
 17/9+10


*)

states = {
{1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
{1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0},
{1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0},
{0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1},
{0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0},
{0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1},
{0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1},
{0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1},
{0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0},
{0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1},
{0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0},
{0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1}};

If[Length[states]==12,Print["true"],Print["false"]];



stateindex= Table[{},{i,1,18}];

Do[ Do[ If[ states[[j,i]]==1, AppendTo[ stateindex[[i]],j]   ] ,{j,1,12}] ,{i,1,18}];

(*
Print[MatrixForm[stateindex]]


Union[ stateindex[[5]],stateindex[[11]],stateindex[[17]] ] == Union[ stateindex[[1]],stateindex[[13]],stateindex[[7]] ]

stateindex[[5]]
stateindex[[11]]
stateindex[[17]]
stateindex[[1]]
stateindex[[13]]
stateindex[[7]]
*)


stateindex[[2]]
stateindex[[3]]
stateindex[[4]]
stateindex[[10]]
stateindex[[9]]
stateindex[[8]]

stateindex[[2]]
stateindex[[3]]
stateindex[[4]]
stateindex[[16]]
stateindex[[15]]
stateindex[[14]]



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


(*
alpha = -Pi/3;
*)

alpha = ToRadicals[
   FullSimplify[
    ToRadicals[2 ArcTan[ Root[-27 + 99 #^2 + 87 #^4 + 25 #^6& , 2, 0]]]]];

v4={Sqrt[2/3], 0, Sqrt[1/3]};
v16= {-Sqrt[1/6], Sqrt[1/2], Sqrt[1/3]};
v10= {-Sqrt[1/6], -Sqrt[1/2], Sqrt[1/3]};

v2=RotationMatrix[ alpha , {0, 0, 1}] . v4;
v14=RotationMatrix[ alpha , {0, 0, 1}] . v16;
v8=RotationMatrix[ alpha , {0, 0, 1}] . v10;

v3  = Normalize[Cross[v4,v2]];
v15 = Normalize[Cross[v16,v14]];
v9 = Normalize[Cross[v10,v8]];

v5  = FullSimplify[ Normalize[Cross[v3,v4]    ] ]   ;
v17 = FullSimplify[ Normalize[Cross[v15,v16]  ] ]   ;
v11 = FullSimplify[ Normalize[Cross[v9,v10]  ] ]   ;
v1 = FullSimplify[ Normalize[Cross[v3,v2]   ] ]    ;
v13 = FullSimplify[ Normalize[Cross[v15,v14]  ] ]    ;
v7 = FullSimplify[ Normalize[Cross[v9,v8]  ] ]    ;

v6 = FullSimplify[ Normalize[Cross[v7,v5 ]  ] ]    ;
v12 = FullSimplify[ Normalize[Cross[v13,v11]  ] ]    ;
v18 = FullSimplify[ Normalize[Cross[v1,v17]  ] ]    ;



checkorthogonality[a_,b_,c_] := {a.b,a.c,b.c};

FullSimplify[checkorthogonality[ v4  ,  v16   ,  v10 ]]
FullSimplify[checkorthogonality[ v2  ,  v14  ,  v8 ]]
FullSimplify[checkorthogonality[ v3   ,  v4  ,  v5 ]]
FullSimplify[checkorthogonality[ v3   ,  v2  ,  v1 ]]
FullSimplify[checkorthogonality[ v15  ,  v16  ,  v17 ]]
FullSimplify[checkorthogonality[ v15   ,  v14  ,  v13  ]]
FullSimplify[checkorthogonality[ v9   ,  v10  ,  v11 ]]
FullSimplify[checkorthogonality[ v9   ,  v7 ,  v8 ]]
FullSimplify[checkorthogonality[ v7   ,  v5  ,  v6 ]]
FullSimplify[checkorthogonality[ v13   ,  v11  ,  v12 ]]
FullSimplify[checkorthogonality[ v1   ,  v17  ,  v18 ]]

N[ToRadicals[
  FullSimplify[ToRadicals[checkorthogonality[v6, v12, v18]]]]]

(*

ToRadicals[FullSimplify[ToRadicals[v4  ]]]
ToRadicals[FullSimplify[ToRadicals[v16 ]]]
ToRadicals[FullSimplify[ToRadicals[v10 ]]]

ToRadicals[FullSimplify[ToRadicals[v2 ]]]
ToRadicals[FullSimplify[ToRadicals[v14 ]]]
ToRadicals[FullSimplify[ToRadicals[v8 ]]]

ToRadicals[FullSimplify[ToRadicals[v3  ]]]
ToRadicals[FullSimplify[ToRadicals[v15 ]]]
ToRadicals[FullSimplify[ToRadicals[v9 ]]]

ToRadicals[FullSimplify[ToRadicals[v5  ]]]
ToRadicals[FullSimplify[ToRadicals[v17 ]]]
ToRadicals[FullSimplify[ToRadicals[v11 ]]]
ToRadicals[FullSimplify[ToRadicals[v1 ]]]
ToRadicals[FullSimplify[ToRadicals[v13 ]]]
ToRadicals[FullSimplify[ToRadicals[v7 ]]]

ToRadicals[FullSimplify[ToRadicals[v16 ]]]
ToRadicals[FullSimplify[ToRadicals[v17 ]]]
ToRadicals[FullSimplify[ToRadicals[v18 ]]]

*)


 (*Definition of `my' Tensor Product*)(*a,b are nxn and mxm-matrices*)

MyTensorProduct[a_, b_] :=
  Table[a[[Ceiling[s/Length[b]], Ceiling[t/Length[b]]]]*
    b[[s - Floor[(s - 1)/Length[b]]*Length[b],
      t - Floor[(t - 1)/Length[b]]*Length[b]]], {s, 1,
    Length[a]*Length[b]}, {t, 1, Length[a]*Length[b]}];

(*Definition of the Dyadic Product*)

DyadicProductVec[x_] :=
  Table[x[[i]]  Conjugate[x[[j]]], {i, 1, Length[x]}, {j, 1,
    Length[x]}];

(*Commutator*)

Commutator[a_, b_] := a . b - b . a;


triade = ToRadicals[FullSimplify[ToRadicals[DyadicProductVec[v5]+DyadicProductVec[v17]+DyadicProductVec[v11] ]]]

Eigensystem[triade]

TeXForm[Eigensystem[triade]]

N[Eigensystem[triade]]

triadeconnecting =
 ToRadicals[
  FullSimplify[
   ToRadicals[
    DyadicProductVec[v5] + DyadicProductVec[v17] +
     DyadicProductVec[v11]]]]














Navara Escher bug  extended
18 atoms
11 blocks
 0 proper subsets of blocks
 3   1  2  3
 3   3  4  5
 3   5  6  7
 3   7  8  9
 3   9 10 11
 3  11 12 13
 3  13 14 15
 3  15 16 17
 3  17 18  1
 3   4 16 10
 3   2  8 14
12 2-valued evaluations of atoms:
1 0 0 1 0 1 0 1 0 0 1 0 0 0 1 0 0 0
1 0 0 0 1 0 0 1 0 1 0 1 0 0 1 0 0 0
1 0 0 0 1 0 0 0 1 0 0 1 0 1 0 1 0 0
0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 1
0 1 0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0
0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 1
0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 1
0 0 1 0 0 1 0 1 0 1 0 1 0 0 1 0 0 1
0 0 1 0 0 1 0 1 0 1 0 0 1 0 0 0 1 0
0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 1
0 0 1 0 0 0 1 0 0 1 0 1 0 1 0 0 1 0
0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 1 0 1

set of 2-valued evaluations of atoms:
nonempty: yes
unital: yes
separating atoms: yes
separating: yes
1s on nonorthogonal atoms (=OD if no noncomplete block): no for atoms
 1/7 1/13 2/10 4/14 5/11 5/17 7/13 8/16 11/17
order determining: no for sets of atoms (ordered elements?)
 2/9+11
 7/2+3
 13/2+3
 1/5+6
 1/11+12
 10/1+3
 5/9+10
 5/15+16
 4/13+15
 14/3+5
 11/3+4
 17/3+4
 7/11+12
 13/5+6
 8/15+17
 16/7+9
 11/15+16
 17/9+10

##############################################################################################

a={
{1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 } ,
{1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0 } ,
{1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0 } ,
{0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1 } ,
{0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0 } ,
{0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1 } ,
{0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1 } ,
{0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1 } ,
{0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0 } ,
{0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1 } ,
{0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0 } ,
{0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1 }
};


b = Table[ If[ a[[i, j]] == 0, 1, -1], {i, 1 , Length[a]}, {j, 1, Length[ a[[1]] ] }]

c = MatrixForm[Union[Table[{1,
b[[i,1]] * b[[i,3]] ,
b[[i,3]] * b[[i,5]] ,
b[[i,5]] * b[[i,7]] ,
b[[i,7]] * b[[i,9]] ,
b[[i,9]] * b[[i,11]] ,
b[[i,11]] * b[[i,13]] ,
b[[i,13]] * b[[i,15]] ,
b[[i,15]] * b[[i,17]] ,
b[[i,17]] * b[[i,1]]
}
, {i, 1,  Length[a]} ] ] ]

Print[`Checking  equalities']

(*

A3A5+A9A11+A15A17=-1
A1A3+A7A9+A13A15=-1
2 A15A17 +A5A7 -A11A13 -A17A1=-1*)

d = MatrixForm[
  Union[Table[{
b[[i, 3]]*b[[i, 5]] + b[[i, 9]]*b[[i, 11]] + b[[i, 15]]*b[[i, 17]]
}, {i, 1, Length[a]}]]]


e = MatrixForm[
  Union[Table[{
b[[i,1]] * b[[i,3]] +
b[[i,7]] * b[[i,9]] +
b[[i,13]] * b[[i,15]]
}, {i, 1, Length[a]}]]]



###############################################################

import cdd
mat = cdd.Matrix(
[
 [1, -1, -1, -1, -1, -1, -1, 1, 1, 1],
 [1, -1, -1, -1, -1, -1, 1, 1, 1, -1],
 [1, -1, -1, -1, -1, 1, 1, 1, -1, -1],
 [1, -1, -1, -1, 1, 1, 1, -1, -1, -1],
 [1, -1, -1, 1, -1, -1, 1, 1, 1, 1],
 [1, -1, -1, 1, 1, 1, -1, -1, -1, -1],
 [1, -1, -1, 1, 1, 1, 1, -1, -1, 1],
 [1, -1, 1, 1, 1, -1, -1, -1, -1, -1],
 [1, 1, -1, -1, -1, -1, -1, -1, 1, 1],
 [1, 1, 1, -1, -1, -1, -1, -1, -1, 1],
 [1, 1, 1, 1, -1, -1, -1, -1, -1, -1],
 [1, 1, 1, 1, -1, -1, 1, -1, -1, 1]
]
)
poly = cdd.Polyhedron(mat)
ine = poly.get_inequalities()
print(ine)

H-representation
linearity 2  29 30
begin
 30 10 rational
 1 0 0 1 0 0 1 0 0 1
 3 0 2 -1 0 2 1 0 0 1
 3 0 2 -1 2 0 1 0 0 1
 3 2 0 -1 2 0 1 0 0 1
 1 0 1 0 -1 1 0 0 0 0
 1 0 1 0 0 0 0 0 0 0
 1 1 0 0 0 0 0 0 0 0
 1 2 -2 1 0 -2 1 0 0 -1
 1 0 0 1 0 -2 1 0 0 -1
 1 0 0 1 -2 0 1 0 0 -1
 1 0 -2 1 0 0 -1 0 0 1
 1 -2 0 1 0 0 -1 0 0 1
 1 -2 0 1 -2 2 -1 0 0 1
 1 0 0 1 -2 2 -1 0 0 -1
 1 0 0 1 0 0 -1 0 0 -1
 1 2 -2 1 0 0 -1 0 0 -1
 1 0 0 -1 0 0 -1 0 0 1
 1 -2 2 -1 0 0 -1 0 0 1
 1 -2 2 -1 -2 2 -1 0 0 1
 1 1 -1 0 1 0 0 0 0 0
 1 0 0 0 1 0 0 0 0 0
 1 0 0 0 0 1 0 0 0 0
 0 0 -1 0 0 -1 0 0 0 0
 0 -1 0 0 0 -1 0 0 0 0
 0 -1 0 0 -1 0 0 0 0 0
 1 2 -2 -1 2 -2 1 0 0 -1
 1 0 0 -1 2 -2 1 0 0 -1
 1 0 0 -1 0 0 1 0 0 -1
 1 1 0 0 1 0 0 1 0 0
 1 0 1 0 0 1 0 0 1 0
end

 1 0 -2 1 0 -2 -1 0 0 -1
############################################################


alpha = ToRadicals[
   FullSimplify[
    ToRadicals[2 ArcTan[ Root[-27 + 99 #^2 + 87 #^4 + 25 #^6& , 2, 0]]]]];

v4={Sqrt[2/3], 0, Sqrt[1/3]};
v16= {-Sqrt[1/6], Sqrt[1/2], Sqrt[1/3]};
v10= {-Sqrt[1/6], -Sqrt[1/2], Sqrt[1/3]};

v2=RotationMatrix[ alpha , {0, 0, 1}] . v4;
v14=RotationMatrix[ alpha , {0, 0, 1}] . v16;
v8=RotationMatrix[ alpha , {0, 0, 1}] . v10;

v3  = Normalize[Cross[v4,v2]];
v15 = Normalize[Cross[v16,v14]];
v9 = Normalize[Cross[v10,v8]];

v5  = FullSimplify[ Normalize[Cross[v3,v4]    ] ]   ;
v17 = FullSimplify[ Normalize[Cross[v15,v16]  ] ]   ;
v11 = FullSimplify[ Normalize[Cross[v9,v10]  ] ]   ;
v1 = FullSimplify[ Normalize[Cross[v3,v2]   ] ]    ;
v13 = FullSimplify[ Normalize[Cross[v15,v14]  ] ]    ;
v7 = FullSimplify[ Normalize[Cross[v9,v8]  ] ]    ;

v6 = FullSimplify[ Normalize[Cross[v7,v5 ]  ] ]    ;
v12 = FullSimplify[ Normalize[Cross[v13,v11]  ] ]    ;
v18 = FullSimplify[ Normalize[Cross[v1,v17]  ] ]    ;


 (*Definition of `my' Tensor Product*)(*a,b are nxn and mxm-matrices*)

MyTensorProduct[a_, b_] :=
  Table[a[[Ceiling[s/Length[b]], Ceiling[t/Length[b]]]]*
    b[[s - Floor[(s - 1)/Length[b]]*Length[b],
      t - Floor[(t - 1)/Length[b]]*Length[b]]], {s, 1,
    Length[a]*Length[b]}, {t, 1, Length[a]*Length[b]}];

(*Definition of the Dyadic Product*)

DyadicProductVec[x_] :=
  Table[x[[i]]  Conjugate[x[[j]]], {i, 1, Length[x]}, {j, 1,
    Length[x]}];


(*

3 0 2 -1 0 2 1 0 0 1

-3 \le
  2 b[[i,3]] * b[[i,5]]
-   b[[i,5]] * b[[i,7]]
+ 2 b[[i,9]] * b[[i,11]]
+   b[[i,11]] * b[[i,13]]
+   b[[i,17]] * b[[i,1]]

*)

E1 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v1]]     ;
E3 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v3]]     ;
E5 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v5]]     ;
E7 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v7]]     ;
E9 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v9]]     ;
E11 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v11]]     ;
E13 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v13]]     ;
E17 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v17]]     ;

Eigensystem[N[2  E3 . E5 - E5 . E7 + 2  E9 . E11 + E11 . E13 + E17 . E1]]

(*

{{-3.89807, -1.12144,
  0.0195107}, {{0.491309, -0.837518, -0.239123}, {0.790785, 0.313856,
   0.525503}, {-0.365068, -0.447279, 0.816497}}}

s = ToRadicals[
   FullSimplify[
    ToRadicals[
 2 E3 . E5
-   E5 . E7
+ 2 E9 . E11
+   E11 . E13
+   E17 . E1
]]]
*)



#############################################################

DyadicProductVec[x_] :=
  Table[x[[i]]   x[[j]], {i, 1, Length[x]}, {j, 1,
    Length[x]}];


Element[x, Reals];
Element[y, Reals];
Element[z, Reals];

FullSimplify[Eigensystem[IdentityMatrix[3] - 2   DyadicProductVec[{x,y,z}]]]




##############################################################################################################
##############################################################################################################
##############################################################################################################
##############################################################################################################
##############################################################################################################

spoon ligic
9 atoms
4 blocks
 0 proper subsets of blocks
 3   1  2  3
 3   1  4  5
 3   2  6  7
 3   3  8  9
12 2-valued evaluations of atoms:
1 0 0 0 0 1 0 1 0
1 0 0 0 0 1 0 0 1
1 0 0 0 0 0 1 1 0
1 0 0 0 0 0 1 0 1
0 1 0 1 0 0 0 1 0
0 1 0 1 0 0 0 0 1
0 1 0 0 1 0 0 1 0
0 1 0 0 1 0 0 0 1
0 0 1 1 0 1 0 0 0
0 0 1 1 0 0 1 0 0
0 0 1 0 1 1 0 0 0
0 0 1 0 1 0 1 0 0

#################################

a={
{1, 0, 0, 0, 0, 1, 0, 1, 0 } ,
{1, 0, 0, 0, 0, 1, 0, 0, 1 } ,
{1, 0, 0, 0, 0, 0, 1, 1, 0 } ,
{1, 0, 0, 0, 0, 0, 1, 0, 1 } ,
{0, 1, 0, 1, 0, 0, 0, 1, 0 } ,
{0, 1, 0, 1, 0, 0, 0, 0, 1 } ,
{0, 1, 0, 0, 1, 0, 0, 1, 0 } ,
{0, 1, 0, 0, 1, 0, 0, 0, 1 } ,
{0, 0, 1, 1, 0, 1, 0, 0, 0 } ,
{0, 0, 1, 1, 0, 0, 1, 0, 0 } ,
{0, 0, 1, 0, 1, 1, 0, 0, 0 } ,
{0, 0, 1, 0, 1, 0, 1, 0, 0 }
};


b = Table[ If[ a[[i, j]] == 0, 1, -1], {i, 1 , Length[a]}, {j, 1, Length[ a[[1]] ] }]

c = MatrixForm[Union[Table[{1,
b[[i,4]] *  b[[i,5]] ,
b[[i,6]] * b[[i,7]] ,
b[[i,8]] * b[[i,9]]
}
, {i, 1,  Length[a]} ] ] ]

##########################################################################


import cdd
mat = cdd.Matrix(
[
 [1, -1, -1, 1],
 [1, -1, 1, -1],
 [1, 1, -1, -1]
]
)
poly = cdd.Polyhedron(mat)
ine = poly.get_inequalities()
print(ine)
H-representation
linearity 1  4
begin
 4 4 rational
 0 -1 -1 0
 1 1 0 0
 1 0 1 0
 1 1 1 1
end

#########################################################################

g1={1,0,0} ;
g2={0,1,0} ;
g3={0,0,1} ;
g4={0,1,1} ;
g5={0,-1,1};
g6={1,0,1} ;
g7={-1,0,1};
g8={1,1,0} ;
g9={-1,1,0};

(*Definition of `my' Tensor Product*)(*a,b are nxn and mxm-matrices*)

MyTensorProduct[a_, b_] :=
  Table[a[[Ceiling[s/Length[b]], Ceiling[t/Length[b]]]]*
    b[[s - Floor[(s - 1)/Length[b]]*Length[b],
      t - Floor[(t - 1)/Length[b]]*Length[b]]], {s, 1,
    Length[a]*Length[b]}, {t, 1, Length[a]*Length[b]}];

(*Definition of the Dyadic Product*)

DyadicProductVec[x_] :=
  Table[x[[i]]  Conjugate[x[[j]]], {i, 1, Length[x]}, {j, 1,
    Length[x]}];



A4= FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[g4]]     ;
A5 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[g5]]     ;
A6 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[g6]]     ;
A7 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[g7]]     ;
A8 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[g8]]     ;
A9 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[g9]]     ;


A4.A5+A6.A7+A8.A9

Eigensystem[A4.A5+A6.A7+A8.A9]

alpha = ToRadicals[
   FullSimplify[
    ToRadicals[2 ArcTan[ Root[-27 + 99 #^2 + 87 #^4 + 25 #^6& , 2, 0]]]]];

v4={Sqrt[2/3], 0, Sqrt[1/3]};
v16= {-Sqrt[1/6], Sqrt[1/2], Sqrt[1/3]};
v10= {-Sqrt[1/6], -Sqrt[1/2], Sqrt[1/3]};

v2=RotationMatrix[ alpha , {0, 0, 1}] . v4;
v14=RotationMatrix[ alpha , {0, 0, 1}] . v16;
v8=RotationMatrix[ alpha , {0, 0, 1}] . v10;

v3  = Normalize[Cross[v4,v2]];
v15 = Normalize[Cross[v16,v14]];
v9 = Normalize[Cross[v10,v8]];

v5  = FullSimplify[ Normalize[Cross[v3,v4]    ] ]   ;
v17 = FullSimplify[ Normalize[Cross[v15,v16]  ] ]   ;
v11 = FullSimplify[ Normalize[Cross[v9,v10]  ] ]   ;
v1 = FullSimplify[ Normalize[Cross[v3,v2]   ] ]    ;
v13 = FullSimplify[ Normalize[Cross[v15,v14]  ] ]    ;
v7 = FullSimplify[ Normalize[Cross[v9,v8]  ] ]    ;

v6 = FullSimplify[ Normalize[Cross[v7,v5 ]  ] ]    ;
v12 = FullSimplify[ Normalize[Cross[v13,v11]  ] ]    ;
v18 = FullSimplify[ Normalize[Cross[v1,v17]  ] ]    ;

A4= FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v3]]     ;
A5 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v5]]     ;
A6 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v9]]     ;
A7 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v11]]     ;
A8 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v15]]     ;
A9 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v17]]     ;


FullSimplify[A4.A5+A6.A7+A8.A9]

Eigensystem[FullSimplify[A4.A5+A6.A7+A8.A9 ]  ]


##############################################################################################################
##############################################################################################################
##############################################################################################################
##############################################################################################################
##############################################################################################################


aa={
{1, 0, 0, 1, 0, 0, 1, 0, 0, 1},
{3, 0, 2, -1, 0, 2, 1, 0, 0, 1},
{3, 0, 2, -1, 2, 0, 1, 0, 0, 1},
{3, 2, 0, -1, 2, 0, 1, 0, 0, 1},
{1, 0, 1, 0, -1, 1, 0, 0, 0, 0},
{1, 0, 1, 0, 0, 0, 0, 0, 0, 0},
{1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 2, -2, 1, 0, -2, 1, 0, 0, -1},
{1, 0, 0, 1, 0, -2, 1, 0, 0, -1},
{1, 0, 0, 1, -2, 0, 1, 0, 0, -1},
{1, 0, -2, 1, 0, 0, -1, 0, 0, 1},
{1, -2, 0, 1, 0, 0, -1, 0, 0, 1},
{1, -2, 0, 1, -2, 2, -1, 0, 0, 1},
{1, 0, 0, 1, -2, 2, -1, 0, 0, -1},
{1, 0, 0, 1, 0, 0, -1, 0, 0, -1},
{1, 2, -2, 1, 0, 0, -1, 0, 0, -1},
{1, 0, 0, -1, 0, 0, -1, 0, 0, 1},
{1, -2, 2, -1, 0, 0, -1, 0, 0, 1},
{1, -2, 2, -1, -2, 2, -1, 0, 0, 1},
{1, 1, -1, 0, 1, 0, 0, 0, 0, 0},
{1, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{1, 0, 0, 0, 0, 1, 0, 0, 0, 0},
{0, 0, -1, 0, 0, -1, 0, 0, 0, 0},
{0, -1, 0, 0, 0, -1, 0, 0, 0, 0},
{0, -1, 0, 0, -1, 0, 0, 0, 0, 0},
{1, 2, -2, -1, 2, -2, 1, 0, 0, -1},
{1, 0, 0, -1, 2, -2, 1, 0, 0, -1},
{1, 0, 0, -1, 0, 0, 1, 0, 0, -1}
}

aux =
{
"A_1   A_3"   ,
"A_3   A_5" ,
"A_5   A_7"    ,
"A_7   A_9"     ,
"A_9   A_{11}"      ,
"A_{11}  A_{13}"      ,
"A_{13}   A_{15}" ,
"A_{15}   A_{17}" ,
"A_{17}   A_{1}"
};

bb = MatrixForm[
  Table[If[aa[[i, j]] != 0, StringJoin["+", ToString[aa[[i, j]]] , aux[[j - 1]],""], " "], {i, Length[aa]}, {j, 2, Length[aa[[1]]]}]]

################################################################################################
################################################################################################
################################################################################################
################################################################################################
################################################################################################
################################################################################################
################################################################################################



alpha = ToRadicals[
   FullSimplify[
    ToRadicals[2 ArcTan[ Root[-27 + 99 #^2 + 87 #^4 + 25 #^6& , 2, 0]]]]];

v4={Sqrt[2/3], 0, Sqrt[1/3]};
v16= {-Sqrt[1/6], Sqrt[1/2], Sqrt[1/3]};
v10= {-Sqrt[1/6], -Sqrt[1/2], Sqrt[1/3]};

v2=RotationMatrix[ alpha , {0, 0, 1}] . v4;
v14=RotationMatrix[ alpha , {0, 0, 1}] . v16;
v8=RotationMatrix[ alpha , {0, 0, 1}] . v10;

v3  = Normalize[Cross[v4,v2]];
v15 = Normalize[Cross[v16,v14]];
v9 = Normalize[Cross[v10,v8]];

v5  = FullSimplify[ Normalize[Cross[v3,v4]    ] ]   ;
v17 = FullSimplify[ Normalize[Cross[v15,v16]  ] ]   ;
v11 = FullSimplify[ Normalize[Cross[v9,v10]  ] ]   ;
v1 = FullSimplify[ Normalize[Cross[v3,v2]   ] ]    ;
v13 = FullSimplify[ Normalize[Cross[v15,v14]  ] ]    ;
v7 = FullSimplify[ Normalize[Cross[v9,v8]  ] ]    ;

v6 = FullSimplify[ Normalize[Cross[v7,v5 ]  ] ]    ;
v12 = FullSimplify[ Normalize[Cross[v13,v11]  ] ]    ;
v18 = FullSimplify[ Normalize[Cross[v1,v17]  ] ]    ;


 (*Definition of `my' Tensor Product*)(*a,b are nxn and mxm-matrices*)

MyTensorProduct[a_, b_] :=
  Table[a[[Ceiling[s/Length[b]], Ceiling[t/Length[b]]]]*
    b[[s - Floor[(s - 1)/Length[b]]*Length[b],
      t - Floor[(t - 1)/Length[b]]*Length[b]]], {s, 1,
    Length[a]*Length[b]}, {t, 1, Length[a]*Length[b]}];

(*Definition of the Dyadic Product*)

DyadicProductVec[x_] :=
  Table[x[[i]]  Conjugate[x[[j]]], {i, 1, Length[x]}, {j, 1,
    Length[x]}];


(*

3 0 2 -1 0 2 1 0 0 1

-3 \le
  2 b[[i,3]] * b[[i,5]]
-   b[[i,5]] * b[[i,7]]
+ 2 b[[i,9]] * b[[i,11]]
+   b[[i,11]] * b[[i,13]]
+   b[[i,17]] * b[[i,1]]

*)

E1 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v1]]     ;
E3 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v3]]     ;
E5 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v5]]     ;
E7 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v7]]     ;
E9 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v9]]     ;
E11 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v11]]     ;
E13 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v13]]     ;
E17 = FullSimplify[IdentityMatrix[3] - 2   DyadicProductVec[v17]]     ;


(*

{{-3.89807, -1.12144,
  0.0195107}, {{0.491309, -0.837518, -0.239123}, {0.790785, 0.313856,
   0.525503}, {-0.365068, -0.447279, 0.816497}}}

s = ToRadicals[
   FullSimplify[
    ToRadicals[
 2 E3 . E5
-   E5 . E7
+ 2 E9 . E11
+   E11 . E13
+   E17 . E1
]]]
*)

(*
1:-1&\le  2A_1A_3 - 2A_3A_5 - A_5A_7 + 2A_7A_9 - 2A_9A_11 + A_11A_13 - A_17A_1 ,  \\
2:-1&\le - 2A_1A_3 + 2A_3A_5 - A_5A_7 - 2A_7A_9 + 2A_9A_11 - A_11A_13 + A_17A_1,  \\

3:-1&\le 2  E1E3 - 2  E3E5 +  E5E7 - 2  E9E11 +  E11E13 -  E17E1 ,\\
4:-1&\le  - 2  E1E3 +  E5E7 - 2  E7E9 + 2  E9E11 -  E11E13 +  E17E1 ,\\
5:-3&\le 2  E3E5 -  E5E7 + 2  E9E11 +  E11E13 +  E17E1 ,\\
6:-3&\le 2  E3E5 -  E5E7 + 2  E7E9 +  E11E13 +  E17E1  ,\\
7:-3&\le 2  E1E3 -  E5E7 + 2  E7E9 +  E11E13 +  E17E1  ,\\
8:-1&\le 2  E1E3 - 2  E3E5 +  E5E7 -  E11E13 -  E17E1 ,\\

9:-1&\le  - 2  E1.E3 + 2  E3.E5 -  E5.E7 -  E11.E13 +  E17.E1  ,\\
10:-1&\le  E5.E7 - 2  E7.E9 + 2  E9.E11 -  E11.E13 -  E17.E1 ,\\
11:-1&\le  -  E5.E7 + 2  E7.E9 - 2  E9.E11 +  E11.E13 -  E17.E1 ,\\
12-15:-1&\le \{ - 2  E3.E5 +  E5.E7 -  E11.E13 +  E17.E1  , - 2  E1.E3 +  E5.E7 \\
 & \qquad -  E11.E13 +  E17.E1 ,  E5.E7 - 2  E9.E11 +  E11.E13 -  E17.E1 , \\
 & \qquad  E5.E7 - 2  E7.E9 +  E11.E13 -  E17.E1  \},\\
16-19:-1&\le \{  E5.E7 +  E11.E13 +  E17.E1 ,  E5.E7 -  E11.E13 -  E17.E1  ,\\
  & \qquad  -  E5.E7 -  E11.E13 +  E17.E1  ,  -  E5.E7 +  E11.E13 -  E17.E1  \}, \\
20,21:-1&\le \{ E3.E5 -  E7.E9 +  E9.E11  ,  E1.E3 -  E3.E5 +  E7.E9  \} ,\\
22-24:-0&\le  \{ -  E3.E5 -  E9.E11 , -  E1.E3 -  E9.E11 ,  -  E1.E3 -  E7.E9  \} ,\\
25-28:-1&\le \{  E3.E5 ,   E1.E3 ,   E7.E9  ,    E9.E11 \} ,
*)


i=1;

Print[i++]
Eigensystem[N[  2.E1.E3 - 2E3.E5 - E5.E7 + 2.E7.E9 - 2E9.E11 + E11.E13 + E17.E1]]

Print[i++]
Eigensystem[ N[+2. E1 . E3 - 2 E3 . E5 + E5 . E7 + 2. E7 . E9 - 2 E9 . E11 +  E11 . E13 - E17 . E1]]


Print[i++]
Eigensystem[N[2  E1.E3 - 2  E3.E5 +  E5.E7 - 2  E9.E11 +  E11.E13 -  E17.E1] ]

Print[i++]
Eigensystem[N[ - 2  E1.E3 +  E5.E7 - 2  E7.E9 + 2  E9.E11 -  E11.E13 +  E17.E1] ]

Print[i++]
Eigensystem[N[2  E3.E5 -  E5.E7 + 2  E9.E11 +  E11.E13 +  E17.E1] ]

Print[i++]
Eigensystem[N[2  E3.E5 -  E5.E7 + 2  E7.E9 +  E11.E13 +  E17.E1]  ]

Print[i++]
Eigensystem[N[2  E1.E3 -  E5.E7 + 2  E.7E9 +  E11.E13 +  E17.E1]  ]

Print[i++]
Eigensystem[N[2  E1.E3 - 2  E3.E5 +  E5.E7 -  E11.E13 -  E17.E1]  ]




Print[i++]
Eigensystem[N[- 2  E1.E3 + 2  E3.E5 -  E5.E7 -  E11.E13 +  E17.E1]  ]

Print[i++]
Eigensystem[N[E5.E7 - 2  E7.E9 + 2  E9.E11 -  E11.E13 -  E17.E1]  ]

Print[i++]
Eigensystem[N[ -  E5.E7 + 2  E7.E9 - 2  E9.E11 +  E11.E13 -  E17.E1]  ]

Print[i++]
Eigensystem[N[ - 2  E3.E5 +  E5.E7 -  E11.E13 +  E17.E1]  ]

Print[i++]
Eigensystem[N[- 2  E1.E3 +  E5.E7  -  E11.E13 +  E17.E1   ]  ]

Print[i++]
Eigensystem[N[ E5.E7 - 2  E9.E11 +  E11.E13 -  E17.E1]  ]

Print[i++]
Eigensystem[N[   E5.E7 - 2  E7.E9 +  E11.E13 -  E17.E11]  ]

Print[i++]
Eigensystem[N[ -  E5.E7 -  E11.E13 +  E17.E1]  ]

Print[i++]
Eigensystem[N[E5.E7 -  E11.E13 -  E17.E1]  ]

Print[i++]
Eigensystem[N[-  E5.E7 -  E11.E13 +  E17.E1]  ]

Print[i++]
Eigensystem[N[ -  E5.E7 +  E11.E13 -  E17.E1]  ]

Print[i++]
Eigensystem[N[E3.E5 -  E7.E9 +  E9.E11]  ]

Print[i++]
Eigensystem[N[E1.E3 -  E3.E5 +  E7.E9]  ]

Print[i++]
Eigensystem[N[ -  E3.E5 -  E9.E11  ]  ]

Print[i++]
Eigensystem[N[-  E1.E3 -  E9.E11]  ]

Print[i++]
Eigensystem[N[ -  E1.E3 -  E7.E9]  ]

###################################################################

v18 = {Sqrt[2/3], 0, Sqrt[1/3]}

v6 = RotationMatrix[(2/3) Pi, {0, 0, 1}] . v18

v12 = RotationMatrix[(4/3) Pi, {0, 0, 1}] . v18

v18 . v6

v18 . v12

v12 . v6



v17 = {Sqrt[1/3], 0, - Sqrt[2/3]}

v5 = RotationMatrix[(2/3) Pi, {0, 0, 1}] . v17

v11 = RotationMatrix[(4/3) Pi, {0, 0, 1}] . v17

v17.v5

v1 = { 0, 1,0}

v7 = RotationMatrix[(2/3) Pi, {0, 0, 1}] . v1

v13 = RotationMatrix[(4/3) Pi, {0, 0, 1}] . v1

v1.v7

v3 = Cross[v5,v1]

v15=Cross[v17,v13]

v9 = Cross[v11,v7]


v4 = Cross[v3,v5]
v2 = Cross[v3,v1]
v16 = Cross[v15,v17]
v14 = Cross[v15,v13]
v10 = Cross[v9,v11]
v8 = Cross[v9,v7]

Length[Union[FullSimplify[{v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18}]]]


(*******************************************)
(*******************************************)
(*******************************************)
(*******************************************)
(* Escher hypergraph *)

contexts =
{ (*{   1 , 2,  3  }  , *)
 {   3 , 4,  5  }  ,
 {   5 , 6,  7  }  ,
 {   7 , 8,  9  }  ,
 {   9 ,10, 11  }  ,
 {  11 ,12, 13  }  ,
 {  13 ,14, 15  }  ,
 {  15 ,16, 17  }  ,
 {  17 ,18,  1  }  ,
 {   4 ,16, 10  }  ,
 {   2 , 8, 14  }}

Print ["number of elements"];

numberofelements = Length[ Union[Flatten[ contexts ]]]

Print ["number of dimensions"];

dimension = Length[contexts[[1]]]

Print ["number of contexts"];

numberofcontexts = Length[ contexts ]



colors = {1, 2, 3}; (* The list of colors *)


colorconfigurations = {};    (* Start with an empty list to store the results *)

contexttwm = {};    (* Start with an empty list to store the results *)

(* Use n loops to create triplets *)
numLoops = 15; (* Specify the number of nested loops *)

ranges = Table[{Symbol["i" <> ToString[k]], 1, Length[colors]}, {k, 4, 4 + numLoops - 1}];

Do[
  cconfigaux={1 , 2 , 3 ,
             colors[[i4]], colors[[i5]], colors[[i6]], colors[[i7]], colors[[i8]], colors[[i9]], colors[[i10]], colors[[i11]],
             colors[[i12]], colors[[i13]], colors[[i14]], colors[[i15]], colors[[i16]], colors[[i17]], colors[[i18]]};
contextc = Table[ cconfigaux[[contexts[[j, k]]]], {j, 1, numberofcontexts}, {k, 1, 3}];
(*If[i4 == 2,   Print[contextc]], *)
 If[Union[{Sort[contextc[[1]]],
           Sort[contextc[[2]]],
           Sort[contextc[[3]]],
           Sort[contextc[[4]]],
           Sort[contextc[[5]]],
           Sort[contextc[[6]]],
           Sort[contextc[[7]]],
           Sort[contextc[[8]]],
           Sort[contextc[[9]]],
           Sort[contextc[[10]]]
           }] == {{1, 2, 3}},
  Print[contextc];
  AppendTo[colorconfigurations, cconfigaux] ;
  AppendTo[contexttwm, contextc /. {2 -> 0, 3 -> 0}]] ,
   Evaluate[Sequence @@ ranges]
]

colorconfigurations(* Display the result *)

Union[contexttwm](* Display the result *)

(*

{{3,1,2},{2,1,3},{3,1,2},{2,3,1},{1,3,2},{2,3,1},{1,2,3},{3,2,1},{1,2,3},{2,1,3}}
{{3,2,1},{1,2,3},{3,1,2},{2,1,3},{3,1,2},{2,3,1},{1,3,2},{2,3,1},{2,3,1},{2,1,3}}
{{3,2,1},{1,3,2},{2,3,1},{1,3,2},{2,1,3},{3,1,2},{2,1,3},{3,2,1},{2,1,3},{2,3,1}}

{
{1, 2, 3, 1, 2, 1, 3, 1, 2, 3, 1, 3, 2, 3, 1, 2, 3, 2},
{1, 2, 3, 2, 1, 2, 3, 1, 2, 1, 3, 1, 2, 3, 1, 3, 2, 3},
{1, 2, 3, 2, 1, 3, 2, 3, 1, 3, 2, 1, 3, 1, 2, 1, 3, 2}
}


2  1  3                1    3  2
1  3  2                1    3  2
1  2  3                1    2  3


{
{{0, 0, 1}, {1, 0, 0}, {0, 0, 1}, {1, 0, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 0, 1}, {0, 1, 0}, {0, 0, 1}},
{{0, 0, 1}, {1, 0, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 0, 1}, {1, 0, 0}, {0, 0, 1}, {0, 0, 1}, {0, 1, 0}},
{{0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 0, 1}, {1, 0, 0}, {0, 0, 1}, {1, 0, 0}, {0, 0, 1}, {1, 0, 0}, {0, 1, 0}}
}

*)
eschercolorings = {{1, 2, 3, 1, 2, 1, 3, 1, 2, 3, 1, 3, 2, 3, 1, 2, 3,
     2}, {1, 2, 3, 2, 1, 2, 3, 1, 2, 1, 3, 1, 2, 3, 1, 3, 2, 3}, {1,
    2, 3, 2, 1, 3, 2, 3, 1, 3, 2, 1, 3, 1, 2, 1, 3, 2}};
tws1 = Union[eschercolorings  /. {1 -> 0, 2 -> 1, 3 -> 0}]

tws2 = Union[eschercolorings  /. {1 -> 0, 2 -> 0, 3 -> 1}]

(*
* 0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 1

0 1 0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0
0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 1
0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 1
~~~~~~~~

0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 1
0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 1
0 1 0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0

*******************************************

* 0 0 1 0 0 1 0 1 0 1 0 1 0 0 1 0 0 1

0 0 1 0 0 1 0 1 0 1 0 0 1 0 0 0 1 0

* 0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 1

0 0 1 0 0 0 1 0 0 1 0 1 0 1 0 0 1 0
0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 1 0 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 1 0 1
0 0 1 0 0 0 1 0 0 1 0 1 0 1 0 0 1 0
0 0 1 0 0 1 0 1 0 1 0 0 1 0 0 0 1 0

*)

(*******************************************************************)
(*******************************************************************)
(*******************************************************************)
(*******************************************************************)
(*******************************************************************)
(*******************************************************************)
(*******************************************************************)
(*******************************************************************)

z = {0, 0, 1}
ToRadicals[FullSimplify[ToRadicals[z . v1]]]
ToRadicals[FullSimplify[ToRadicals[z . v7]]]
ToRadicals[FullSimplify[ToRadicals[z . v13]]]

TeXForm[3*ToRadicals[FullSimplify[ToRadicals[(z . v13)^2]]]]





