Computations from the paper:
The spectra of digraphs with Morita equivalent C*-algebras
arXiv:2010.10769 [math.CO] v1

Carla Farsi, Emily Proctor, Christopher Seaton

This notebook contains the following; all Section references are to the paper in the title:
	Functions that implement the graph moves described in Section 4.
	Functions that compute the matrices and spectra in Section 2.3.
For the spectra and some related functions, there are two versions, one that gives the spectrum only, and one that shows the steps for checking the computations.

Many of the graphs here are based on examples in:
	Søren Eilers, Gunnar Restorff, Efren Ruiz, and Adam P. W. Sørensen, The complete classification of unital graph C*-algebras: Geometric and strong, arXiv:1611.07120v2 [math.OA], 2019.
	Adam P. W. Sørensen, Geometric classification of simple graph algebras, Ergodic Theory Dynam. Systems 33 (2013), no. 4, 1199--1220. MR 3082546
See the above paper for specific citations.

List of Functions

Functions defining the moves:
isSink[graph, vertex]
	checks if a vertex is a sink
isSource[graph, vertex]
	checks if a vertex is a source
sInv[graph, vertex]
	computes (s^(-1))(vertex)
rInv[graph, vertex]
	computes (r^(-1))(vertex)
moveS[graph]
	applies move S to graph. prompts you for the vertex to remove.
moveSnoInput[graph]
	applies move S to graph, but does not prompt; always removes vertex 1 or outputs that it isn’t a source (for automation)
moveSinv[graph]
	applies the inverse of move S to graph. prompts you for the name of the new vertex and which edges to have.
moveR[graph]
	applies move R to graph. prompts you for the vertex at which to reduce.
moveRnoInput[graph]
	applies move R to graph, but does not prompt; always reduces at vertex 1 or outputs that it can’t be done
moveO[graph, newV]
	applies move O to graph. prompts you for the vertex at which to out-split and the partition.
	newV is the name for the new vertices (which are indexed by subscripts).
moveI[graph, newV]
	applies move I to graph. prompts you for the vertex at which to in-split and the partition.
	newV is the name for the new vertices (which are indexed by subscripts).
moveC[graph, newV]
	applies move C to graph. prompts you for the vertex at which to splice.
	does not test that it supports two simple loops (but reminds you to check).
	newV is the name for the two new vertices (which are indexed by subscripts).


Functions defining the matrices and spectra:
incidenceMatrix[graph]
	computes the incidence matrix of graph
laplaceSpec[graph]
	computes the Laplace spectrum of graph (laplaceSpecS is the same but outputs the steps of the computation)

adjacencyMatrixBinary[graph]
	computes the binary adjacency matrix of graph
adjacencySpecBinary[graph]
	computes the binary adjacency spectrum of graph (__S is the same but outputs the steps of the computation)
adjacencySpecSymmetricBinary[graph]
	computes the symmetric binary adjacency matrix of graph (__S is the same but outputs the steps of the computation)
adjacencyMatrix[graph]
	computes the adjacency matrix of graph
adjacencySpec[graph]
	computes the adjacency spectrum of graph (__S is the same but outputs the steps of the computation)
adjacencySpecSymmetric[graph]
	computes the symmetric adjacency spectrum of graph (__S is the same but outputs the steps of the computation)

lineAdjacencyMatrix[graph]
	computes the line adjacency matrix of graph
lineGraph[graph]
	computes the line graph of graph
lineAdjacencySpec[graph]
	computes the line adjacency spectrum of graph (__S is the same but outputs the steps of the computation)

hermitianAdjacencyMatrix[graph]
	computes the Hermitian adjacency matrix of graph
hermitianAdjacencySpectrum[graph]
	computes the Hermitian spectrum of graph (__S is the same but outputs the steps of the computation)

skewAdjacencyMatrixBinary[graph]
	computes the binary skew adjacency matrix of graph
skewAdjacencySpecBinary[graph]
	computes the binary skew adjacency spectrum of graph (__S is the same but outputs the steps of the computation)
skewAdjacencyMatrix[graph]
	computes the skew adjacency matrix of graph
skewAdjacencySpec[graph]
	computes the skew adjacency spectrum of graph (__S is the same but outputs the steps of the computation)

skewLaplacianMatrix[graph]
	computes the skew Laplacian matrix of graph
skewLaplaceSpec[graph]
	computes the skew Laplacian spectrum of graph (__S is the same but outputs the steps of the computation)
skewLaplacianMatrixBinary[graph]
	computes the binary skew Laplacian matrix of graph
skewLaplaceSpecBinary[graph]
	computes the binary skew Laplacian spectrum of graph (__S is the same but outputs the steps of the computation)

transitionProbabilityMatrixBinary[graph]
	computes the binary transition probability matrix of graph
normalizedLaplacianBinary[graph]
	computes the binary normalized Laplacian of graph (__S is the same but outputs the steps of the computation)
combinatorialLaplacianBinary[graph]
	computes the binary combinatorial Laplacian of graph (__S is the same but outputs the steps of the computation)
normalizedLaplaceSpecBinary[graph]
	computes the binary normalized Laplacian spectrum of graph (__S is the same but outputs the steps of the computation)
combinatorialLaplaceSpecBinary[graph]
	computes the binary combinatorial Laplacian spectrum of graph (__S is the same but outputs the steps of the computation)

transitionProbabilityMatrix[graph]
	computes the transition probability matrix of graph
normalizedLaplacian[graph]
	computes the normalized Laplacian of graph (__S is the same but outputs the steps of the computation)
combinatorialLaplacian[graph]
	computes the combinatorial Laplacian of graph (__S is the same but outputs the steps of the computation)
normalizedLaplaceSpec[graph]
	computes the normalized Laplacian spectrum of graph (__S is the same but outputs the steps of the computation)
combinatorialLaplaceSpec[graph]
	computes the combinatorial Laplacian spectrum of graph (__S is the same but outputs the steps of the computation)

Function Definitions

Functions defining the moves (definitions are in Section 4 of arXiv:2010.10769 [math.CO] v1)

(* tests whether a vertex is a sink in the given graph; outputs True or False *)
isSink[g0_,v0_]:=Module[{graph=g0,v=v0},
If[MemberQ[VertexList[graph],v]==False,
Print["The given vertex is not a vertex in the graph."],
If[EdgeList[graph,v\[DirectedEdge]_]=={},True,False]]];

(* tests whether a vertex is a source; outputs True or False *)
isSource[g0_,v0_]:=Module[{graph=g0,v=v0},
If[MemberQ[VertexList[graph],v]==False,
Print["The given vertex is not a vertex in the graph."],
If[EdgeList[graph,_\[DirectedEdge]v]=={},True,False]]];

(* computes s^(-1) of the given vertex. *)
sInv[g0_,v0_]:=Module[{graph=g0,v=v0},
If[MemberQ[VertexList[graph],v]==False,
Print["The given vertex is not a vertex in the graph."],
EdgeList[graph,v\[DirectedEdge]_]]];

(* computes r^(-1) of the given vertex. *)
rInv[g0_,v0_]:=Module[{graph=g0,v=v0},
If[MemberQ[VertexList[graph],v]==False,
Print["The given vertex is not a vertex in the graph."],
EdgeList[graph,_\[DirectedEdge]v]]];


(* performs Move S (remove a source at a regular vertex).
Takes a graph (graph).
Prompts for the vertex to remove (vRem).
Tests that move O can be done (the given vertex must be a regular source).
Creates a new graph (gOut) by performing Move S.
*)
moveS[g0_]:=Module[{graph=g0,vRem,gOut},
vRem=Input[{"The vertices are ",VertexList[graph],". Which vertex would you like to remove? (it must be a regular source)"}];
If[MemberQ[VertexList[graph],vRem]==False,
Print["The given vertex is not a vertex in the graph."];
gOut=graph,
Print["The vertex selected is ",vRem,"."];
If[isSink[graph,vRem]==True,
Print["The vertex is a sink and hence not regular. Move S cannot be performed here."];
gOut=graph,
If[isSource[graph,vRem]==False,
Print["The vertex is regular but not a source. Move S cannot be performed here."];
gOut=graph,
gOut=Graph[Complement[VertexList[graph],{vRem}],DeleteCases[EdgeList[graph],Alternatives@@sInv[graph,vRem]],VertexLabels->"Name"];
]]];
gOut];


(* same as moveS, but doesn't request input and just applies to vertex 1 *)
moveSnoInput[g0_]:=Module[{graph=g0,vRem,gOut},
vRem=1;
If[MemberQ[VertexList[graph],vRem]==False,
Print["The given vertex is not a vertex in the graph."];
gOut=graph,
Print["The vertex selected is ",vRem,"."];
If[isSink[graph,vRem]==True,
Print["The vertex is a sink and hence not regular. Move S cannot be performed here."];
gOut=graph,
If[isSource[graph,vRem]==False,
Print["The vertex is regular but not a source. Move S cannot be performed here."];
gOut=graph,
gOut=Graph[Complement[VertexList[graph],{vRem}],DeleteCases[EdgeList[graph],Alternatives@@sInv[graph,vRem]],VertexLabels->"Name"];
]]];
gOut];


(* performs the inverse of Move S (adds a regular source).
Takes a graph (graph).
Prompts for the name of the new vertex (a source) and then the old vertices to which it should emit.
Tests that the new vertex is not already a vertex and will be a source based on user input.
Creates a new graph (gOut) by performing the inverse of Move S.
*)
moveSinv[g0_]:=Module[{graph=g0,vAdd,edges,gOut},
vAdd=Input[{"The vertices are ",VertexList[graph],". What shall we call the new vertex?"}];
If[MemberQ[VertexList[graph],vAdd],
Print["The new vertex cannot already be a vertex of the graph."];
gOut=graph,
edges=Input[{"The new vertex ",vAdd," must be a regular source. The other vertices are ",VertexList[graph],
". List the vertices to which ",vAdd," will emit in brackets {} separated by commas, i.e. {vertex1, vertex2,...}."}];
If[MemberQ[edges,vAdd],
Print["The new vertex must be a source so cannot emit to itself."];
gOut=graph,
If[edges=={},Print["The new vertex must be a regular source so should emit to something. I'll add it, but the result won't be connected"]];
gOut=Graph[Join[VertexList[graph],{vAdd}], Join[EdgeList[graph],Table[vAdd\[DirectedEdge] x,{x,edges}] ],VertexLabels->"Name"];
]];
gOut
];


(* performs move R (reduction at a regular vertex).
Takes a graph (graph).
Prompts for the vertex to be reduced.
Tests that it satisfies the hypotheses: a regular vertex u with (s^(-1))(u) a 1-point set and s((r^(-1))(u)) a 1-point set).Creates a new graph (gOut) by performing Move R. *)
moveR[g0_]:=Module[{graph=g0,vRem,gOut,sri,edges,v,k,e},
vRem=Input[{"The vertices are ",VertexList[graph],". Which vertex would you like to remove? (it must be a regular vertex u with (s^(-1))(u) a 1-point set and s((r^(-1))(u)) a 1-point set)"}];
If[MemberQ[VertexList[graph],vRem]==False,
Print["The given vertex is not a vertex in the graph."];
gOut=graph,
If[Length[sInv[graph,vRem]]≠1,
Print["(s^(-1))(u) is not a 1-point set"];
gOut=graph,
(* list all edges pointing into vRem *)
edges=rInv[graph,vRem];
(* find all vertices with edges that point into vRem, source of range^(-1) of vRem *)
sri=Union[Table[edges[[k]][[1]],{k,1,Length[edges]}]];
If[Length[sri]≠1,
Print["s((r^(-1))(u)) is not a 1-point set"];
gOut=graph,
(* define v, the only vertex that emits to vRem *)
v=sri[[1]];
gOut=Graph[Complement[VertexList[graph],{vRem}],
Join[ DeleteCases[EdgeList[graph],Alternatives@@Join[rInv[graph,vRem],sInv[graph,vRem]] ],
Table[v\[DirectedEdge]sInv[graph,vRem][[1]][[2]],{x,rInv[graph,vRem]}]],VertexLabels->"Name"];
]]];
gOut
];


(* same as moveR, but doesn't request input and just applies to vertex 1 *)
moveRnoInput[g0_]:=Module[{graph=g0,vRem,gOut,sri,edges,v,k,e},
vRem=1;
If[MemberQ[VertexList[graph],vRem]==False,
Print["The given vertex is not a vertex in the graph."];
gOut=graph,
If[Length[sInv[graph,vRem]]≠1,
Print["(s^(-1))(u) is not a 1-point set"];
gOut=graph,
(* list all edges pointing into vRem *)
edges=rInv[graph,vRem];
(* find all vertices with edges that point into vRem, source of range^(-1) of vRem *)
sri=Union[Table[edges[[k]][[1]],{k,1,Length[edges]}]];
If[Length[sri]≠1,
Print["s((r^(-1))(u)) is not a 1-point set"];
gOut=graph,
(* define v, the only vertex that emits to vRem *)
v=sri[[1]];
gOut=Graph[Complement[VertexList[graph],{vRem}],
Join[ DeleteCases[EdgeList[graph],Alternatives@@Join[rInv[graph,vRem],sInv[graph,vRem]] ],
Table[v\[DirectedEdge]sInv[graph,vRem][[1]][[2]],{x,rInv[graph,vRem]}]],VertexLabels->"Name"];
]]];
gOut
];


(* performs move O (out-split the graph).
Takes a graph (graph) and a name for the new vertices (newV).
Prompts for the vertex at which to out-split.
Tests that it satisfies the hypotheses, i.e., it is not a sink.
Prompts the user for the partition.
Creates a new graph (gOut) by performing Move O. *)
moveO[g0_,newV_]:=Module[{graph=g0,vSplit,gOut,siv,n,newVerts,i,edges,j,pnum,newEdges,part},
vSplit=Input[{"The vertices are ",VertexList[graph],". Which vertex would you like to out-split? (it cannot be a sink)"}];
If[MemberQ[VertexList[graph],vSplit]==False,
Print["The given vertex is not a vertex in the graph."];
gOut=graph,
If[isSink[graph,vSplit]==True,Print["This vertex is a sink, and cannot be out-split."];
gOut=graph,
siv=sInv[graph,vSplit];
n=Input[{"(s^(-1))(v) is ",siv,"Enter n, the number of sets in the partition. The maximum value is",Length[siv]}];
edges=Table[{EdgeList[graph][[i]],0},{i,1,Length[EdgeList[graph]]}];
j=1;
While[j≤Length[edges],
If[MemberQ[siv,edges[[j,1]]  ],
pnum=Input[{"(s^(-1))(v) is ",siv," We will now define the partition. I will display each edge individually. Please enter the number of the partition to which it belongs. Enter the partition number for the edge ",edges[[j,1]]," a number from 1 to ",n}];
If[MemberQ[Table[i,{i,1,n}],pnum],
edges[[j,2]]=pnum,
Print["The partition number is not valid so the output will not make sense; please start over"]]];
j++];
newVerts=Table[(Subscript[newV, i]),{i,1,n}];
newEdges={};
j=1;
While[j≤Length[edges],
part=edges[[j,2]];
If[edges[[j,1]][[2]]===vSplit,
If[edges[[j,1]][[1]]===vSplit,
newEdges=Join[newEdges,Table[(Subscript[newV, part])\[DirectedEdge](Subscript[newV, i]),{i,1,n}]],
newEdges=Join[newEdges,Table[edges[[j,1]][[1]]\[DirectedEdge](Subscript[newV, i]),{i,1,n}]];
],
If[edges[[j,1]][[1]]===vSplit,
AppendTo[newEdges,(Subscript[newV, part])\[DirectedEdge]edges[[j,1]][[2]]  ],
AppendTo[newEdges,edges[[j,1]]  ];
];
];
j++];
gOut=Graph[Join[Complement[VertexList[graph],{vSplit}],newVerts],
newEdges,VertexLabels->"Name"];
]];
gOut
];

(* performs move I (in-split the graph).
Takes a graph (graph) and a name for the new vertices (newV).
Prompts for the vertex at which to in-split.
Tests that it satisfies the hypotheses, i.e., it is not a source.
Prompts the user for the partition.
Creates a new graph (gOut) by performing Move I. *)
moveI[g0_,newV_]:=Module[{graph=g0,vSplit,gOut,riv,n,newVerts,i,edges,j,pnum,newEdges,part},
vSplit=Input[{"The vertices are ",VertexList[graph],". Which vertex would you like to in-split? (it cannot be a source)"}];
If[MemberQ[VertexList[graph],vSplit]==False,
Print["The given vertex is not a vertex in the graph."];
gOut=graph,
If[isSource[graph,vSplit]==True,Print["This vertex is a source, and cannot be in-split."];
gOut=graph,
riv=rInv[graph,vSplit];
n=Input[{"(r^(-1))(v) is ",riv,"Enter n, the number of sets in the partition. The maximum value is",Length[riv]}];
edges=Table[{EdgeList[graph][[i]],0},{i,1,Length[EdgeList[graph]]}];
j=1;
While[j≤Length[edges],
If[MemberQ[riv,edges[[j,1]]  ],
pnum=Input[{"(r^(-1))(v) is ",riv," We will now define the partition. I will display each edge individually. Please enter the number of the partition to which it belongs. Enter the partition number for the edge ",edges[[j,1]]," a number from 1 to ",n}];
If[MemberQ[Table[i,{i,1,n}],pnum],
edges[[j,2]]=pnum,
Print["The partition number is not valid so the output will not make sense; please start over"]]];
j++];
newVerts=Table[(Subscript[newV, i]),{i,1,n}];
newEdges={};
j=1;
While[j≤Length[edges],
part=edges[[j,2]];
If[edges[[j,1]][[2]]===vSplit,
If[edges[[j,1]][[1]]===vSplit,
newEdges=Join[newEdges,Table[(Subscript[newV, i])\[DirectedEdge](Subscript[newV, part]),{i,1,n}]],
AppendTo[newEdges,edges[[j,1]][[1]]\[DirectedEdge](Subscript[newV, part])  ];
],
If[edges[[j,1]][[1]]===vSplit,
newEdges=Join[newEdges,Table[(Subscript[newV, i])\[DirectedEdge]edges[[j,1]][[2]],{i,1,n}]],
AppendTo[newEdges,edges[[j,1]]  ];
];
];
j++];
gOut=Graph[Join[Complement[VertexList[graph],{vSplit}],newVerts],
newEdges,VertexLabels->"Name"];
]];
gOut
];

(* performs move C (Cunz split).
Takes a graph (graph) and a name for the two new vertices (newV).
Prompts for the vertex at which to perform the splice.
Does not test that the vertex supports two simple loops.
Creates a new graph (gOut) by performing Move C. *)
moveC[g0_,newV_]:=Module[{graph=g0,vSplice,gOut},
vSplice=Input[{"The vertices are ",VertexList[graph],". At which vertex would you like to Cuntz splice? Note that this vertex must support two simple loops, and you need to check this yourself, as this will perform the move regardless."}];
If[MemberQ[VertexList[graph],vSplice]==False,
Print["The given vertex is not a vertex in the graph."];
gOut=graph,
gOut=Graph[ Join[Complement[VertexList[graph],{vSplice}],{(Subscript[newV, 1]),(Subscript[newV, 2])}  ],Join[EdgeList[graph], {vSplice\[DirectedEdge](Subscript[newV, 1]),(Subscript[newV, 1])\[DirectedEdge]vSplice,(Subscript[newV, 1])\[DirectedEdge](Subscript[newV, 1]),(Subscript[newV, 1])\[DirectedEdge](Subscript[newV, 2]),(Subscript[newV, 2])\[DirectedEdge](Subscript[newV, 1]),(Subscript[newV, 2])\[DirectedEdge](Subscript[newV, 2])}],
VertexLabels->"Name"];
];
gOut
];

Functions defining the matrices and spectra (definitions are in Section 2.3 of arXiv:2010.10769 [math.CO] v1)

NOTE : For spectra and some related functions, there are two versions; the first outputs the spectrum only, the second (marked S for steps) shows the steps of the computation.

(* function incidenceMatrix takes one graph as input and outputs the incidence matrix as a SparseArray. Note that the built-in function IncidenceMatrix is similar but uses a different convention, and in particular allows values other than +1 and -1 for loops. *)
incidenceMatrix[g0_]:=Module[{graph=g0,verts,edges,i,j,m,n,inc},
verts=VertexList[graph];
m=Length[verts];
edges=EdgeList[graph];
n=Length[edges];
inc=Table[0,{i,1,m},{j,1,n}];
i=1;
While[i≤m,
j=1;
While[j≤n,
If[edges[[j]][[1]]==edges[[j]][[2]],,
If[edges[[j]][[1]]==verts[[i]],inc[[i,j]]=1];
If[edges[[j]][[2]]==verts[[i]],inc[[i,j]]=-1],
If[edges[[j]][[1]]==verts[[i]],inc[[i,j]]=1];
If[edges[[j]][[2]]==verts[[i]],inc[[i,j]]=-1]];
j++];
i++];
inc
];

(* function laplaceSpec takes a graph as input and outputs the Laplace spectrum *)
laplaceSpec[g0_]:= Module[{graph=g0,inc},
inc=incidenceMatrix[graph];
Eigenvalues[inc.Transpose[inc] ] ];
laplaceSpecS[g0_]:= Module[{graph=g0,inc},
inc=incidenceMatrix[graph];
Print[graph];
Print["Incidence matrix:"];
Print[MatrixForm[inc]];
Print["Laplacian:"];
Print[MatrixForm[inc.Transpose[inc]]];
Print["Laplace spectrum:"];
Eigenvalues[inc.Transpose[inc] ] ];

(* function adjacencyMatrixBinary takes a graph as input and outputs the binary adjacency matrix, i.e. the entry is 1 if there is an edge and 0 otherwise *)
adjacencyMatrixBinary[g0_]:= Module[{graph=g0,inc,verts,n,i,j},
verts=VertexList[graph];
n=Length[verts];
inc=Table[0,{i,1,n},{j,1,n}];
i=1;
While[i≤n,
j=1;
While[j≤n,
If[MemberQ[ EdgeList[graph] ,verts[[i]]\[DirectedEdge]verts[[j]]  ],
inc[[i,j]]=1];
j++];
i++];
inc] ;


(* function adjacencySpecBinary takes a graph as input and outputs the binary adjacency spectrum *)
adjacencySpecBinary[g0_]:= Module[{graph=g0,inc},
inc=adjacencyMatrixBinary[graph];
Eigenvalues[inc ] ];
adjacencySpecBinaryS[g0_]:= Module[{graph=g0,inc},
inc=adjacencyMatrixBinary[graph];
Print[graph];
Print["Binary adjacency matrix:"];
Print[MatrixForm[inc]];
Print["Binary adjacency spectrum:"];
Eigenvalues[inc ] ];

(* function adjacencySpecSymmetricBinary takes a graph as input and outputs the symmetric binary adjacency spectrum *)
adjacencySpecSymmetricBinary[g0_]:= Module[{graph=g0,inc},
inc=adjacencyMatrixBinary[graph];
Eigenvalues[inc.Transpose[inc] ] ];
adjacencySpecSymmetricBinaryS[g0_]:= Module[{graph=g0,inc},
inc=adjacencyMatrixBinary[graph];
Print[graph];
Print["Binary adjacency matrix:"];
Print[MatrixForm[inc]];
Print["Binary adjacency matrix times its transpose:"];
Print[MatrixForm[inc.Transpose[inc]]];
Print["Symmetric binary adjacency spectrum:"];
Eigenvalues[inc.Transpose[inc] ] ];


(* function adjacencyMatrix takes a graph as input and outputs the adjacency matrix, i.e. the entry is k if there are k edges and 0 otherwise. *)
adjacencyMatrix[g0_]:= Module[{graph=g0,inc,verts,n,i,j},
verts=VertexList[graph];
n=Length[verts];
inc=Table[0,{i,1,n},{j,1,n}];
i=1;
While[i≤n,
j=1;
While[j≤n,
inc[[i,j]]=Count[EdgeList[graph],verts[[i]]\[DirectedEdge]verts[[j]]];
j++];
i++];
inc] ;


(* function adjacencySpec takes a graph as input and outputs the adjacency spectrum *)
adjacencySpec[g0_]:= Module[{graph=g0,inc},
inc=adjacencyMatrix[graph];
Eigenvalues[inc ] ];
adjacencySpecS[g0_]:= Module[{graph=g0,inc},
inc=adjacencyMatrix[graph];
Print[graph];
Print["Adjacency matrix:"];
Print[MatrixForm[inc]];
Print["Adjacency spectrum:"];
Eigenvalues[inc ] ];


(* function adjacencySpecSymmetric takes a graph as input and outputs the symmetric adjacency spectrum *)
adjacencySpecSymmetric[g0_]:= Module[{graph=g0,inc},
inc=adjacencyMatrix[graph];
Eigenvalues[inc.Transpose[inc] ] ];
adjacencySpecSymmetricS[g0_]:= Module[{graph=g0,inc},
inc=adjacencyMatrix[graph];
Print[graph];
Print["Adjacency matrix:"];
Print[MatrixForm[inc]];
Print["Adjacency matrix times its transpose:"];
Print[MatrixForm[inc.Transpose[inc]]];
Print["Symmetric adjacency spectrum:"];
Eigenvalues[inc.Transpose[inc] ] ];


(* function lineAdjacencyMatrix takes a graph as input and outputs the line adjacency matrix. *)
lineAdjacencyMatrix[g0_]:= Module[{graph=g0,edges,n,inc,i,j},
edges=EdgeList[graph];
n=Length[edges];
inc=Table[0,{i,1,n},{j,1,n}];
i=1;
While[i≤n,
j=1;
While[j≤n,
If[edges[[i]][[2]]==edges[[j]][[1]],
inc[[i,j]]=1];
j++];
i++];
inc];


(* function lineGraph takes a graph as input and outputs the line graph (vertices are edges of the original graph, and there is an edge if the original edges are composable) *)
lineGraph[g0_]:=Module[{graph=g0,inc,verts,edges,newEdges,n,i,j,gOut},
edges=EdgeList[graph];
n=Length[edges];
verts=Table[(Subscript[e, i,edges[[i]][[1]],edges[[i]][[2]]]),{i,1,n}];
newEdges={};
i=1;
While[i≤n,
j=1;
While[j≤n,
If[edges[[i]][[2]]==edges[[j]][[1]],
AppendTo[newEdges,(Subscript[e, i,edges[[i]][[1]],edges[[i]][[2]]])\[DirectedEdge](Subscript[e, j,edges[[j]][[1]],edges[[j]][[2]]])]];
j++];
i++];
(* newEdges=DeleteDuplicates[newEdges]; *)
gOut=Graph[verts,newEdges,VertexLabels->"Name",ImageSize->600];
gOut
];


(* function lineAdjacencySpec takes a graph as input and outputs the line-adjacency spectrum *)
lineAdjacencySpec[g0_]:= Module[{graph=g0,inc},
inc=lineAdjacencyMatrix[graph];
Eigenvalues[inc ] ];
lineAdjacencySpecS[g0_]:= Module[{graph=g0,inc},
inc=lineAdjacencyMatrix[graph];
Print[graph];
Print["Line graph:"];
Print[lineGraph[graph]];
Print["Line adjacency matrix:"];
Print[MatrixForm[inc]];
Print["Line adjacency spectrum:"];
Eigenvalues[inc ] ];


(* function hermitianAdjacencyMatrix takes a graph as input and outputs the Hermitian adjacency matrix *)
hermitianAdjacencyMatrix[g0_]:= Module[{graph=g0,inc,verts,n,i,j},
verts=VertexList[graph];
n=Length[verts];
inc=Table[0,{i,1,n},{j,1,n}];
i=1;
While[i≤n,
j=1;
While[j≤n,
If[MemberQ[ EdgeList[graph] ,verts[[i]]\[DirectedEdge]verts[[j]]  ],
If[MemberQ[ EdgeList[graph] ,verts[[j]]\[DirectedEdge]verts[[i]]  ],
inc[[i,j]]=1,
inc[[i,j]]=I],
If[MemberQ[ EdgeList[graph] ,verts[[j]]\[DirectedEdge]verts[[i]]  ],
inc[[i,j]]=-I,
inc[[i,j]]=0]];
j++];
i++];
inc] ;

(* function hermitianSpectrum takes a graph as input and outputs the Hermitian adjacency spectrum *)
hermitianAdjacencySpectrum[g0_]:= Module[{graph=g0,inc},
inc=hermitianAdjacencyMatrix[graph];
Eigenvalues[inc ] ];
hermitianAdjacencySpectrumS[g0_]:= Module[{graph=g0,inc},
inc=hermitianAdjacencyMatrix[graph];
Print[graph];
Print["Hermitian adjacency matrix:"];
Print[MatrixForm[inc]];
Print["Hermitian adjacency spectrum:"];
Eigenvalues[inc ] ];

(* function skewAdjacencyMatrixBinary takes a graph as input and outputs the binary skew adjacency matrix *)
skewAdjacencyMatrixBinary[g0_]:=adjacencyMatrixBinary[g0]-Transpose[adjacencyMatrixBinary[g0]];


(* function skewAdjacencySpecBinary takes a graph as input and outputs the binary skew adjacency spectrum *)
skewAdjacencySpecBinary[g0_]:= Module[{graph=g0,inc},
inc=skewAdjacencyMatrixBinary[graph];
Eigenvalues[inc] ];
skewAdjacencySpecBinaryS[g0_]:= Module[{graph=g0,inc},
inc=skewAdjacencyMatrixBinary[graph];
Print[graph];
Print["Binary adjacency matrix:"];
Print[MatrixForm[adjacencyMatrixBinary[graph]]];
Print["Binary skew adjacency matrix:"];
Print[MatrixForm[inc]];
Print["Binary skew adjacency spectrum:"];
Eigenvalues[inc] ];


(* function skewAdjacencyMatrix takes a graph as input and outputs the skew adjacency matrix *)
skewAdjacencyMatrix[g0_]:=adjacencyMatrix[g0]-Transpose[adjacencyMatrix[g0]];


(* function skewAdjacencySpec takes a graph as input and outputs the skew adjacency spectrum *)
skewAdjacencySpec[g0_]:= Module[{graph=g0,inc},
inc=skewAdjacencyMatrix[graph];
Eigenvalues[inc] ];
skewAdjacencySpecS[g0_]:= Module[{graph=g0,inc},
inc=skewAdjacencyMatrix[graph];
Print[graph];
Print["Adjacency matrix:"];
Print[MatrixForm[adjacencyMatrix[graph]]];
Print["Skew adjacency matrix:"];
Print[MatrixForm[inc]];
Print["Skew adjacency spectrum:"];
Eigenvalues[inc] ];


(* function skewLaplacianMatrix takes a graph as input and outputs the skew Laplacian matrix *)
skewLaplacianMatrix[g0_]:= Module[{graph=g0,inc,verts,n,i,j,d},
verts=VertexList[graph];
n=Length[verts];
d=Table[0,{i,1,n},{j,1,n}];
(* we compute in-degree - out-degree, but COUNTING EDGES, not vertices, so counting parallel edges. *)
i=1;
While[i≤n,
d[[i,i]]=Count[EdgeList[graph],verts[[i]]\[DirectedEdge]_]-Count[EdgeList[graph],_\[DirectedEdge]verts[[i]]];
i++];
d-skewAdjacencyMatrix[graph]
];


(* function skewLaplaceSpec takes a graph as input and outputs the skew Laplacian spectrum *)
skewLaplaceSpec[g0_]:=Module[{graph=g0},
Eigenvalues[skewLaplacianMatrix[graph]]
];
skewLaplaceSpecS[g0_]:=Module[{graph=g0},
Print[graph];
Print["Skew Laplacian matrix"];
Print[MatrixForm[skewLaplacianMatrix[graph]]];
Print["Skew Laplace spectrum"];
Eigenvalues[skewLaplacianMatrix[graph]]
];


(* function skewLaplacianMatrixBinary takes a graph as input and outputs the binary skew Laplacian matrix *)
skewLaplacianMatrixBinary[g0_]:= Module[{graph=g0,inc,verts,n,i,j,d},
verts=VertexList[graph];
n=Length[verts];
d=Table[0,{i,1,n},{j,1,n}];
i=1;
(* we compute in-degree - out-degree, but COUNTING VERTICES, not edges, so ignoring parallel edges. *)
While[i≤n,
j=1;
While[j≤n,
If[MemberQ[EdgeList[graph],verts[[i]]\[DirectedEdge]verts[[j]] ],
d[[i,i]]++];
If[MemberQ[EdgeList[graph],verts[[j]]\[DirectedEdge]verts[[i]] ],
d[[i,i]]--];
j++];
i++];
d-skewAdjacencyMatrixBinary[graph]
];


(* function skewLaplaceSpecBinary takes a graph as input and outputs the binary skew Laplacian spectrum *)
skewLaplaceSpecBinary[g0_]:=Module[{graph=g0},
Eigenvalues[skewLaplacianMatrixBinary[graph]]
];
skewLaplaceSpecBinaryS[g0_]:=Module[{graph=g0},
Print[graph];
Print["Binary skew Laplacian matrix"];
Print[MatrixForm[skewLaplacianMatrixBinary[graph]]];
Print["Binary skew Laplace spectrum"];
Eigenvalues[skewLaplacianMatrixBinary[graph]]
];


(* function transitionProbabilityMatrixBinary takes a graph as input and outputs the binary transition probability matrix *)
transitionProbabilityMatrixBinary[g0_]:= Module[{graph=g0,inc,verts,n,i,j,d},
verts=VertexList[graph];
n=Length[verts];
inc=Table[0,{i,1,n},{j,1,n}];
d=Table[0,{i,1,n}];
i=1;
While[i≤n,
j=1;
While[j≤n,
If[MemberQ[  EdgeList[graph]  , verts[[i]]\[DirectedEdge]verts[[j]]],
d[[i]]++];
j++];
i++];
i=1;
While[i≤n,
j=1;
While[j≤n,
If[MemberQ[ EdgeList[graph] ,  verts[[i]]\[DirectedEdge]verts[[j]] ],
inc[[i,j]]=1/d[[i]]];
j++];
i++];
inc] ;


(* function normalizedLaplacianBinary takes a graph as input and outputs the binary normalized Laplacian matrix *)
normalizedLaplacianBinary[g0_]:= Module[{graph=g0,inc,verts,n,i,j,phi,p,eig,Phi,phiSum},
verts=VertexList[graph];
n=Length[verts];
p=transitionProbabilityMatrixBinary[graph];
(* define phi, the eigenvector with  *)
eig=Eigensystem[Transpose[p]  ];
i=1;
While[i≤n,
If[
AllTrue[Table[j,{j,1,n}],eig[[2,i]][[#]]>0&],
phi=eig[[2,i]];
i=n+1];
i++];
Clear[i];
(* normalize phi *)
phiSum=Sum[phi[[i]],{i,1,n}];
phi=phi/phiSum;
(* Phi is the diagonal matrix with entries of phi *)
Phi=DiagonalMatrix[phi];
IdentityMatrix[n]-(Sqrt[Phi].p.Sqrt[Inverse[Phi]]+Sqrt[Inverse[Phi]].ConjugateTranspose[p].Sqrt[Phi])/2
];
normalizedLaplacianBinaryS[g0_]:= Module[{graph=g0,inc,verts,n,i,j,phi,p,eig,Phi,phiSum},
verts=VertexList[graph];
n=Length[verts];
p=transitionProbabilityMatrixBinary[graph];
Print["Binary transition probability matrix:"];
Print[MatrixForm[p]];
(* define phi, the eigenvector with  *)
eig=Eigensystem[Transpose[p]  ];
i=1;
While[i≤n,
If[
AllTrue[Table[j,{j,1,n}],eig[[2,i]][[#]]>0&],
phi=eig[[2,i]];
i=n+1];
i++];
Clear[i];
(* normalize phi *)
phiSum=Sum[phi[[i]],{i,1,n}];
phi=phi/phiSum;
Print["Perron-Frobenius vector:"];
Print[phi];
(* Phi is the diagonal matrix with entries of phi *)
Phi=DiagonalMatrix[phi];
Print["Perron-Frobenius vector as a matrix:"];
Print[MatrixForm[Phi]];
IdentityMatrix[n]-(Sqrt[Phi].p.Sqrt[Inverse[Phi]]+Sqrt[Inverse[Phi]].ConjugateTranspose[p].Sqrt[Phi])/2
];


(* function combinatorialLaplacianBinary takes a graph as input and outputs the binary combinatorial Laplacian matrix *)
combinatorialLaplacianBinary[g0_]:= Module[{graph=g0,inc,verts,n,i,j,phi,p,eig,Phi,phiSum},
verts=VertexList[graph];
n=Length[verts];
p=transitionProbabilityMatrixBinary[graph];
(* define phi, the eigenvector with  *)
eig=Eigensystem[Transpose[p]  ];
i=1;
While[i≤n,
If[
AllTrue[Table[j,{j,1,n}],eig[[2,i]][[#]]>0&],
phi=eig[[2,i]];
i=n+1];
i++];
(* normalize phi *)
phiSum=Sum[phi[[i]],{i,1,n}];
phi=phi/phiSum;
(* Phi is the diagonal matrix with entries of phi *)
Phi=DiagonalMatrix[phi];
Phi-(Phi.p+ConjugateTranspose[p].Phi)/2
];
combinatorialLaplacianBinaryS[g0_]:= Module[{graph=g0,inc,verts,n,i,j,phi,p,eig,Phi,phiSum},
verts=VertexList[graph];
n=Length[verts];
p=transitionProbabilityMatrixBinary[graph];
Print["Binary transition probability matrix:"];
Print[MatrixForm[p]];
(* define phi, the eigenvector with  *)
eig=Eigensystem[Transpose[p]  ];
i=1;
While[i≤n,
If[
AllTrue[Table[j,{j,1,n}],eig[[2,i]][[#]]>0&],
phi=eig[[2,i]];
i=n+1];
i++];
(* normalize phi *)
phiSum=Sum[phi[[i]],{i,1,n}];
phi=phi/phiSum;
Print["Perron-Frobenius vector:"];
Print[phi];
(* Phi is the diagonal matrix with entries of phi *)
Phi=DiagonalMatrix[phi];
Print["Perron-Frobenius vector as a matrix:"];
Print[MatrixForm[Phi]];
Phi-(Phi.p+ConjugateTranspose[p].Phi)/2
];


(* function normalizedLaplaceSpecBinary takes a graph as input and outputs the binary normalized Laplacian spectrum *)
normalizedLaplaceSpecBinary[g0_]:= Module[{graph=g0,inc},
inc=normalizedLaplacianBinary[graph];
Eigenvalues[inc ] ];
normalizedLaplaceSpecBinaryS[g0_]:= Module[{graph=g0,inc},
Print[graph];
inc=normalizedLaplacianBinaryS[graph];
Print["Binary normalized Laplacian:"];
Print[MatrixForm[inc]];
Print["Binary normalized Laplace spectrum:"];
Eigenvalues[inc ] ];


(* function combinatorialLaplaceSpecBinary takes a graph as input and outputs the binary combinatorial Laplacian spectrum *)
combinatorialLaplaceSpecBinary[g0_]:= Module[{graph=g0,inc},
inc=combinatorialLaplacianBinary[graph];
Eigenvalues[inc ] ];
combinatorialLaplaceSpecBinaryS[g0_]:= Module[{graph=g0,inc},
Print[graph];
inc=combinatorialLaplacianBinaryS[graph];
Print["Binary combinatorial Laplacian:"];
Print[MatrixForm[inc]];
Print["Binary combinatorial Laplace spectrum:"];
Eigenvalues[inc ] ];


(* function transitionProbabilityMatrix takes a graph as input and outputs the transition probability matrix *)
transitionProbabilityMatrix[g0_]:= Module[{graph=g0,inc,verts,edges,n,i,j,d},
verts=VertexList[graph];
edges=EdgeList[graph];
n=Length[verts];
inc=Table[0,{i,1,n},{j,1,n}];
i=1;
While[i≤n,
j=1;
While[j≤n,
d=Count[edges,verts[[i]]\[DirectedEdge]_ ];
If[d>0,
inc[[i,j]]=Count[edges,verts[[i]]\[DirectedEdge]verts[[j]]]/d];
j++];
i++];
inc] ;


(* function normalizedLaplacian takes a graph as input and outputs the normalized Laplacian matrix *)
normalizedLaplacian[g0_]:= Module[{graph=g0,inc,verts,n,i,j,phi,p,eig,Phi,phiSum},
verts=VertexList[graph];
n=Length[verts];
p=transitionProbabilityMatrix[graph];
(* define phi, the eigenvector with  *)
eig=Eigensystem[Transpose[p]  ];
i=1;
While[i≤n,
If[
AllTrue[Table[j,{j,1,n}],eig[[2,i]][[#]]>0&],
phi=eig[[2,i]];
i=n+1];
i++];
Clear[i];
(* normalize phi *)
phiSum=Sum[phi[[i]],{i,1,n}];
phi=phi/phiSum;
(* Phi is the diagonal matrix with entries of phi *)
Phi=DiagonalMatrix[phi];
IdentityMatrix[n]-(Sqrt[Phi].p.Sqrt[Inverse[Phi]]+Sqrt[Inverse[Phi]].ConjugateTranspose[p].Sqrt[Phi])/2
];
normalizedLaplacianS[g0_]:= Module[{graph=g0,inc,verts,n,i,j,phi,p,eig,Phi,phiSum},
verts=VertexList[graph];
n=Length[verts];
p=transitionProbabilityMatrix[graph];
Print["Transition probability matrix:"];
Print[MatrixForm[p]];
(* define phi, the eigenvector with  *)
eig=Eigensystem[Transpose[p]  ];
i=1;
While[i≤n,
If[
AllTrue[Table[j,{j,1,n}],eig[[2,i]][[#]]>0&],
phi=eig[[2,i]];
i=n+1];
i++];
Clear[i];
(* normalize phi *)
phiSum=Sum[phi[[i]],{i,1,n}];
phi=phi/phiSum;
Print["Perron-Frobenius vector:"];
Print[phi];
(* Phi is the diagonal matrix with entries of phi *)
Phi=DiagonalMatrix[phi];
Print["Perron-Frobenius vector as a matrix:"];
Print[MatrixForm[Phi]];
IdentityMatrix[n]-(Sqrt[Phi].p.Sqrt[Inverse[Phi]]+Sqrt[Inverse[Phi]].ConjugateTranspose[p].Sqrt[Phi])/2
];


(* function combinatorialLaplacian takes a graph as input and outputs the combinatorial Laplacian matrix *)
combinatorialLaplacian[g0_]:= Module[{graph=g0,inc,verts,n,i,j,phi,p,eig,Phi,phiSum},
verts=VertexList[graph];
n=Length[verts];
p=transitionProbabilityMatrix[graph];
(* define phi, the eigenvector with  *)
eig=Eigensystem[Transpose[p]  ];
i=1;
While[i≤n,
If[
AllTrue[Table[j,{j,1,n}],eig[[2,i]][[#]]>0&],
phi=eig[[2,i]];
i=n+1];
i++];
(* normalize phi *)
phiSum=Sum[phi[[i]],{i,1,n}];
phi=phi/phiSum;
Phi=DiagonalMatrix[phi];
Phi-(Phi.p+ConjugateTranspose[p].Phi)/2
];
combinatorialLaplacianS[g0_]:= Module[{graph=g0,inc,verts,n,i,j,phi,p,eig,Phi,phiSum},
verts=VertexList[graph];
n=Length[verts];
p=transitionProbabilityMatrix[graph];
Print["Transition probability matrix:"];
Print[MatrixForm[p]];
(* define phi, the eigenvector with  *)
eig=Eigensystem[Transpose[p]  ];
i=1;
While[i≤n,
If[
AllTrue[Table[j,{j,1,n}],eig[[2,i]][[#]]>0&],
phi=eig[[2,i]];
i=n+1];
i++];
(* normalize phi *)
phiSum=Sum[phi[[i]],{i,1,n}];
phi=phi/phiSum;
Print["Perron-Frobenius vector:"];
Print[phi];
Phi=DiagonalMatrix[phi];
Print["Perron-Frobenius vector as a matrix:"];
Print[MatrixForm[Phi]];
Phi-(Phi.p+ConjugateTranspose[p].Phi)/2
];


(* function normalizedLaplaceSpec takes a graph as input and outputs the normalized Laplacian spectrum *)
normalizedLaplaceSpec[g0_]:= Module[{graph=g0,inc},
inc=normalizedLaplacian[graph];
Eigenvalues[inc ] ];
normalizedLaplaceSpecS[g0_]:= Module[{graph=g0,inc},
Print[graph];
inc=normalizedLaplacianS[graph];
Print["Normalized Laplacian:"];
Print[MatrixForm[inc]];
Print["Normalized Laplace spectrum:"];
Eigenvalues[inc ] ];

(* function combinatorialLaplaceSpec takes a graph as input and outputs the combinatorial Laplacian spectrum *)
combinatorialLaplaceSpec[g0_]:= Module[{graph=g0,inc},
inc=combinatorialLaplacianS[graph];
Eigenvalues[inc ] ];
combinatorialLaplaceSpecS[g0_]:= Module[{graph=g0,inc},
Print[graph];
inc=combinatorialLaplacianS[graph];
Print["Combinatorial Laplacian:"];
Print[MatrixForm[inc]];
Print["Combinatorial Laplace spectrum:"];
Eigenvalues[inc ] ];

Example 5.1 (of arXiv:2010.10769 [math.CO] v1)

Definitions of the graphs

(* Define the graph (Subscript[D, 1]) *)
Print["Graph (Subscript[D, 1])"];
d1=Graph[{v1,v2,v3},{v1\[DirectedEdge]v1,v1\[DirectedEdge]v2,v2\[DirectedEdge]v2,v2\[DirectedEdge]v2,v1\[DirectedEdge]v3,v1\[DirectedEdge]v3,v2\[DirectedEdge]v3,v3\[DirectedEdge]v3},VertexLabels->"Name"]

(* Define the graph (Subscript[D, 1]^((S))) *)
(* computed using d1S=moveSinv[d1] *)
Print["Graph (Subscript[D, 1]^((S)))"];
d1S=

(* Define the graph (Subscript[D, 1]^((R))) *)
Print["Graph (Subscript[D, 1]^((R)))"];
d1R=Graph[{v1,v2,v3,r},{v1\[DirectedEdge]v1,v1\[DirectedEdge]v2,v2\[DirectedEdge]v2,v2\[DirectedEdge]r,r\[DirectedEdge]v2,v1\[DirectedEdge]v3,v1\[DirectedEdge]v3,v2\[DirectedEdge]v3,v3\[DirectedEdge]v3},VertexLabels->"Name"]

(* Define the graph (Subscript[D, 1]^((O))) *)
(* computed using d1O=moveO[d1,o] *)
Print["Graph (Subscript[D, 1]^((O)))"];
d1O=

(* Define the graph (Subscript[D, 1]^((I))) *)
Print["Graph (Subscript[D, 1]^((I)))"];
(* computed using d1I=moveI[d1,i] *)
d1I=

(* Define the graph (Subscript[D, 1]^((C))) *)
Print["Graph (Subscript[D, 1]^((C)))"];
(* computed using d1C=moveC[d1,u] *)
d1C=

Laplace spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1])"];
laplaceSpecS[d1]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((S)))"];
laplaceSpecS[d1S]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((R)))"];
laplaceSpecS[d1R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((O)))"];
laplaceSpecS[d1O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((I)))"];
laplaceSpecS[d1I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((C)))"];
laplaceSpecS[d1C]
%//N

Adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1])"];
adjacencySpecS[d1]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((S)))"];
adjacencySpecS[d1S]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((O)))"];
adjacencySpecS[d1O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((I)))"];
adjacencySpecS[d1I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((R)))"];
adjacencySpecS[d1R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((C)))"];
adjacencySpecS[d1C]
%//N

Binary adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Binary adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1])"];
adjacencySpecBinaryS[d1]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((S)))"];
adjacencySpecBinaryS[d1S]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((O)))"];
adjacencySpecBinaryS[d1O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((R)))"];
adjacencySpecBinaryS[d1R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((I)))"];
adjacencySpecBinaryS[d1I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((C)))"];
adjacencySpecBinaryS[d1C]
%//N

Symmetric adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Symmetric adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1])"];
adjacencySpecSymmetricS[d1]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((S)))"];
adjacencySpecSymmetricS[d1S]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((R)))"];
adjacencySpecSymmetricS[d1R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((O)))"];
adjacencySpecSymmetricS[d1O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((I)))"];
adjacencySpecSymmetricS[d1I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((C)))"];
adjacencySpecSymmetricS[d1C]
%//N

Symmetric binary adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Symmetric binary adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1])"];
adjacencySpecSymmetricBinaryS[d1]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((S)))"];
adjacencySpecSymmetricBinaryS[d1S]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((R)))"];
adjacencySpecSymmetricBinaryS[d1R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((O)))"];
adjacencySpecSymmetricBinaryS[d1O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((I)))"];
adjacencySpecSymmetricBinaryS[d1I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((C)))"];
adjacencySpecSymmetricBinaryS[d1C]
%//N

Line adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Line adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1])"];
lineAdjacencySpecS[d1]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((S)))"];
lineAdjacencySpecS[d1S]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((I)))"];
lineAdjacencySpecS[d1I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((R)))"];
lineAdjacencySpecS[d1R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((O)))"];
lineAdjacencySpecS[d1O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((C)))"];
lineAdjacencySpecS[d1C]
%//N

Hermitian adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Hermitian adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1])"];
hermitianAdjacencySpectrumS[d1]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((S)))"];
hermitianAdjacencySpectrumS[d1S]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((R)))"];
hermitianAdjacencySpectrumS[d1R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((O)))"];
hermitianAdjacencySpectrumS[d1O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((I)))"];
hermitianAdjacencySpectrumS[d1I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((C)))"];
hermitianAdjacencySpectrumS[d1C]
%//N

Skew adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Skew adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1])"];
skewAdjacencySpecS[d1]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((S)))"];
skewAdjacencySpecS[d1S]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((R)))"];
skewAdjacencySpecS[d1R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((O)))"];
skewAdjacencySpecS[d1O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((I)))"];
skewAdjacencySpecS[d1I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((C)))"];
skewAdjacencySpecS[d1C]
%//N

Binary skew adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Binary skew adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1])"];
skewAdjacencySpecBinaryS[d1]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((S)))"];
skewAdjacencySpecBinaryS[d1S]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((R)))"];
skewAdjacencySpecBinaryS[d1R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((O)))"];
skewAdjacencySpecBinaryS[d1O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((I)))"];
skewAdjacencySpecBinaryS[d1I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((C)))"];
skewAdjacencySpecBinaryS[d1C]
%//N

Skew Laplace spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Skew Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1])"];
skewLaplaceSpecS[d1]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((S)))"];
skewLaplaceSpecS[d1S]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((I)))"];
skewLaplaceSpecS[d1I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((R)))"];
skewLaplaceSpecS[d1R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((O)))"];
skewLaplaceSpecS[d1O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((C)))"];
skewLaplaceSpecS[d1C]
%//N

Binary skew Laplace spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Binary skew Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1])"];
skewLaplaceSpecBinaryS[d1]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((S)))"];
skewLaplaceSpecBinaryS[d1S]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((R)))"];
skewLaplaceSpecBinaryS[d1R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((O)))"];
skewLaplaceSpecBinaryS[d1O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((I)))"];
skewLaplaceSpecBinaryS[d1I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((C)))"];
skewLaplaceSpecBinaryS[d1C]
%//N

Example 5.2 (of arXiv:2010.10769 [math.CO] v1)

Definitions of the graphs

(* Define the graph (Subscript[D, 2]) *)
Print["Graph (Subscript[D, 2])"];
d2=Graph[{v1,v2,v3},{v1\[DirectedEdge]v1,v1\[DirectedEdge]v2,v2\[DirectedEdge]v2,v2\[DirectedEdge]v2,v2\[DirectedEdge]v3,v3\[DirectedEdge]v3},VertexLabels->"Name"]

(* Define the graph (Subscript[D, 1]^((P))) *)
Print["Graph (Subscript[D, 1]^((P)))"];
d2P=Graph[{v1,v2,v3,w1,w2},{v1\[DirectedEdge]v1,v1\[DirectedEdge]v2,v2\[DirectedEdge]v2,v2\[DirectedEdge]v2,v2\[DirectedEdge]v3,v3\[DirectedEdge]v3,v2\[DirectedEdge]w1,w1\[DirectedEdge]v2,w1\[DirectedEdge]w1,w1\[DirectedEdge]w2,w2\[DirectedEdge]w1,w2\[DirectedEdge]w2,v1\[DirectedEdge]w2,v1\[DirectedEdge]w2},VertexLabels->"Name"]

Laplace spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 2])"];
laplaceSpecS[d2]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((P)))"];
laplaceSpecS[d2P]
%//N

Adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 2])"];
adjacencySpecS[d2]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((P)))"];
adjacencySpecS[d2P]
%//N

Binary adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Binary adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 2])"];
adjacencySpecBinaryS[d2]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((P)))"];
adjacencySpecBinaryS[d2P]
%//N

Symmetric adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Symmetric adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 2])"];
adjacencySpecSymmetricS[d2]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((P)))"];
adjacencySpecSymmetricS[d2P]
%//N

Symmetric binary adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Symmetric binary adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 2])"];
adjacencySpecSymmetricBinaryS[d2]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((P)))"];
adjacencySpecSymmetricBinaryS[d2P]
%//N

Line adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Line adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 2])"];
lineAdjacencySpecS[d2]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((P)))"];
lineAdjacencySpecS[d2P]
%//N

Hermitian adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Hermitian adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 2])"];
hermitianAdjacencySpectrumS[d2]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((P)))"];
hermitianAdjacencySpectrumS[d2P]
%//N

Skew adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Skew adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 2])"];
skewAdjacencySpecS[d2]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((P)))"];
skewAdjacencySpecS[d2P]
%//N

Binary skew adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Binary skew adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 2])"];
skewAdjacencySpecBinaryS[d2]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((P)))"];
skewAdjacencySpecBinaryS[d2P]
%//N

Skew Laplace spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Skew Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 2])"];
skewLaplaceSpecS[d2]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((P)))"];
skewLaplaceSpecS[d2P]
%//N

Binary skew Laplace spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Binary skew Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 2])"];
skewLaplaceSpecBinaryS[d2]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 1]^((P)))"];
skewLaplaceSpecBinaryS[d2P]
%//N

Example 5.3 (of arXiv:2010.10769 [math.CO] v1)

Definitions of the graphs

(* Define the graph (Subscript[D, 3]) *)
Print["Graph (Subscript[D, 3])"];
d3=Graph[{v1,v2},{v1\[DirectedEdge]v2,v2\[DirectedEdge]v1,v2\[DirectedEdge]v2,v2\[DirectedEdge]v2},VertexLabels->"Name"]

(* Define the graph (Subscript[D, 3]^((O))) *)
(* computed using d3O=moveO[d1,o] *)
Print["Graph (Subscript[D, 3]^((O)))"];
d3O=

(* Define the graph (Subscript[D, 3]^((I))) *)
(* computed using d3I=moveI[d3,i] *)
Print["Graph (Subscript[D, 3]^((I)))"];
d3I=

Binary adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Binary adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 3])"];
adjacencySpecBinaryS[d3]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 3]^((O)))"];
adjacencySpecBinaryS[d3O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 3]^((I)))"];
adjacencySpecBinaryS[d3I]
%//N

Normalized Laplace spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Normalized Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 3])"];
normalizedLaplaceSpecS[d3]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 3]^((O)))"];
normalizedLaplaceSpecS[d3O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 3]^((I)))"];
normalizedLaplaceSpecS[d3I]
%//N

Combinatorial Laplace spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Combinatorial Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 3])"];
combinatorialLaplaceSpecS[d3]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 3]^((O)))"];
combinatorialLaplaceSpecS[d3O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 3]^((I)))"];
combinatorialLaplaceSpecS[d3I]
%//N

Binary normalized Laplace spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Binary normalized Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 3])"];
normalizedLaplaceSpecBinaryS[d3]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 3]^((O)))"];
normalizedLaplaceSpecBinaryS[d3O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 3]^((I)))"];
normalizedLaplaceSpecBinaryS[d3I]
%//N

Binary combinatorial Laplace spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Binary combinatorial Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 3])"];
combinatorialLaplaceSpecBinaryS[d3]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 3]^((O)))"];
combinatorialLaplaceSpecBinaryS[d3O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 3]^((I)))"];
combinatorialLaplaceSpecBinaryS[d3I]
%//N

Example 5.4 (of arXiv:2010.10769 [math.CO] v1)

Definitions of the graphs

(* Define the graph (Subscript[D, 4]) *)
Print["Graph (Subscript[D, 4])"];
d4=Graph[{v1,v2},{v1\[DirectedEdge]v1,v1\[DirectedEdge]v2,v2\[DirectedEdge]v1},VertexLabels->"Name"]

(* Define the graph (Subscript[D, 4]^((R))) *)
(* computed using d4R=moveR[d4] *)
Print["Graph (Subscript[D, 4]^((R)))"];
d4R=

(* Define the graph (Subscript[D, 4]^((O))) *)
(* computed using d4O=moveO[d4,o] *)
Print["Graph (Subscript[D, 4]^((O)))"];
d4O=


(* Define the graph (Subscript[D, 4]^((I))) *)
(* computed using d4I=moveI[d4,i] *)
Print["Graph (Subscript[D, 4]^((I)))"];
d4I=

(* Define the graph (Subscript[D, 4]^((C))) *)
(* computed using d4C=moveC[d4,u] *)
Print["Graph (Subscript[D, 4]^((C)))"];
d4C=

Laplace spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4])"];
laplaceSpecS[d4]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((R)))"];
laplaceSpecS[d4R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((O)))"];
laplaceSpecS[d4O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((I)))"];
laplaceSpecS[d4I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((C)))"];
laplaceSpecS[d4C]
%//N

Adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4])"];
adjacencySpecS[d4]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((R)))"];
adjacencySpecS[d4R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((O)))"];
adjacencySpecS[d4O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((I)))"];
adjacencySpecS[d4I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((C)))"];
adjacencySpecS[d4C]
%//N

Line adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Line adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4])"];
lineAdjacencySpecS[d4]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((R)))"];
lineAdjacencySpecS[d4R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((O)))"];
lineAdjacencySpecS[d4O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((I)))"];
lineAdjacencySpecS[d4I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((C)))"];
lineAdjacencySpecS[d4C]
%//N

Binary adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Binary adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4])"];
adjacencySpecBinaryS[d4]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((R)))"];
adjacencySpecBinaryS[d4R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((O)))"];
adjacencySpecBinaryS[d4O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((I)))"];
adjacencySpecBinaryS[d4I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((C)))"];
adjacencySpecBinaryS[d4C]
%//N

Symmetric adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Symmetric adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4])"];
adjacencySpecSymmetricS[d4]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((R)))"];
adjacencySpecSymmetricS[d4R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((O)))"];
adjacencySpecSymmetricS[d4O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((I)))"];
adjacencySpecSymmetricS[d4I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((C)))"];
adjacencySpecSymmetricS[d4C]
%//N

Symmetric binary adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Symmetric binary adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4])"];
adjacencySpecSymmetricBinaryS[d4]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((R)))"];
adjacencySpecSymmetricBinaryS[d4R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((O)))"];
adjacencySpecSymmetricBinaryS[d4O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((I)))"];
adjacencySpecSymmetricBinaryS[d4I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((C)))"];
adjacencySpecSymmetricBinaryS[d4C]
%//N

Hermitian adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Hermitian adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4])"];
hermitianAdjacencySpectrumS[d4]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((R)))"];
hermitianAdjacencySpectrumS[d4R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((O)))"];
hermitianAdjacencySpectrumS[d4O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((I)))"];
hermitianAdjacencySpectrumS[d4I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((C)))"];
hermitianAdjacencySpectrumS[d4C]
%//N

Skew adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Skew adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4])"];
skewAdjacencySpecS[d4]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((R)))"];
skewAdjacencySpecS[d4R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((O)))"];
skewAdjacencySpecS[d4O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((I)))"];
skewAdjacencySpecS[d4I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((C)))"];
skewAdjacencySpecS[d4C]
%//N

Binary skew adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Binary skew adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4])"];
skewAdjacencySpecBinaryS[d4]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((R)))"];
skewAdjacencySpecBinaryS[d4R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((O)))"];
skewAdjacencySpecBinaryS[d4O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((I)))"];
skewAdjacencySpecBinaryS[d4I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((C)))"];
skewAdjacencySpecBinaryS[d4C]
%//N

Skew Laplace spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Skew Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4])"];
skewLaplaceSpecS[d4]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((R)))"];
skewLaplaceSpecS[d4R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((O)))"];
skewLaplaceSpecS[d4O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((I)))"];
skewLaplaceSpecS[d4I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((C)))"];
skewLaplaceSpecS[d4C]
%//N

Binary skew Laplace spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Binary skew Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4])"];
skewLaplaceSpecBinaryS[d4]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((R)))"];
skewLaplaceSpecBinaryS[d4R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((O)))"];
skewLaplaceSpecBinaryS[d4O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((I)))"];
skewLaplaceSpecBinaryS[d4I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((C)))"];
skewLaplaceSpecBinaryS[d4C]
%//N

Normalized Laplace spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Normalized Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4])"];
normalizedLaplaceSpecS[d4]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((R)))"];
normalizedLaplaceSpecS[d4R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((O)))"];
normalizedLaplaceSpecS[d4O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((I)))"];
normalizedLaplaceSpecS[d4I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((C)))"];
normalizedLaplaceSpecS[d4C]
%//N

Combinatorial Laplace spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Combinatorial Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4])"];
combinatorialLaplaceSpecS[d4]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((R)))"];
combinatorialLaplaceSpecS[d4R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((O)))"];
combinatorialLaplaceSpecS[d4O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((I)))"];
combinatorialLaplaceSpecS[d4I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((C)))"];
combinatorialLaplaceSpecS[d4C]
%//N

Binary normalized Laplace spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Binary Normalized Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4])"];
normalizedLaplaceSpecBinaryS[d4]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((R)))"];
normalizedLaplaceSpecBinaryS[d4R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((O)))"];
normalizedLaplaceSpecBinaryS[d4O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((I)))"];
normalizedLaplaceSpecBinaryS[d4I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((C)))"];
normalizedLaplaceSpecBinaryS[d4C]
%//N

Binary combinatorial Laplace spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Binary Combinatorial Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4])"];
combinatorialLaplaceSpecBinaryS[d4]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((R)))"];
combinatorialLaplaceSpecBinaryS[d4R]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((O)))"];
combinatorialLaplaceSpecBinaryS[d4O]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((I)))"];
combinatorialLaplaceSpecBinaryS[d4I]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((C)))"];
combinatorialLaplaceSpecBinaryS[d4C]
%//N

Example 5.5 (of arXiv:2010.10769 [math.CO] v1)

Definitions of the graphs

(* Define the graph (Subscript[D, 5]) *)
Print["Graph (Subscript[D, 5])"];
d5=Graph[{v1,v2,v3},{v1\[DirectedEdge]v2,v2\[DirectedEdge]v3,v3\[DirectedEdge]v1},VertexLabels->"Name"]

(* Define the graph (Subscript[D, 5]^((R))) *)
(* computed using d5R=moveR[d5] *)
Print["Graph (Subscript[D, 5]^((R)))"];
d5R=

Skew adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Skew adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 5])"];
skewAdjacencySpecS[d5]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((R)))"];
skewAdjacencySpecS[d5R]
%//N

Binary skew adjacency spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Binary skew adjacency spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 5])"];
skewAdjacencySpecBinaryS[d5]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((R)))"];
skewAdjacencySpecBinaryS[d5R]
%//N

Skew Laplace spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Skew Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 5])"];
skewLaplaceSpecS[d5]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((R)))"];
skewLaplaceSpecS[d5R]
%//N

Binary skew Laplace spectra

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Binary skew Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 5])"];
skewLaplaceSpecBinaryS[d5]
%//N
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 4]^((R)))"];
skewLaplaceSpecBinaryS[d5R]
%//N

Example 5.6 (of arXiv:2010.10769 [math.CO] v1)

Definitions of the graphs (m = 3)

m=3;

(* Define the graph (Subscript[D, 0]) *)
Print["Graph (Subscript[D, 0])"];
d0 = Graph[{(Subscript[w, 1]), (Subscript[w, 2])}, { DirectedEdge[(Subscript[w, 1]), (Subscript[w, 2])],DirectedEdge[(Subscript[w, 2]), (Subscript[w, 1])]}, VertexLabels->"Name"]

(* Define the graph (Subscript[D, m]) *)
Print["Graph (Subscript[D, m])"];
dm = Graph[Join[{(Subscript[w, 1]), (Subscript[w, 2])},Table[(Subscript[v, i]),{i,1,m}]],
Flatten[Join[{ DirectedEdge[(Subscript[w, 1]), (Subscript[w, 2])],DirectedEdge[(Subscript[w, 2]), (Subscript[w, 1])]},Table[{DirectedEdge[(Subscript[v, i]),(Subscript[w, 1])],DirectedEdge[(Subscript[v, i]),(Subscript[w, 2])]},{i,1,m}]]], VertexLabels->"Name"]

Laplace spectra (m = 3)

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 0])"];
laplaceSpecS[d0]
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, m])"];
laplaceSpecS[dm]

Definitions of the graphs (m = 10)

m=10;

(* Define the graph (Subscript[D, 0]) *)
Print["Graph (Subscript[D, 0])"];
d0 = Graph[{(Subscript[w, 1]), (Subscript[w, 2])}, { DirectedEdge[(Subscript[w, 1]), (Subscript[w, 2])],DirectedEdge[(Subscript[w, 2]), (Subscript[w, 1])]}, VertexLabels->"Name"]

(* Define the graph (Subscript[D, m]) *)
Print["Graph (Subscript[D, m])"];
dm = Graph[Join[{(Subscript[w, 1]), (Subscript[w, 2])},Table[(Subscript[v, i]),{i,1,m}]],
Flatten[Join[{ DirectedEdge[(Subscript[w, 1]), (Subscript[w, 2])],DirectedEdge[(Subscript[w, 2]), (Subscript[w, 1])]},Table[{DirectedEdge[(Subscript[v, i]),(Subscript[w, 1])],DirectedEdge[(Subscript[v, i]),(Subscript[w, 2])]},{i,1,m}]]], VertexLabels->"Name"]

Laplace spectra (m = 10)

Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Laplace spectra"];
Print["------------------------------------------------------------------------"];
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, 0])"];
laplaceSpecS[d0]
Print["------------------------------------------------------------------------"];
Print["Graph (Subscript[D, m])"];
laplaceSpecS[dm]