Then we map ToCanonical over individual terms, such that each of them is canonicalized independently.Ģ) Terms (generically products of different objects) are sorted according to a number of criteria. Its action is composed of three steps:ġ) On a sum of terms we first apply the function SameDummies to minimize the number of different dummy indices. In xTensor` the canonicalizer is implemented in a single command, called ToCanonical, by far the most sophisticated algorithm of the whole system. The main part of a computer algebra system is the canonicalizer, the algorithm in chart of bringing any expression to its canonical form. The global variable $CommuteCovDsOnScalars turns on and off the commutativity of symmetric covariant derivatives on scalar fields. The options CommutePDs and ConstantMetric of SymmetryOf help in controlling these points. When there are derivatives involved the computation is more complicated and we need to know whether the derivatives commute, or whether it is possible to permute indices with different characters. The symmetry of a product of tensors is computed from the symmetries of the individual tensors (stored in SymmetryGroupOfTensor) and taking into account the possibility of permuting equal subexpressions. For explanation of these and other concepts in permutation group theory see the documentation for the companion package xPerm`. The symmetry group is written in strong generating set notation, and its permutations are written in cyclic notation. For example, for a tensor Rie with the symmetries of a Riemann tensor, the symmetry returned by SymmetryOf would be this expression with head Symmetry: For convenience, apart from the permutation group describing the symmetry, this function returns the original expression with indices numbered, so that it is clear which indices the permutations are referring to. Since gravity speeds up the chips alpha moving, and there are 2^N states, which is 2^640*10^40, or about 5.783*10^216.762162762 years, though if the list started out sorted, its complexity would only be O(N), faster than merge sort, which is only N log N even at the worst case.Įdit3: This algorithm is actually slower than miracle sort as the size gets very big, say 1000, since my algorithm would have a run time of 2.83*10^1175546 years, while the miracle sort algorithm would have a run time of 1.156*10^9657 years.Every product of tensors or tensorial expressions has a well defined symmetry under permutations of its indices, and this can be obtained with the function SymmetryOf. 0000004 seconds,Īnd bogosort takes 308 years, 139 days, 19 hours, 35 minutes, 22.306 seconds, assuming a year is 365.242 days and a computer does 250,000,000 32 bit integer operations per second.Įdit2: This algorithm is not as slow as the "algorithm" miracle sort, which probably, like this sort, will get the computer sucked in the black hole before it successfully sorts 20 elemtnts, but if it did, I would estimate an average complexity of 2^(32(the number of bits in a 32 bit integer)*N)(the number of elements)*(a number <=10^40) years, Regular bogosort has a average complexity of O(N!), this algorithm has a average complexity of O(N!1!2!3!.N!)Įdit: To give you an idea of how large this number is, for 20 elements, this algorithm takes an average of 3.930093*10^158 years,well above the proposed heat death of the universe(if it happens) of 10^100 years, Should the list be out of order at any time, it restarts by bogosorting the first 2 again. Next it checks the first 3, bogosorts them, and so on. First, it checks the first 2 elements, and bogosorts them. There is a sort that's called bogobogosort. Require any of that suspicious technological computer stuff. This algorithm is constant in time, and sorts the list in-place, That transcends our naïve mortal understanding of "ascending order".Īny attempt to change that order to conform to our own preconceptions It's safe to assume that it's already optimally Sorted in some way There is such a small likelihood of this that it'sĬlearly absurd to say that this happened by chance, so it must haveīeen consciously put in that order by an intelligent Sorter. The probability of the original input list being in the exact order Intelligent design sort is a sorting algorithm based on the theory of From David Morgan-Mar's Esoteric Algorithms page: Intelligent Design Sort
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |