Hadamard Graph

Author

Eric W. Weisstein
November 10, 2023

This notebook downloaded from http://mathworld.wolfram.com/notebooks/GraphTheory/HadamardGraph.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/HadamardGraph.html.

©2023 Wolfram Research, Inc. except for portions noted otherwise

Special cases

Print[{#,RecognizeGraph[HadamardGraph[#]]//Timing}]&/@Join[{1,2},Range[4,20,4]];

Embeddings

<<MathWorld`Graphs`

GraphData["Hadamard*"]

{"Hadamard", {8, 1}}

Names

GraphData[{"Hadamard",{8,1}},"StandardName"]

GraphData[{"Hadamard",{8,1}},"StandardNames"]

Primary

GraphData[{"Hadamard",{8,1}}]//StyleGraphs[#,ImageSize->Small]&

All

GraphData[{"Hadamard",{8,1}},"Graph","All"]//StyleGraphs

Inexact

Select[GraphData[{"Hadamard",{8,1}},"Graph","All"],(!FreeQ[GraphEmbedding[#],_?InexactNumberQ]&)]//StyleGraphs

Embedding types

GraphDataEmbeddings[GraphData[{"Hadamard",{8,1}},"EdgeList"]]

Default embedding

GraphPlot@GraphData[{"Hadamard",{8,1}},"Edges"]

v={};
g=Graph[Range[Length[v]],UndirectedEdge@@@{},VertexCoordinates->v,VertexLabels->Automatic]

RecognizeGraph[g]

Degenerate

GraphData[{"Hadamard",{8,1}},"Graph","Degenerate"]//StyleGraphs

DegenerateGraphEmbeddingTypes/@GraphData[{"Hadamard",{8,1}},"Graph","Degenerate"]

Perspective

GraphData[{"Hadamard",{8,1}},"Graph","Perspective"]//StyleGraphs

Perspective construction

GraphData[{"Hadamard",{8,1}},"Polyhedron"]

Bilateral

GraphData[{"Hadamard",{8,1}},"Graph","Bilateral"]//StyleGraphs

Circular

GraphData[{"Hadamard",{8,1}},"Graph","Circular"]//StyleGraphs

Planar

GraphData[{"Hadamard",{8,1}},"Planar"]

GraphData[{"Hadamard",{8,1}},"Graph","Planar"]//StyleGraphs

MinimalCrossing

GraphData[{"Hadamard",{8,1}},{"RCN","CN"}]

GraphData[{"Hadamard",{8,1}},"Graph","MinimalCrossing"]//StyleGraphs

MinimalCrossing construction

(cn=CrossingNumber[GraphData[{"Hadamard",{8,1}}],TimeConstraint->1])//AbsoluteTiming

(cn=CrossingNumber[GraphData[{"Hadamard",{8,1}}],TimeConstraint->10])//AbsoluteTiming

(g=MinimalCrossingGraph[GraphData[{"Hadamard",{8,1}}],"CrossingNumber"->cn])//PolyhedralGraphQ

faces=ReverseSort@SymmetricallyDistinctFaces[g]

Tally[ReverseSort[Length/@faces]]

IGLayoutTutte[g,"OuterFace"->#]&/@faces

Union[Select[Table[RotateGraph[MinimalCrossingGraph[GraphData[{"Hadamard",{8,1}}],"CrossingNumber"->cn,RandomSeed->n]],{n,50}],Max[OuterFace[#]]<=GraphData[{"Hadamard",{8,1}},"V"]&]]//Timing

Table[MinimalCrossingGraph[GraphData[{"Hadamard",{8,1}}],"CrossingNumber"->cn,RandomSeed->i],{i,50}]//Union

v={};
g=Graph[Range[Length[v]],UndirectedEdge@@@{},VertexCoordinates->v,VertexLabels->Automatic]

RecognizeGraph[g]

RectilinearCrossingCount[g]

Circulant

GraphData[{"Hadamard",{8,1}},"Circulant"]

GraphData[{"Hadamard",{8,1}},"Graph","Circulant"]//StyleGraphs

Complement graph

GraphData[{"Hadamard",{8,1}},"ComplementGraph","Name"]

Line graph

GraphData[{"Hadamard",{8,1}},"Line"]

LineGraphQ[GraphData[{"Hadamard",{8,1}}]]//Timing

RootGraph

Select[GraphData[All],GraphData[#,"LineGraph","Name"]=== {"Hadamard",{8,1}}&]

RootGraph[GraphData[{"Hadamard",{8,1}}]]

Halin

GraphData[{"Hadamard",{8,1}},"Halin"]

GraphData[{"Hadamard",{8,1}},"Graph","Halin"]//StyleGraphs

Rigid

GraphData[{"Hadamard",{8,1}},"Rigid"]

GraphData[{"Hadamard",{8,1}},"Graph","Rigid"]//StyleGraphs

Flexible

GraphData[{"Hadamard",{8,1}},"Flexible"]

GraphData[{"Hadamard",{8,1}},"Graph","Flexible"]//StyleGraphs

LCF

GraphData[{"Hadamard",{8,1}},"LCF"]

GraphData[{"Hadamard",{8,1}},"HamiltonianCycleCount"]

GraphData[{"Hadamard",{8,1}},"LCFSignature"]

GraphData[{"Hadamard",{8,1}},"LCFNotations"]

GraphData[{"Hadamard",{8,1}},"Graph","LCF"]//StyleGraphs

Tally[LCFNotation[#][[2]]&/@%]

LCF compute random

FindRandomLCFNotation[GraphData[{"Hadamard",{8,1}}],TimeConstraint->120]

LCF compute 10^5

Tally[(lcf=LCF[GraphData[{"Hadamard",{8,1}}],10^5])[[All,2]]]//Timing

MaxMemoryUsed[]/10.^9 "GB"

DeleteCases[lcf,{_,1}]

LCFGraph@@@DeleteCases[lcf,{_,1}]//StyleGraphs

Tally[LCFNotation[#][[-1]]&/@(gs=NiceLCFGraphs[lcf,3,2])]//Timing

Length[gs]

gs

LCF compute 10^6

Tally[(lcf=LCF[GraphData[{"Hadamard",{8,1}}],10^6])[[All,2]]]//Timing

MaxMemoryUsed[]/10.^9 "GB"

DeleteCases[lcf,{_,1|2}]

LCFGraph@@@DeleteCases[lcf,{_,1}]//StyleGraphs

Tally[LCFNotation[#][[-1]]&/@(gs=NiceLCFGraphs[lcf,4])]//Timing

Length[gs]

gs

LCF compute 10^7

Tally[(lcf=LCF[GraphData[{"Hadamard",{8,1}}],10^7])[[All,2]]]//Timing

MaxMemoryUsed[]/10.^9 "GB"

DeleteCases[lcf,{_,1|2}]

LCFGraph@@@DeleteCases[lcf,{_,1}]//StyleGraphs

Tally[LCFNotation[#][[-1]]&/@(gs=NiceLCFGraphs[lcf,4])]//Timing

Length[gs]

gs

LCF compute 5*^7

Tally[(lcf=LCF[GraphData[{"Hadamard",{8,1}}],5*^7])[[All,2]]]//Timing

MaxMemoryUsed[]/10.^9 "GB"

DeleteCases[lcf,{_,1|2}]

LCFGraph@@@DeleteCases[lcf,{_,1}]//StyleGraphs

Tally[LCFNotation[#][[-1]]&/@(gs=NiceLCFGraphs[lcf,4])]//Timing

Length[gs]

gs

LCF compute all

Divisors[GraphData[{"Hadamard",{8,1}},"V"]]

Length[FindHamiltonianCycle[GraphData[{"Hadamard",{8,1}}],All][[All,All,1]]]//Timing

Tally[(lcf=LCF[GraphData[{"Hadamard",{8,1}}],All])[[All,2]]]//Timing

MaxMemoryUsed[]/10.^9 "GB"

Tally[(lcf=ReadProperty["LCFNotations",GraphNameToFileName[{"Hadamard",{8,1}},".m.gz"]])[[All,2]]]//Timing

DeleteCases[lcf,{_,1}]

LCFGraph@@@DeleteCases[lcf,{_,1}]//StyleGraphs

Tally[LCFNotation[#][[-1]]&/@(gs=NiceLCFGraphs[lcf,2,1])]//Timing

Length[gs]

gs

UnitDistance

GraphData[{"Hadamard",{8,1}},"UnitDistance"]

UnitDistanceGraphQ[GraphData[{"Hadamard",{8,1}}],Debug->True]//Timing

GraphData[{"Hadamard",{8,1}},"Graph","UnitDistance"]//StyleGraphs

UnitDistance by refinement

UnitDistanceEmbeddingRefine[Graph[GraphData[{"Hadamard",{8,1}},"VertexList"],GraphData[{"Hadamard",{8,1}},"EdgeList"]],MaxIterations->500]

UnitDistanceEmbeddingRefine[Annotate[#,VertexCoordinates->N[GraphEmbedding[#]]],MaxIterations->500]&/@Complement@@(GraphData[{"Hadamard",{8,1}},"Graph",#]&/@{"All","UnitDistance"})

UnitDistance by FindUnitDistanceEmbedding

FindUnitDistanceEmbedding[GraphData[{"Hadamard",{8,1}}],MaxIterations->5000,"ReturnWithMessage"->True]//Timing

FindUnitDistanceEmbedding[GraphData[{"Hadamard",{8,1}}],MaxIterations->5000,"ReturnWithMessage"->False]//Quiet//Timing

Matchstick

GraphData[{"Hadamard",{8,1}},"Matchstick"]

GraphData[{"Hadamard",{8,1}},"Graph","Matchstick"]//StyleGraphs

3D default

Graph3D[GraphData[{"Hadamard",{8,1}},"Edges"]]

3D All

GraphData[{"Hadamard",{8,1}},"Graph",{"3D","All"}]

3D UnitDistance

GraphData[{"Hadamard",{8,1}},"Graph",{"3D","UnitDistance"}]

3D Polyhedron

GraphData[{"Hadamard",{8,1}},"Polyhedral"]

GraphData[{"Hadamard",{8,1}},"Graph",{"3D","Polyhedron"}]

{"Hadamard", {12, 1}}

Names

GraphData[{"Hadamard",{12,1}},"StandardName"]

GraphData[{"Hadamard",{12,1}},"StandardNames"]

Primary

GraphData[{"Hadamard",{12,1}}]//StyleGraphs[#,ImageSize->Small]&

All

GraphData[{"Hadamard",{12,1}},"Graph","All"]//StyleGraphs

Inexact

Select[GraphData[{"Hadamard",{12,1}},"Graph","All"],(!FreeQ[GraphEmbedding[#],_?InexactNumberQ]&)]//StyleGraphs

Embedding types

GraphDataEmbeddings[GraphData[{"Hadamard",{12,1}},"EdgeList"]]

Default embedding

GraphPlot@GraphData[{"Hadamard",{12,1}},"Edges"]

v={};
g=Graph[Range[Length[v]],UndirectedEdge@@@{},VertexCoordinates->v,VertexLabels->Automatic]

RecognizeGraph[g]

Degenerate

GraphData[{"Hadamard",{12,1}},"Graph","Degenerate"]//StyleGraphs

DegenerateGraphEmbeddingTypes/@GraphData[{"Hadamard",{12,1}},"Graph","Degenerate"]

Perspective

GraphData[{"Hadamard",{12,1}},"Graph","Perspective"]//StyleGraphs

Perspective construction

GraphData[{"Hadamard",{12,1}},"Polyhedron"]

Bilateral

GraphData[{"Hadamard",{12,1}},"Graph","Bilateral"]//StyleGraphs

Circular

GraphData[{"Hadamard",{12,1}},"Graph","Circular"]//StyleGraphs

Planar

GraphData[{"Hadamard",{12,1}},"Planar"]

GraphData[{"Hadamard",{12,1}},"Graph","Planar"]//StyleGraphs

MinimalCrossing

GraphData[{"Hadamard",{12,1}},{"RCN","CN"}]

GraphData[{"Hadamard",{12,1}},"Graph","MinimalCrossing"]//StyleGraphs

MinimalCrossing construction

(cn=CrossingNumber[GraphData[{"Hadamard",{12,1}}],TimeConstraint->1])//AbsoluteTiming

(cn=CrossingNumber[GraphData[{"Hadamard",{12,1}}],TimeConstraint->10])//AbsoluteTiming

(cn=CrossingNumber[GraphData[{"Hadamard",{12,1}}],TimeConstraint->60])//AbsoluteTiming

(cn=CrossingNumber[GraphData[{"Hadamard",{12,1}}],TimeConstraint->360])//AbsoluteTiming

(cn=CrossingNumber[GraphData[{"Hadamard",{12,1}}],TimeConstraint->3600])//AbsoluteTiming

(cn=CrossingNumber[GraphData[{"Hadamard",{12,1}}],TimeConstraint->5 3600])//AbsoluteTiming

(g=MinimalCrossingGraph[GraphData[{"Hadamard",{12,1}}],"CrossingNumber"->cn])//PolyhedralGraphQ

faces=ReverseSort@SymmetricallyDistinctFaces[g]

Tally[ReverseSort[Length/@faces]]

IGLayoutTutte[g,"OuterFace"->#]&/@faces

Union[Select[Table[RotateGraph[MinimalCrossingGraph[GraphData[{"Hadamard",{12,1}}],"CrossingNumber"->cn,RandomSeed->n]],{n,50}],Max[OuterFace[#]]<=GraphData[{"Hadamard",{12,1}},"V"]&]]//Timing

Table[MinimalCrossingGraph[GraphData[{"Hadamard",{12,1}}],"CrossingNumber"->cn,RandomSeed->i],{i,50}]//Union

v={};
g=Graph[Range[Length[v]],UndirectedEdge@@@{},VertexCoordinates->v,VertexLabels->Automatic]

RecognizeGraph[g]

RectilinearCrossingCount[g]

Circulant

GraphData[{"Hadamard",{12,1}},"Circulant"]

GraphData[{"Hadamard",{12,1}},"Graph","Circulant"]//StyleGraphs

Complement graph

GraphData[{"Hadamard",{12,1}},"ComplementGraph","Name"]

Line graph

GraphData[{"Hadamard",{12,1}},"Line"]

LineGraphQ[GraphData[{"Hadamard",{12,1}}]]//Timing

RootGraph

Select[GraphData[All],GraphData[#,"LineGraph","Name"]=== {"Hadamard",{12,1}}&]

RootGraph[GraphData[{"Hadamard",{12,1}}]]

Halin

GraphData[{"Hadamard",{12,1}},"Halin"]

GraphData[{"Hadamard",{12,1}},"Graph","Halin"]//StyleGraphs

Rigid

GraphData[{"Hadamard",{12,1}},"Rigid"]

GraphData[{"Hadamard",{12,1}},"Graph","Rigid"]//StyleGraphs

Flexible

GraphData[{"Hadamard",{12,1}},"Flexible"]

GraphData[{"Hadamard",{12,1}},"Graph","Flexible"]//StyleGraphs

LCF

GraphData[{"Hadamard",{12,1}},"LCF"]

GraphData[{"Hadamard",{12,1}},"HamiltonianCycleCount"]

GraphData[{"Hadamard",{12,1}},"LCFSignature"]

GraphData[{"Hadamard",{12,1}},"LCFNotations"]

GraphData[{"Hadamard",{12,1}},"Graph","LCF"]//StyleGraphs

Tally[LCFNotation[#][[2]]&/@%]

LCF compute random

FindRandomLCFNotation[GraphData[{"Hadamard",{12,1}}],TimeConstraint->120]

LCF compute 10^5

Tally[(lcf=LCF[GraphData[{"Hadamard",{12,1}}],10^5])[[All,2]]]//Timing

MaxMemoryUsed[]/10.^9 "GB"

DeleteCases[lcf,{_,1}]

LCFGraph@@@DeleteCases[lcf,{_,1}]//StyleGraphs

Tally[LCFNotation[#][[-1]]&/@(gs=NiceLCFGraphs[lcf,2])]//Timing

Length[gs]

gs

LCF compute 10^6

Tally[(lcf=LCF[GraphData[{"Hadamard",{12,1}}],10^6])[[All,2]]]//Timing

MaxMemoryUsed[]/10.^9 "GB"

DeleteCases[lcf,{_,1}]

LCFGraph@@@DeleteCases[lcf,{_,1}]//StyleGraphs

Tally[LCFNotation[#][[-1]]&/@(gs=NiceLCFGraphs[lcf,2])]//Timing

Length[gs]

gs

LCF compute 10^7

Tally[(lcf=LCF[GraphData[{"Hadamard",{12,1}}],10^7])[[All,2]]]//Timing

MaxMemoryUsed[]/10.^9 "GB"

DeleteCases[lcf,{_,1}]

LCFGraph@@@DeleteCases[lcf,{_,1}]//StyleGraphs

Tally[LCFNotation[#][[-1]]&/@(gs=NiceLCFGraphs[lcf,2])]//Timing

Length[gs]

gs

LCF compute all

Divisors[GraphData[{"Hadamard",{12,1}},"V"]]

Length[FindHamiltonianCycle[GraphData[{"Hadamard",{12,1}}],All][[All,All,1]]]//Timing

Tally[(lcf=LCF[GraphData[{"Hadamard",{12,1}}],All])[[All,2]]]//Timing

MaxMemoryUsed[]/10.^9 "GB"

Tally[(lcf=ReadProperty["LCFNotations",GraphNameToFileName[{"Hadamard",{12,1}},".m.gz"]])[[All,2]]]//Timing

DeleteCases[lcf,{_,1}]

LCFGraph@@@DeleteCases[lcf,{_,1}]//StyleGraphs

Tally[LCFNotation[#][[-1]]&/@(gs=NiceLCFGraphs[lcf,2,1])]//Timing

Length[gs]

gs

UnitDistance

GraphData[{"Hadamard",{12,1}},"UnitDistance"]

UnitDistanceGraphQ[GraphData[{"Hadamard",{12,1}}],Debug->True]//Timing

Select[%,!FreeQ[GraphEmbedding[#],_?InexactNumberQ]&]

UnitDistance by refinement

UnitDistanceEmbeddingRefine[Graph[GraphData[{"Hadamard",{12,1}},"VertexList"],GraphData[{"Hadamard",{12,1}},"EdgeList"]],MaxIterations->500]

UnitDistanceEmbeddingRefine[Annotate[#,VertexCoordinates->N[GraphEmbedding[#]]],MaxIterations->500]&/@Complement@@(GraphData[{"Hadamard",{12,1}},"Graph",#]&/@{"All","UnitDistance"})

UnitDistance by FindUnitDistanceEmbedding

FindUnitDistanceEmbedding[GraphData[{"Hadamard",{12,1}}],MaxIterations->5000,"ReturnWithMessage"->True]//Timing

FindUnitDistanceEmbedding[GraphData[{"Hadamard",{12,1}}],MaxIterations->5000,"ReturnWithMessage"->False]//Quiet//Timing

Matchstick

GraphData[{"Hadamard",{12,1}},"Matchstick"]

GraphData[{"Hadamard",{12,1}},"Graph","Matchstick"]//StyleGraphs

3D default

Graph3D[GraphData[{"Hadamard",{12,1}},"Edges"]]

3D All

GraphData[{"Hadamard",{12,1}},"Graph",{"3D","All"}]

3D UnitDistance

GraphData[{"Hadamard",{12,1}},"Graph",{"3D","UnitDistance"}]

3D Polyhedron

GraphData[{"Hadamard",{12,1}},"Polyhedral"]

GraphData[{"Hadamard",{12,1}},"Graph",{"3D","Polyhedron"}]

Check

had=Cases[GetGraphData[All],{"Hadamard",_}]

Select[had,!IntegerQ[GetGraphData[#,"M"]/GetGraphData[#,"V"]]&]

These seem wrong

Graph[{"Hadamard",16}]

HadamardGraph[Hadamard[16][[1]]]

RecognizeGraph[%]

IntersectionArray[Graph[{"Hadamard",4}]]

IntersectionArray[Graph[{"Hadamard",8}]]

IntersectionArray[HadamardGraph[Hadamard[16][[1]]]]//Quiet

IntersectionArray[Graph[{"Hadamard",16}]]

GetGraphData[{"Hadamard",8},"File"]

Graphics

GraphicsGrid[{Show[GraphData[#],PlotLabel->H[V[Graph[#]]/4]]&/@SortBy[GraphData["Hadamard",1;;32],GraphData[#,"V"]&]},ImageSize->500]

Construction

distanceregular.org (32)

g=DistanceRegularGraph["http://www.distanceregular.org/graphdata/hadamard32.am"]

RecognizeGraph[g]

GraphData[{"Hadamard",{8,1}},"Name"]

GraphData[{"Hadamard",{8,1}},"DistanceTransitive"]

VertexCount[g]

GraphDiameter[g]//Timing

RegularParameters[g]//Timing

DistanceRegularGraphQ[g]//Timing

IntersectionArray[g]//Timing

IntegerSpectrum[g]//SpectrumForm

GroupOrder[GraphAutomorphismGroup[g]]

HamiltonianGraphQ[g]

distanceregular.org (48)

g=DistanceRegularGraph["http://www.distanceregular.org/graphdata/hadamard48.am"]

RecognizeGraph[g]

GraphData[{"Hadamard",{12,1}},"DistanceTransitive"]

VertexCount[g]

GraphDiameter[g]//Timing

RegularParameters[g]//Timing

DistanceRegularGraphQ[g]//Timing

IntersectionArray[g]//Timing

IntegerSpectrum[g]//SpectrumForm

GroupOrder[GraphAutomorphismGroup[g]]

HamiltonianGraphQ[g]

From scratch

<<ExtraPackages`Hadamard`

HadamardQ[m_List?MatrixQ]:=Module[{n=Length[m]},m.Transpose[m]==n IdentityMatrix[n]]

PaleyHadamard[n_]:=PadLeft[Array[JacobiSymbol[#2 - #1, n - 1] &, {n, n} - 1] -IdentityMatrix[n - 1], {n, n}, 1]

HadamardGraph[1]:=HadamardGraph[{{1}}]
HadamardGraph[2]:=HadamardGraph[{{1,1},{1,-1}}]
HadamardGraph[n_Integer]:=HadamardGraph[PaleyHadamard[n]]

HadamardGraph[h_List?MatrixQ]:=Module[{i,j,e,v,r,c},
v=Union[
Flatten[
e=Flatten[Join[
{{{r[#1],1,1},{c[#2],1,2}},{{r[#1],-1,1},{c[#2],-1,2}}}&@@@Position[h,1],
{{{r[#1],-1,1},{c[#2],1,2}},{{r[#1],1,1},{c[#2],-1,2}}}&@@@Position[h,-1]
],
1],
1]
];
FromUnorderedPairs[e/.Thread[v->Range[Length[v]]]]
]

Inefficient Code

HadamardGraphSlow[n_Integer]:=HadamardGraphSlow[PaleyHadamard[n]]
HadamardGraphSlow[h_List?MatrixQ]:=Module[{i,j,e,v,r,c},v=Union@Flatten[e=Flatten[Table[If[h[[i,j]]==1,{{r[i,1],c[j,1]},{r[i,-1],c[j,-1]}},
{{r[i,1],c[j,-1]},{r[i,-1],c[j,1]}}],{i,Length[h]},{j,Length[h]}],2]];
FromUnorderedPairs[e/.Thread[v->Range[Length[v]]]]
]

HadamardGraphSlower[n_Integer]:=HadamardGraphSlower[PaleyHadamard[n]]
HadamardGraphSlower[h_List?MatrixQ]:=Module[{i,j,e,v},
v=Union[
Flatten[
e=Flatten[
MapIndexed[If[#1===1,
{{{#2[[1]],1,1},{#2[[2]],1,2}},{{#2[[1]],-1,1},{#2[[2]],-1,2}}},
{{{#2[[1]],-1,1},{#2[[2]],1,2}},{{#2[[1]],1,1},{#2[[2]],-1,2}}}]&,h,{2}],
2],
1]
];
FromUnorderedPairs[e/.Thread[v->Range[Length[v]]]]
]

Algorithm Check

RecognizeGraph/@HadamardGraph/@Join[{{{1}},{{1,1},{1,-1}}},Range[4,91,4]]//Timing

RecognizeGraph/@HadamardGraphSlow/@Join[{{{1}},{{1,1},{1,-1}}},Range[4,91,4]]//Timing

RecognizeGraph/@HadamardGraphSlower/@Join[{{{1}},{{1,1},{1,-1}}},Range[4,91,4]]//Timing

(Subscript[H, 1])

h=Hadamard[1]

HadamardGraph[h]//RecognizeGraph

(Subscript[H, 2])

h=Hadamard[2]

HadamardGraph[h]

HadamardGraph2[h]

HadamardGraph[h]//RecognizeGraph

HadamardGraph[h]//ShowGraph

(Subscript[H, 4])

h=Hadamard[4][[1]]//Quiet

FastIsomorphicQ[HadamardGraph[h],HadamardGraphSlow[h]]

RecognizeGraph[HadamardGraph[#]]&/@Hadamard[4]//Quiet

HadamardGraph[4]//RecognizeGraph

(Subscript[H, 8])

FastIsomorphicQ@@(HadamardGraph/@Hadamard[8]//Quiet)

(Subscript[H, 12])

h=Hadamard[12][[1]]//Quiet;

FastIsomorphicQ[HadamardGraph[h],HadamardGraphSlow[h]]

FastIsomorphicQ@@(HadamardGraph/@Hadamard[12]//Quiet)

FastIsomorphicQ@@(HadamardGraph/@Append[Hadamard[12],PaleyHadamard[12]])

(Subscript[H, 16])

FastIsomorphicQ@@(HadamardGraph/@Append[Hadamard[16],PaleyHadamard[16]])

GraphData

GraphClassString

GraphClassString[GraphData["Hadamard"]]

GraphDataString (Paley)

nonpaley={92,116,156,172,184,188,232,236,260,268,292,324,356,372,376,404,412,428,436,452,472,476,508,520,532,536,584,596,604,612,652,668,712,716,732,756,764,772,808,836,852,856,872,876,892,904,932,940,944,952,956,964,980,988,996};

Complement[Range[8,512,4],nonpaley]

file=OpenAppend["had.m"]

WriteString[file,GraphDataString[HadamardGraph[#],
"StandardName"->{"Hadamard",#},
"Name"->ToString[#]<>"-Hadamard graph",
"NotationRules"->{"DistanceRegular"->{{#,#-1,#/2,1},{1,#/2,#-1,#}},"Hadamard"->#},
"Classes"->{"DistanceRegular","Hadamard"},
"Information"->"HadamardGraph",
"Vertices"->None,
TimeConstraint->10,
Debug->True
]]&/@Complement[Range[8,256,4],nonpaley];

WriteString[file,GraphDataString[HadamardGraph[#],
"StandardName"->{"Hadamard",#},
"Name"->ToString[#]<>"-Hadamard graph",
"NotationRules"->{"DistanceRegular"->{{#,#-1,#/2,1},{1,#/2,#-1,#}},"Hadamard"->#},
"Classes"->{"DistanceRegular","Hadamard"},
"Information"->"HadamardGraph",
"Vertices"->None,
TimeConstraint->10,
Debug->True
]]&/@Complement[Range[196,256,4],nonpaley];

Close[file]

GraphDataString (Nonpaley)

ImportFromSloane[s_]:=Select[Characters/@StringSplit[
Import["http://www.research.att.com/~njas/hadamard/had."<>s<>".txt","Text"],"\n"
]/.{"+"->1,"-"->-1,"0"->1,"1"->-1},(Union[Abs[#]]==={1}&)]

H[n:(92|116|156|172)]:=ImportFromSloane[ToString[n]<>".will"]
H[n:(184|232)]:=ImportFromSloane[ToString[n]<>".twill"]
H[n:(188)]:=ImportFromSloane[ToString[n]<>".tur"]
H[n:(236)]:=ImportFromSloane[ToString[n]<>".od"]
H[428]:=ReadList[StringToStream[Import["http://www.research.att.com/~njas/hadamard/had.428.txt","Text"]],Table[Number,{428}]]

sloane=Select[{92,116,156,172,184,188,232,236,428},#≤256&]

Complement[sloane,nonpaley]

HadamardQ/@H/@sloane

Graphs from inequivalent Hadamard matrices are nonisomorphic

16

Length[m=Join[ImportFromSloane["16."<>#]&/@{"0","1","2","3","4","hed","syl"(*,"twin"*)},Hadamard[16]]]

HadamardQ/@m

Length/@m

gs=HadamardGraph/@m

FastIsomorphicSets[gs]

file=OpenWrite["~/had.m"]

Length[m=ImportFromSloane["16."<>#]&/@{"0","1","2","3"}]

RecognizeGraph[HadamardGraph[m[[-1]]]]

RecognizeGraph[Graph[{"Hadamard",{16,4}}]]

Do[WriteString[file,GraphDataString[g=HadamardGraph[m[[i]]],
"StandardName"->{"Hadamard",{n=Length[m[[i]]],i}},
"Name"->"("<>ToString[n]<>","<>ToString[i]<>")-Hadamard graph",
"NotationRules"->{"DistanceRegular"->{{n,n-1,n/2,1},{1,n/2,n-1,n}},"Hadamard"->n},
"Classes"->{"DistanceRegular","Hadamard"},
"Information"->"HadamardGraph",
TimeConstraint->60,
Debug->True
]],{i,4}]

Close[file]

20

Length[m=Join[ImportFromSloane["20."<>#]&/@{"1","2","3"}]]

HadamardQ/@m

Length/@m

gs=HadamardGraph/@m

FastIsomorphicSets[gs]

file=OpenWrite["~/had.m"]

Do[WriteString[file,GraphDataString[g=HadamardGraph[m[[i]]],
"StandardName"->{"Hadamard",{n=Length[m[[i]]],i}},
"Name"->"("<>ToString[n]<>","<>ToString[i]<>")-Hadamard graph",
"NotationRules"->{"DistanceRegular"->{{n,n-1,n/2,1},{1,n/2,n-1,n}},"Hadamard"->{n,i}},
"Classes"->{"DistanceRegular","Hadamard"},
"Information"->"HadamardGraph",
TimeConstraint->60,
Debug->True
]],{i,3}]

Close[file]

24

Length[m=ImportFromSloane["24."<>ToString[#]]&/@Range[60]]

And@@HadamardQ/@m

Union[Length/@m]

gs=HadamardGraph/@m

FastIsomorphicSets[gs]

um=Sort[First/@%]

Length[um]

Print[{#,CanonicalForm[HadamardGraph[m[[um[[#]]]]]]}]&/@Range[25,36]

file=OpenAppend["~/had.m"]

Do[WriteString[file,GraphDataString[g=HadamardGraph[m[[um[[i]]]]],
"StandardName"->{"Hadamard",{n=Length[m[[1,1]]],i}},
"Name"->"("<>ToString[n]<>","<>ToString[i]<>")-Hadamard graph",
"NotationRules"->{"DistanceRegular"->{{n,n-1,n/2,1},{1,n/2,n-1,n}},"Hadamard"->{n,i}},
"Classes"->{"DistanceRegular","Hadamard"},
"Information"->"HadamardGraph",
TimeConstraint->60,
Debug->True
]],{i,Length[um]}]

Do[WriteString[file,GraphDataString[g=HadamardGraph[m[[um[[i]]]]],
"StandardName"->{"Hadamard",{n=Length[m[[1,1]]],i}},
"Name"->"("<>ToString[n]<>","<>ToString[i]<>")-Hadamard graph",
"NotationRules"->{"DistanceRegular"->{{n,n-1,n/2,1},{1,n/2,n-1,n}},"Hadamard"->{n,i}},
"Classes"->{"DistanceRegular","Hadamard"},
"Information"->"HadamardGraph",
"Skip"->{"ComplementGraph"},
TimeConstraint->60,
Debug->True
]],{i,24,Length[um]}]

Close[file]

28

Length[m=ImportFromSloane["28."<>ToString[#]]&/@Range[487]]

And@@(HadamardQ/@m)

Union[Length/@m]

gs=HadamardGraph/@m;//Timing

FastIsomorphicSets[gs]

um=Sort[First/@%]

Length[um]

Original

file=OpenWrite["had2.m"]

WriteString[file,GraphDataString[HadamardGraph[H[#]],
"StandardName"->{"Hadamard",#},
"Name"->ToString[#]<>"-Hadamard graph",
"NotationRules"->{"DistanceRegular"->{{#,#-1,#/2,1},{1,#/2,#-1,#}},"Hadamard"->#},
"Classes"->{"DistanceRegular","Hadamard"},
"Information"->"HadamardGraph",
TimeConstraint->10,
Debug->True
]]&/@sloane;