Message Boards Message Boards

[WSS22] Tic-Tac-Toe: a quantum probabilistic approach

POSTED BY: Akhilesh Dubey
2 Replies

I'm just waiting for the final verdict, the multi-way graph representations of the classical & quantum Tic-Tac-Toe games.

gate = "";
rChoice := With[
  {tempGate = 
    RandomChoice[{"XRotation", "YRotation", "ZRotation", "CNOT"}]},
  gate = tempGate;
  If[gate == "CNOT",
   Module[{ctrl, trg},
    ctrl = RandomChoice[Range[4]];
    trg = RandomChoice@Complement[Range[4], {ctrl}];
    QuantumOperator["CNOT", {ctrl, trg}]],
   QuantumOperator[
    {gate, RandomReal[{0, 2 \[Pi]}]},
    {RandomChoice[Range[4]]}
    ]]]
qc42 = QuantumCircuitOperator[Table[rChoice, {i, 42}]]
qc42["Diagram",
 FontSize -> 6,
 ImageSize -> 1270
 ]
MatrixPlot[
 qc42[g0]["MatrixRepresentation"],
 Mesh -> All,
 PlotTheme -> "Detailed",
 ColorFunction -> "TemperatureMap",
 Epilog -> Inset[gate, {Left, Top}, {-1.5, 1}]
 ]
Show[
 QuantumMeasurementOperator[][qc42[g0]]["ProbabilityPlot"],
 ImageSize -> 203
 ]

Quantum Circuit Operator

Quantum Circuit

Matrix Plot CNOT

Probability Plot Quantum Measurement Operator

I'm sorry..but all these random choices of gates, angles, and orders to create a circuit and then apply it to the initial state gets me begging for larger dimensions and developing a game app.

randomGate3 := With[
  {gate = RandomChoice[{"XRotation", "YRotation", "CNOT"}]},
  If[gate == "CNOT",
   Module[
    {ctrl, trg},
    ctrl = RandomChoice[Range[4]];
    trg = RandomChoice@Complement[Range[4], {ctrl}];
    If[ctrl < trg,
     QuantumOperator["CNOT", {ctrl, trg}],
     QuantumOperator["CNOT", {trg, ctrl}]
     ]],
   QuantumOperator[{gate, 
     RandomReal[{0, 2 \[Pi]}]}, {RandomChoice[Range[4]]}]
   ]]
qc3 = QuantumCircuitOperator[Table[randomGate3, {i, 20}]];
qc3["Diagram", FontSize -> 8]
altgen = qc3[g0]
altgenm = QuantumMeasurementOperator[][altgen];
altgenm["Probabilities"]
CircuitMultiwayGraph[qc3]
Rotate[VertexReplace[CircuitMultiwayGraph[qc3, "George Cooks Fries"], 
  PerformanceGoal -> "Size", ImageSize -> 400], -\[Pi]/2]

Random Gate 3

altgen qc3 g0

altgenm Probabilities

CircuitMultiwayGraphqc3

Rotate VertexReplace CircuitMultiwayGraph

Instead of UpValue Hell, @Akhilesh Dubey hey is it necessary to open up the quantum Tic-Tac-Toe & Wolfram Language functions used in the project big or small?

randomGate3 := 
 With[{gate = RandomChoice[{"XRotation", "YRotation", "CNOT"}]}, 
  If[gate == "CNOT", 
   Module[{ctrl, trg}, ctrl = RandomChoice[Range[4]]; 
    trg = RandomChoice@Complement[Range[4], {ctrl}]; 
    If[ctrl < trg, QuantumOperator["CNOT", {ctrl, trg}], 
     QuantumOperator["CNOT", {trg, ctrl}]]], 
   QuantumOperator[{gate, 
     RandomReal[{0, 2 \[Pi]}]}, {RandomChoice[Range[4]]}]]]
qc3 = QuantumCircuitOperator[Table[randomGate3, {i, 20}]];
qc3["Diagram", FontSize -> 8]
altgen = qc3[g0]
altgenm = QuantumMeasurementOperator[][altgen];
altgenm["Probabilities"]
ticTacToe3 = 
 CircuitMultiwayGraph[qc3, Table[N@QuantumState["Plus"], 4]]
Rotate[VertexReplace[
  CircuitMultiwayGraph[qc3, "Betsy Eats Apple Dumpling"], 
  PerformanceGoal -> "Size", ImageSize -> 400], -\[Pi]/2]

randomGate3 -= With of 1

altgen = qc3 of g0 1

@Akhilesh Dubey These Quantum Gates keep me coming back for more and more, isn't that wild?

altgenm Probabilities 1

ticTacToe3 = CircuitMultiwayGraph qc3

Rotate VertexReplaceCircuitMultiwayGraph qc3

Thanks to people like you Akhilesh, I couldn't believe it when you and your article were aggregated. This is like the combinatory calculus, and I know this gets romanticized because like the typed hypergraphs it's happening.

qccm = QuantumMeasurementOperator[][qcs];
Properties[qccm]
qccm["ProbabilityPlot"]
ResourceFunction[
ResourceObject[<|
   "Name" -> "TTTGraph", "UUID" -> 
    "9d201d30-f5b4-480f-afcd-3a8d99a6dce8", "ResourceType" -> 
    "Function", "ResourceLocations" -> {
CloudObject[
      "https://www.wolframcloud.com/obj/wolframphysics/Resources/9d2/\
9d201d30-f5b4-480f-afcd-3a8d99a6dce8"]}, "Version" -> None, 
    "DocumentationLink" -> 
    URL["https://www.wolframcloud.com/obj/wolframphysics/\
MultiwayGames/TTTGraph"], "ExampleNotebookData" -> Automatic, 
    "FunctionLocation" -> 
    CloudObject[
     "https://www.wolframcloud.com/obj/wolframphysics/Resources/9d2/\
9d201d30-f5b4-480f-afcd-3a8d99a6dce8/download/DefinitionData"], 
    "ShortName" -> "TTTGraph", "SymbolName" -> 
    "FunctionRepository`$9d201d30f5b4480fafcd3a8d99a6dce8`TTTGraph"|>]\
][2, {{{{0, 0}, {1, 0}}, 0}}, AspectRatio -> 1, VertexSize -> 1]

For each qubit your post is the search engine that measures the aggregate probabilities and visualizes the game through a multi-way graph.

Properties qccm

@Akhilesh Dubey if it's your quantum superposition, your @Akhilesh Dubey entanglement with the aid of qutrits and quantum gates, then...check out this Automated Theorem Proving & Axiomatic Mathematics by @Jonathan Gorard.

qccm ProbabilityPlot

TTTGraph

Even though the non-deterministic measurement process is in a slump since time immemorial, you could chance upon the legalized moves and winning criteria of the set of quantum gates to apply to the qubits, and make some headway on the secret tips and tricks of our local surroundings that only a local would know.

POSTED BY: Dean Gladish

enter image description here -- you have earned Featured Contributor Badge enter image description here Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

POSTED BY: EDITORIAL BOARD
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract