Research Goals

◼
  • 1. Create Wolfram Multiway Diagrams from the Pythagorean Theorem Triples and relate NestGraph[Replace..]
  • ◼
  • 2. Relate Barning Matrices to Multiway Diagram NestGraph[Replace[..] functions.
  • Research Summary

    My mentor Nik Murzin provided how whole number Pythagorean Triples, such as {3, 4, 5} corresponding to
    2
    3
    +
    2
    4
    =
    2
    5
    and beyond, can generate Multiway Diagrams.
    Mathematicians have generated Multiway Diagrams of Pythagorean Triples. Seeing special matrices generate Multiway Diagrams and how they were equivalent to the NestGraph[Replace..] function below, was exiting.
    In[]:=
    NestGraph[Replace[{a_,b_,c_}:>​​{{-a+2b+2c,-2a+b+2c,-2a+2b+3c},{a-2b+2c,2a-b+2c,2a-2b+3c},{a+2b+2c,2a+b+2c,2a+2b+3c}}],{{3,4,5}},2,VertexLabels->Automatic]
    Out[]=
    The tree above is for the NestGraph[Replace..] evolution count 2. It is shown below the {{3,4,5}}) initial state which represents the starting 0 count first single triplet state. This is followed by 3 triplet lines starting with {5, 12, 13} for count 1, followed by 9 triplets lines below for count 2. All are connected by directed arrows, where each triplet state is split into three new triplet states. As the count values increase, these Pythagorean triplet multiway diagrams keep generating triplet states. This is a beautiful example of how simple mathematical geometric rules, known more than 1000 years before Pythagoras and in many regions of the world such as India and China, correspond to a basic multiway diagram.
    ​
    In the three NestGraph[Replace..] commands above there are three expressions of the form {{-a+2 b+2 c,-2 a+b+2 c,-2 a+2 b+3 c}, { ... },{ ... }} which are doing all the work. The next step was to investigate how the functions within NestGraph[Replace..] are:
    1. Creating these Pythagorean triplets, and
    2. Creating the triplet tree arrow structure of the multiway diagram.
    Again, Nik came to the rescue by introducing the mathematical references which include matrices that generate the sideway Berggren tree Pythagorean triple multiway diagrams shown below:
    https://en.wikipedia.org/wiki/Tree_of_primitive_Pythagorean_triples
    On the left is Berggren's tree of primitive Pythagorean triples . A tree of primitive Pythagorean triples is a mathematical tree in which each node represents a primitive Pythagorean triple which continues to branch out. Price’s alternate tree is on the right. Care is required when going from one matrix to a specific tree. These trees expand without end.
    Barning showed that when any of the three matrices below are multiplied with a primitive Pythagorean triplet column, a new Pythagorean triplet is formed. It is also remarkable that from Pythagorean geometry alone such relationships could be found. It is necessary to move from one triples diagram to another when generating a new triplet value from a Matrix. It can be shown that matrix A below times row
    3
    4
    5
    generates
    5
    12
    13
    which can be verified in the Pythagorean triples diagram above. Similarly, multiplying matrix A by
    5
    12
    13
    =
    7
    24
    25
    , A by
    7
    24
    25
    =
    9
    40
    41
    , and A by
    9
    40
    41
    =
    11
    60
    61
    . The 3 matrices A, B, and C are shown below.
    Below, we relate the original NestGraph[Replace...] function contents with the matrices above which were both introduced by Nik.
    Each term in the 3 equations in the NestGraph[Replace..] equation above is shown below:
    {-a+2 b+2 c, -2 a+b+2c, -2a+2b+3 c},
    { a-2 b+2 c, 2a-b+2c, 2a-2 b+3 c},
    {a+2 b+2 c, 2a+b+2c, 2a+2 b+3 c}
    Reformatting the above equations by setting a, b, and c to their initial count value of 1 , and using the “+“ signs , the “-“ signs, the commas, and the “},” as delimiters, we see that these are just the Barning matrices above.
    Below are the references for Pythagorean triples research:
    ◼
  • https://en.wikipedia.org/wiki/Tree_of_primitive_Pythagorean_triples_Barning,_F_._J_._M_._(1963),_%22Over_pythagorese_en_bijna-pythagorese_/_driehoeken_en_een_generatieproces_met_behulp_van_unimodulaire_/_matrices%22_(in_Dutch),_Math_._Centrum_Amsterdam_Afd_._Zuivere_Wisk_.
  • ◼
  • Price, H.Lee (2008).”The Pythagorean Tree: A New Species”.arXiv:0809.4324[math.HO].
  • Takeaways and What’s Next

    Key Takeaway

    ◼
  • It was satisfying to see that Pythagorean triplet Multiway Diagrams could be generated both with pure matrices as well as with the equivalent NestGraph[Replace..] methodology.
  • ◼
  • Below is a very comprehensive review link related to Pythagorean triplets: https://r-knott.surrey.ac.uk/pythag/pythag.html#section1.6
  • Future Plans and Next Steps

    ◼
  • I hope to continue with my study of physics and Wolfram Multiway diagrams, as well as the geometry and methodologies at the base of Pythagorean triplets.
  • ◼
  • A new Discord community dedicated to optics has been set up by ThorLabs. This will be helpful in the continuation of my work toward creating the physical correlates of Wolfram Multiway Diagrams in the lab.
  • Appreciations

    ◼
  • Special appreciation to Nik Murzin for his patience with my mathematical abilities. Also special appreciation to Xerxes Arsiwalla for his continued support over the years.
  • ◼
  • It is a real honor to have had the chance to continue to attend the Wolfram Schools. What Stephen Wolfram is doing for the world is wonderful.
  • ◼
  • Special appreciation to Takashi Yoneyama who suggested that I continue studying physics, and to Patricia, my lab manager.
  • New Extension Code for Continuous Values AND Normalization by Max P and Nik M on Jonathan G' s QuantumToMultiway :
    ClearAll[QuantumToMultiwaySystem]
    Needs["GeneralUtilities`"];​​​​QuantumToMultiwaySystem[<|"Operator"->operator_List,"Basis"->basis_List|>,initialConditions_List,stepCount_Integer,rest___]:=​​Module[{rules,newInitialConditions},rules=QuantumToMultiwaySystem[<|"Operator"->operator,"Basis"->basis|>];​​newInitialConditions=NormalizeWaveFunction/@initialConditions;​​ResourceFunction["MultiwaySystem"][rules,ToString/@newInitialConditions,stepCount,rest]]/;(Depth[initialConditions]==​​3&&AllTrue[(((Counts[#][1]==1||Counts[#][-1]==1||Counts[#][I]==1||Counts[#][-I]==1)===True)&&(Counts[#][0]==Length[#]-1)===True)​​&/@initialConditions,#===True&])​​​​QuantumToMultiwaySystem[<|"Operator"->operator_List,"Basis"->basis_List|>,initialCondition_List,stepCount_Integer,rest___]:=​​QuantumToMultiwaySystem[<|"Operator"->operator,"Basis"->basis|>,{initialCondition},stepCount,rest]/;(Depth[initialCondition]==​​2&&AllTrue[(((Counts[#][1]==1||Counts[#][-1]==1||Counts[#][I]==1||Counts[#][-I]==1)===True)&&(Counts[#][0]==Length[#]-1)===True)​​&/@{initialCondition},#===True&])​​​​NormalizeWaveFunction[waveFunction_List]:=Module[{norm},norm=Norm[waveFunction];​​If[norm!=0,waveFunction/norm,waveFunction]]​​​​QuantumToMultiwaySystem[operator_List, initialConditions_List, stepCount_Integer, rest___] := ​​ QuantumToMultiwaySystem[<|"Operator" -> operator, "Basis" -> IdentityMatrix[Length[operator]]|>, initialConditions, ​​ stepCount, rest] /; (Depth[operator] == 3 && Depth[initialConditions] == 3 && ​​ AllTrue[(((Counts[#][1] == 1 || Counts[#][-1] == 1 || Counts[#][I] == 1 || Counts[#][-I] == 1) === ​​ True) && (Counts[#][0] == Length[#] - 1) === True) & /@ initialConditions, # === True &])​​QuantumToMultiwaySystem[operator_List, initialCondition_List, stepCount_Integer, rest___] := ​​ QuantumToMultiwaySystem[<|"Operator" -> operator, "Basis" -> IdentityMatrix[Length[operator]]|>, initialCondition, ​​ stepCount, rest] /; (Depth[operator] == 3 && Depth[initialCondition] == 2 && ​​ AllTrue[(((Counts[#][1] == 1 || Counts[#][-1] == 1 || Counts[#][I] == 1 || Counts[#][-I] == 1) === ​​ True) && (Counts[#][0] == Length[#] - 1) === True) & /@ {initialCondition}, # === True &])​​​​QuantumToMultiwaySystem[<|"Operator" -> operator_List, "Basis" -> basis_List|> -> eventSelectionFunction_, ​​ initialConditions_List, stepCount_Integer, rest___] := Module[{rules},​​ rules = QuantumToMultiwaySystem[<|"Operator" -> operator, "Basis" -> basis|>];​​ ResourceFunction["MultiwaySystem"][rules -> eventSelectionFunction, ToString /@ initialConditions, stepCount, ​​ rest]] /; (Depth[initialConditions] == 3 && ​​ AllTrue[(((Counts[#][1] == 1 || Counts[#][-1] == 1 || Counts[#][I] == 1 || Counts[#][-I] == 1) === ​​ True) && (Counts[#][0] == Length[#] - 1) === True) & /@ initialConditions, # === True &])​​QuantumToMultiwaySystem[<|"Operator" -> operator_List, "Basis" -> basis_List|> -> eventSelectionFunction_, ​​ initialCondition_List, stepCount_Integer, rest___] := ​​ QuantumToMultiwaySystem[<|"Operator" -> operator, "Basis" -> basis|> -> eventSelectionFunction, {initialCondition}, ​​ stepCount, rest] /; (Depth[initialCondition] == 2 && ​​ AllTrue[(((Counts[#][1] == 1 || Counts[#][-1] == 1 || Counts[#][I] == 1 || Counts[#][-I] == 1) === ​​ True) && (Counts[#][0] == Length[#] - 1) === True) & /@ {initialCondition}, # === True &])
    QuantumToMultiwaySystem[operator_List -> eventSelectionFunction_, initialConditions_List, stepCount_Integer, rest___] :=​​ QuantumToMultiwaySystem[<|"Operator" -> operator, "Basis" -> IdentityMatrix[Length[operator]]|> -> ​​ eventSelectionFunction, initialConditions, stepCount, ​​ rest] /; (Depth[operator] == 3 && Depth[initialConditions] == 3 && ​​ AllTrue[(((Counts[#][1] == 1 || Counts[#][-1] == 1 || Counts[#][I] == 1 || Counts[#][-I] == 1) === ​​ True) && (Counts[#][0] == Length[#] - 1) === True) & /@ initialConditions, # === True &])​​QuantumToMultiwaySystem[operator_List -> eventSelectionFunction_, initialCondition_List, stepCount_Integer, rest___] := ​​ QuantumToMultiwaySystem[<|"Operator" -> operator, "Basis" -> IdentityMatrix[Length[operator]]|> -> ​​ eventSelectionFunction, initialCondition, stepCount, ​​ rest] /; (Depth[operator] == 3 && Depth[initialCondition] == 2 && ​​ AllTrue[(((Counts[#][1] == 1 || Counts[#][-1] == 1 || Counts[#][I] == 1 || Counts[#][-I] == 1) === ​​ True) && (Counts[#][0] == Length[#] - 1) === True) & /@ {initialCondition}, # === True &])

    CITE THIS NOTEBOOK

    Wolfram multiway diagrams from Pythagorean triples​
    by Mark Merner​
    Wolfram Community, STAFF PICKS, January 15, 2026
    ​https://community.wolfram.com/groups/-/m/t/3607049