using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using MathNet.Numerics.LinearAlgebra; using TAlex.MathCore.SpecialFunctions; namespace ManyWorldsTheory { class ColourapproximationQuantumTheory { //Farbvectors of the normal Particles public Vector3D.Vector r = new Vector3D.Vector(1, 0, 0); //r = red public Vector3D.Vector g = new Vector3D.Vector(0, 1, 0); //g = green public Vector3D.Vector b = new Vector3D.Vector(0, 0, 1); //b = blue //Farbvectors of the Anti-Particles public Vector3D.Vector c = new Vector3D.Vector(1, 0, 0); //c = cyan public Vector3D.Vector m = new Vector3D.Vector(0, 1, 0); //m = magenta public Vector3D.Vector y = new Vector3D.Vector(0, 0, 1); //y = yellow TAlex.MathCore.LinearAlgebra.CMatrix redVector3DCharge, blueVector3DCharge, greenVector3DCharge, cyanVector3DCharge, magentaVector3DCharge, yellowVector3DCharge, nullVector3DCharge; //Definition of the 8 starken Charges public TAlex.MathCore.LinearAlgebra.CMatrix λ1 = new TAlex.MathCore.LinearAlgebra.CMatrix(new double[3, 3] { {0, 1, 0 }, {1, 0, 0 }, {0, 0, 0 } }); public TAlex.MathCore.LinearAlgebra.CMatrix λ2 = new TAlex.MathCore.LinearAlgebra.CMatrix(new double[3, 3] { {0, (double) TAlex.MathCore.Complex.Pow(TAlex.MathCore.Complex.One,2), 0 }, {System.Numerics.Complex.ImaginaryOne.Imaginary, 0, 0 }, {0, 0, 0 } }); public TAlex.MathCore.LinearAlgebra.CMatrix λ3 = new TAlex.MathCore.LinearAlgebra.CMatrix(new double[3, 3] { {1, 0, 0 }, {0, -1, 0 }, {0, 0, 0 } }); public TAlex.MathCore.LinearAlgebra.CMatrix λ4 = new TAlex.MathCore.LinearAlgebra.CMatrix(new double[3, 3] { {0, 0, 1 }, {0, 0, 0 }, {1, 0, 0 } }); public TAlex.MathCore.LinearAlgebra.CMatrix λ5 = new TAlex.MathCore.LinearAlgebra.CMatrix(new double[3, 3] { {0, (double) TAlex.MathCore.Complex.Pow(TAlex.MathCore.Complex.One,2), 1 }, {0, 0, 0 }, {(double) TAlex.MathCore.Complex.Pow(TAlex.MathCore.Complex.One,2), 0, 0 } }); public TAlex.MathCore.LinearAlgebra.CMatrix λ6 = new TAlex.MathCore.LinearAlgebra.CMatrix(new double[3, 3] { {0, 0, 0 }, {0, 0, 1 }, {0, 1, 0 } }); public TAlex.MathCore.LinearAlgebra.CMatrix λ7 = new TAlex.MathCore.LinearAlgebra.CMatrix(new double[3, 3] { {0, 0, 1 }, {0, 0,(double) TAlex.MathCore.Complex.Pow(TAlex.MathCore.Complex.One,2) }, {0, (double) TAlex.MathCore.Complex.Pow(TAlex.MathCore.Complex.One,2), 0 } }); public TAlex.MathCore.LinearAlgebra.CMatrix λ8 = new TAlex.MathCore.LinearAlgebra.CMatrix(new double[3, 3] { {1, 0, 0 }, {0, 1, 0 }, {0, 0, -2} }); //Definition of the fixed colour vectors in 3D-Space public TAlex.MathCore.LinearAlgebra.CMatrix red; public TAlex.MathCore.LinearAlgebra.CMatrix green; public TAlex.MathCore.LinearAlgebra.CMatrix blue; public TAlex.MathCore.LinearAlgebra.CMatrix cyan; public TAlex.MathCore.LinearAlgebra.CMatrix yellow; public TAlex.MathCore.LinearAlgebra.CMatrix magenta; // = get Trace of an Complex Matrix public bool getTrace(TAlex.MathCore.LinearAlgebra.CMatrix t1) { return TAlex.MathCore.LinearAlgebra.CMatrix.Trace(t1).IsZero; } public bool isWithoutTrace() { if ((getTrace(λ1) == true) && (getTrace(λ2) == true) && (getTrace(λ3) == true) && (getTrace(λ4) == true) && (getTrace(λ5) == true) && (getTrace(λ6) == true) && (getTrace(λ7) == true) && (getTrace(λ8) == true)) { return true; } return false; } public bool isOrthogonalMatrix() { if((λ3.IsDiagonal == λ8.IsDiagonal) == true && λ1.IsUnitary() && λ2.IsUnitary() && λ3.IsUnitary() && λ4.IsUnitary() && λ5.IsUnitary() && λ6.IsUnitary() && λ7.IsUnitary() && λ8.IsUnitary()) { if ((TAlex.MathCore.LinearAlgebra.CMatrix.FrobeniusNorm(λ1) != 0 && λ1.IsOrthogonal()) && (TAlex.MathCore.LinearAlgebra.CMatrix.FrobeniusNorm(λ2) != 0 && λ2.IsOrthogonal()) && (TAlex.MathCore.LinearAlgebra.CMatrix.FrobeniusNorm(λ3) != 0 && λ3.IsOrthogonal()) && (TAlex.MathCore.LinearAlgebra.CMatrix.FrobeniusNorm(λ4) != 0 && λ4.IsOrthogonal()) && (TAlex.MathCore.LinearAlgebra.CMatrix.FrobeniusNorm(λ5) != 0 && λ5.IsOrthogonal()) && (TAlex.MathCore.LinearAlgebra.CMatrix.FrobeniusNorm(λ6) != 0 && λ6.IsOrthogonal()) && (TAlex.MathCore.LinearAlgebra.CMatrix.FrobeniusNorm(λ7) != 0 && λ7.IsOrthogonal()) && (TAlex.MathCore.LinearAlgebra.CMatrix.FrobeniusNorm(λ8) != 0 && λ8.IsOrthogonal())) return true; } return false; } //How to get an Lie-algebra out of two chosen Matrices //Sources: https://en.wikipedia.org/wiki/Lie_algebra under the Section: "Examples" and "Three dimensions" public TAlex.MathCore.LinearAlgebra.CMatrix getLieAlgebralementTriplet(int Dimension,TAlex.MathCore.LinearAlgebra.CMatrix t1, TAlex.MathCore.LinearAlgebra.CMatrix t2) { TAlex.MathCore.LinearAlgebra.CMatrix matr = new TAlex.MathCore.LinearAlgebra.CMatrix(new double[3, 3]); int cola = t1.ColumnCount, rowa = t1.RowCount; int colb = t2.ColumnCount, rowb = t2.RowCount; int permut =0; matr = -matr; for (int d = 1; d <= Dimension; d++) { // i loops till rowa for (int i = 0; i < rowa; i++) { // k loops till rowb for (int k = 0; k < rowb; k++) { // j loops till cola for (int j = 0; j < cola; j++) { // l loops till colb for (int l = 0; l < colb; l++) { //matr[i + l + 1, j + k + 1] = A[i, j] * B[k, l]; permut = TAlex.MathCore.LinearAlgebra.CMatrix.SignPermut(matr); }; } } } matr = TAlex.MathCore.LinearAlgebra.CMatrix.Multiply(matr, permut); } return matr; } // Source: https://en.wikipedia.org/wiki/Lie_group%E2%80%93Lie_algebra_correspondence the Section: "Compact Lie groups" and https://en.wikipedia.org/wiki/Killing_form public TAlex.MathCore.LinearAlgebra.Vector3D getEichtransformation(TAlex.MathCore.LinearAlgebra.CMatrix RealerWert, TAlex.MathCore.LinearAlgebra.CMatrix t1, TAlex.MathCore.LinearAlgebra.CMatrix t2, TAlex.MathCore.LinearAlgebra.CMatrix t3, TAlex.MathCore.LinearAlgebra.CMatrix t4, TAlex.MathCore.LinearAlgebra.CMatrix t5, TAlex.MathCore.LinearAlgebra.CMatrix t6, TAlex.MathCore.LinearAlgebra.CMatrix t7, TAlex.MathCore.LinearAlgebra.CMatrix t8) { TAlex.MathCore.LinearAlgebra.CMatrix cLieTEMP12 = getLieAlgebralementTriplet(3, t1, t2); TAlex.MathCore.LinearAlgebra.CMatrix cLieTEMP34 = getLieAlgebralementTriplet(3, t3, t4); TAlex.MathCore.LinearAlgebra.CMatrix cLieTemp56 = getLieAlgebralementTriplet(3, t5, t6); TAlex.MathCore.LinearAlgebra.CMatrix cLieTemp78 = getLieAlgebralementTriplet(3, t7, t8); TAlex.MathCore.LinearAlgebra.CMatrix[] matrixarray = new TAlex.MathCore.LinearAlgebra.CMatrix[4] { cLieTEMP12 , cLieTEMP34, cLieTemp56, cLieTemp78 }; TAlex.MathCore.LinearAlgebra.Vector3D vector; TAlex.MathCore.LinearAlgebra.CMatrix x; TAlex.MathCore.LinearAlgebra.CMatrix y; foreach(TAlex.MathCore.LinearAlgebra.CMatrix c in matrixarray) { x = TAlex.MathCore.LinearAlgebra.CMatrix.Exp(TAlex.MathCore.LinearAlgebra.CMatrix.Multiply(c,RealerWert)); y = TAlex.MathCore.LinearAlgebra.CMatrix.Multiply(x, -TAlex.MathCore.Complex.One); } // https://en.wikipedia.org/wiki/Special_unitary_group#The_group_SU(3) double meanVector(TAlex.MathCore.LinearAlgebra.CMatrix mat) { double result = -3.00; // to calculate mean // of each row double mean = 0.00; // loop to traverse // each column for (int i = 0; i < mat.RowCount; i++) { // to store sum of // elements of a column int sum = 0; for (int j = 0; j < mat.ColumnCount; j++) sum += (int) mat[j, i]; mean = sum / mat.RowCount; result = mean; } return result; } double getgesamtVectors = meanVector(t1) + meanVector(t2) + meanVector(t3) + meanVector(t4) + meanVector(t5) + meanVector(t6) + meanVector(t7) + meanVector(t8); vector = new TAlex.MathCore.LinearAlgebra.Vector3D(getgesamtVectors, getgesamtVectors, getgesamtVectors); return vector; } //Source: https://en.wikipedia.org/wiki/Color_charge and https://en.wikipedia.org/wiki/Special_unitary_group#The_group_SU(3) public bool getifFrobeniusScalarproductIsTrue() { if (isOrthogonalMatrix() ==true) { return true; } return false; } // Source: https://en.wikipedia.org/wiki/Color_charge public async Task isallright() { bool continueOnCapturedContext = false; TAlex.MathCore.LinearAlgebra.Vector3D vTemp = new TAlex.MathCore.LinearAlgebra.Vector3D(0, 0, 0); //if(getEichtransformation(red, λ1, λ2, λ3, λ4, λ5, λ6, λ7, λ8).X != vTemp.X && getEichtransformation(red, λ1, λ2, λ3, λ4, λ5, λ6, λ7, λ8).Y != vTemp.Y) if(TAlex.MathCore.LinearAlgebra.Vector3D.DotProduct(getEichtransformation(red, λ1, λ2, λ3, λ4, λ5, λ6, λ7, λ8),vTemp)== 0.00) { if (isWithoutTrace() == true && getifFrobeniusScalarproductIsTrue()) { if (λ1.IsHermitian() && λ2.IsHermitian() && λ3.IsHermitian() && λ4.IsHermitian() && λ5.IsHermitian() && λ6.IsHermitian() && λ7.IsHermitian() && λ8.IsHermitian()) continueOnCapturedContext = true; await isallright().ConfigureAwait(continueOnCapturedContext); return isallright().Result; } await isallright().ConfigureAwait(continueOnCapturedContext); return isallright().Result; } await isallright().ConfigureAwait(continueOnCapturedContext); return isallright().Result; } // Source: https://en.wikipedia.org/wiki/Color_charge public async Task createStarkeChargeenasync() { bool continueOnCapturedContext = false; red = new TAlex.MathCore.LinearAlgebra.CMatrix(new double[3,1] { {1 }, {0 }, {0 } }); green = new TAlex.MathCore.LinearAlgebra.CMatrix(new double[3, 1] { {0 }, {1 }, {0 } }); blue = new TAlex.MathCore.LinearAlgebra.CMatrix(new double[3, 1] { {0 }, {0 }, {1 } }); TAlex.MathCore.LinearAlgebra.CMatrix eigenproblemredresultt3,eigenproblemredresultt8, eigenproblemblueresultt3, eigenproblemblueresultt8, eigenproblemgreenresultt3, eigenproblemgreenresultt8; TAlex.MathCore.LinearAlgebra.CEigenproblem eigenprobt3 = new TAlex.MathCore.LinearAlgebra.CEigenproblem(λ3); TAlex.MathCore.LinearAlgebra.CEigenproblem eigenprobt8 = new TAlex.MathCore.LinearAlgebra.CEigenproblem(λ8); //The quint essence of all other transformations and other calculations before is the following block of Code to create a reference of the colours. //Source: https://en.wikipedia.org/wiki/Color_charge if (λ3.IsDiagonal && λ8.IsDiagonal) { if (eigenprobt3.Eigenvectors == red * eigenprobt3.Eigenvectors && eigenprobt8.Eigenvectors == red * eigenprobt3.Eigenvectors) { //return red.GetColumn(1).*getEichtransformation(red, λ1, λ2, λ3, λ4, λ5, λ6, λ7, λ8).X); eigenproblemredresultt3 = new TAlex.MathCore.LinearAlgebra.CEigenproblem(λ3).Eigenvectors * red; eigenproblemredresultt8 = new TAlex.MathCore.LinearAlgebra.CEigenproblem(λ8).Eigenvectors * red; continueOnCapturedContext = true; eigenproblemredresultt3 = await createStarkeChargeenasync().ConfigureAwait(continueOnCapturedContext); return eigenproblemredresultt3; } if (eigenprobt3.Eigenvectors == blue * eigenprobt3.Eigenvectors && eigenprobt8.Eigenvectors == blue * eigenprobt8.Eigenvectors) { //return red.GetColumn(1).*getEichtransformation(red, λ1, λ2, λ3, λ4, λ5, λ6, λ7, λ8).X); eigenproblemblueresultt3 = new TAlex.MathCore.LinearAlgebra.CEigenproblem(λ3).Eigenvectors * blue; eigenproblemblueresultt8 = new TAlex.MathCore.LinearAlgebra.CEigenproblem(λ8).Eigenvectors * blue; continueOnCapturedContext = true; eigenproblemblueresultt3 = await createStarkeChargeenasync().ConfigureAwait(continueOnCapturedContext); return eigenproblemblueresultt3; } if (eigenprobt3.Eigenvectors == green * eigenprobt3.Eigenvectors && eigenprobt8.Eigenvectors == green * eigenprobt8.Eigenvectors) { eigenproblemgreenresultt3 = new TAlex.MathCore.LinearAlgebra.CEigenproblem(λ3).Eigenvectors * green; eigenproblemgreenresultt8 = new TAlex.MathCore.LinearAlgebra.CEigenproblem(λ8).Eigenvectors * green; continueOnCapturedContext = true; eigenproblemgreenresultt3 = await createStarkeChargeenasync().ConfigureAwait(continueOnCapturedContext); return eigenproblemgreenresultt3; } } continueOnCapturedContext = true; eigenproblemredresultt3 = await createStarkeChargeenasync().ConfigureAwait(continueOnCapturedContext); return eigenproblemredresultt3; } //Source: public void setcolour(string colour) { if (colour == "red") { redVector3DCharge = 0.5 * TAlex.MathCore.LinearAlgebra.CMatrix.Eigenvectors(λ3) + (1 / 2 * Math.Sqrt(3.00)) * TAlex.MathCore.LinearAlgebra.CMatrix.Eigenvectors(λ8); } else if (colour == "blue") { blueVector3DCharge = -0.5 * TAlex.MathCore.LinearAlgebra.CMatrix.Eigenvectors(λ3) + (1 / 2 * Math.Sqrt(3.00)) * TAlex.MathCore.LinearAlgebra.CMatrix.Eigenvectors(λ8); } else if (colour == "green") { greenVector3DCharge = -1 / Math.Sqrt(3.00) * TAlex.MathCore.LinearAlgebra.CMatrix.Eigenvectors(λ8); } else if (colour == "cyan") { cyanVector3DCharge = redVector3DCharge.Conjugate; } else if (colour == "magenta") { magentaVector3DCharge = blueVector3DCharge.Conjugate; } else if(colour == "yellow") { yellowVector3DCharge = greenVector3DCharge.Conjugate; } else { // All other particles belong to the trivial representation (1) of color SU(3). //Source: https://en.wikipedia.org/wiki/Color_charge nullVector3DCharge = new TAlex.MathCore.LinearAlgebra.CMatrix(new double[3, 3] { {1,1,1 }, {1,1,1 }, {1,1,1 } }); } } public async Task getColoursAsync(Particles t, TAlex.MathCore.LinearAlgebra.CMatrix colour) { TAlex.MathCore.LinearAlgebra.Vector3D vred,vblue,vgreen,vcyan,vmagenta,vyellow,vnull = new TAlex.MathCore.LinearAlgebra.Vector3D(0,0,0); bool continueOnCapturedContext = false; if (colour == redVector3DCharge) { continueOnCapturedContext = true; vred = await getColoursAsync(t, redVector3DCharge).ConfigureAwait(continueOnCapturedContext); return vred; } else if (colour == blueVector3DCharge) { continueOnCapturedContext = true; vblue = await getColoursAsync(t, blueVector3DCharge).ConfigureAwait(continueOnCapturedContext); return vblue; } else if (colour == greenVector3DCharge) { continueOnCapturedContext = true; vgreen = await getColoursAsync(t, greenVector3DCharge).ConfigureAwait(continueOnCapturedContext); return vgreen; } else if (colour == cyanVector3DCharge) { continueOnCapturedContext = true; vcyan = await getColoursAsync(t, cyanVector3DCharge).ConfigureAwait(continueOnCapturedContext); return vcyan; } else if (colour == magentaVector3DCharge) { continueOnCapturedContext = true; vmagenta = await getColoursAsync(t, magentaVector3DCharge).ConfigureAwait(continueOnCapturedContext); return vmagenta; } else if (colour == yellowVector3DCharge) { continueOnCapturedContext = true; vyellow = await getColoursAsync(t, yellowVector3DCharge).ConfigureAwait(continueOnCapturedContext); return vyellow; } else { continueOnCapturedContext = true; vnull = await getColoursAsync(t, nullVector3DCharge).ConfigureAwait(continueOnCapturedContext); return vnull; } } } }