![]() ![]() At any time we can collect all the information known about a tensor, using Information (the ? command). Information on a tensor is only used by Mathematica when the tensor appears in the expression being evaluated. This decision has also two important advantages: We cannot have two different tensors identified by the same symbol, to avoid conflicting information. Tensors are identified using symbols, and not strings. In xTensor` we take the following important decision: information on a tensor will be associated to a symbol identifying that tensor. Information in Mathematica is associated to symbols only (not to strings, numbers or composite expressions as a whole). What follows in this section refers to tensors, but can also be applied to other xTensor` types of values, to be listed below. Tensors and other types of values must be composite types. Unfortunatlely it is not possible to define new primitive types. Symbolic simplifiers like Simplify, FullSimplify and RootReduce can sometimes also be used to rigorously establish equality (including in the example just given) when SameQ and Equal cannot.There are three primitive types of values in Mathematica: symbols (head Symbol), strings (head String) and numbers (heads Integer, Rational, Real and Complex). For example, SameQ +2 Log ] ]- Erf ] ] ,0 ] returns False, whereas calling PossibleZeroQ on its first argument returns True (together with an informative message indicating that a zero value could not be rigorously established). PossibleZeroQ can be used to indicate if a given expression has value in some cases where SameQ returns False.UnsameQ (which may be input as …=!= …) is the converse of SameQ. Set (which may be input using the "single equals" syntax expr 1= expr 2) evaluates expr 2 and assigns the result to be the value of expr 1, while Equal (which may be input using the "double equals" syntax expr 1= expr 2) returns True if expr 1 and expr 2 are numerically equal. SameQ is related to a number of other symbols.(Alternately, SameQ may be used after first converting graphs to canonical form using CanonicalGraph.) In the case of graphs, IsomorphicGraphQ should be used to check sameness up to isomorphism. SameQ considers only literal correspondence, not isomorphism.This behavior is expressly different from that exhibited by Equal, which performs equality testing and remains unevaluated in cases that cannot be resolved. For example, SameQ and SameQ both return False. On the other hand, SameQ differentiates between representations of numbers that are numerically equal but that do not have identical representations. Different input forms of expressions may be SameQ if their underlying representations are identical, for example n! = Factorial returns True.The multiple-argument form SameQ, which may also be input as expr 1= expr 2= …, returns True if and only if all expressions expr i are identical. SameQ may be input using triple equal signs as expr 1= expr 2. Here, "identical" means there is exact correspondence between the underlying FullForm representations of expressions expr 1 and expr 2, with the exception that real numbers are considered SameQ if they differ only in their last binary digit. SameQ returns True if expr 1 is identical to expr 2 and otherwise returns False. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |