The covariant derivative of the r component in the r direction is the regular derivative. Chapter 10 vectors and tensors georgia institute of. Covariance and contravariance of vectors wikipedia. I understand what a tensor is on a very elementary level. Converting contravariant or covariant tensors to mixed. Covariant and contravariant tensors physics forums. Covariance and contravariance in generics microsoft docs. The contravariant tensor conjugate to gij is denoted by gij satisfy 5 gijgik.
Im a physics enthusiast whos trying to transition to being a physicist proper, and part of that involves understanding the language of tensors. Recall that the contravariant components are measured parallel to the coordinate axes, and the covariant components are measured normal to all the other. A di erent metric will, in general, identify an f 2v with a completely di erent ef 2v. Covariance and contravariance of vectors 3 for some invertible n. One part are ordinary vector spaces contravariant, the other dual vector spaces covariant. Actually understanding how they work is more difficult. It focuses on real world metaphors and on code examples that show how those concepts can be used in scala. Tensors are objects in multilinear algebra that can have aspects of both covariance and contravariance. Although tensors are applied in a very broad range of physics and math. For example, for a tensor of contravariant rank 2 and covariant rank 1.
However, upon deeper reflection that makes perfect sense. Oct 16, 2007 i have been wanting for a long time to do a series of articles about covariance and contravariance which i will shorten to variance for the rest of this series. Since you asked for an intuitive way to understand covariance and contravariance, i think this will do. Covariance and contravariance of vectors wikimili, the. Covariance and contravariance computer science, whether a type system preserves the ordering. Although the assertion covariance and contravariance refer to how coordinates change under a change of basis seems about right, the next few sentences try to say roughly that vectors in v have contravariant components and vectors in v have covariant components. In ndimensional space a tensor of rank n has nn components. In rowvector notation, the basis vectors themselves are just i ex 1,0,0 j ey 0,1,0 k ez 0,0,1 1. In the lexicon of category theory, covariance and contravariance are properties of functors. As mentioned in a previous video, tensors are invariant under coordinate transformations.
Icomparable at first glance you might ask yourself why this is not a circular definition. Covariance and contravariance of vectors semantic scholar. The rules for transformation of tensors of arbitrary rank are a generalization of the rules for vector transformation. In typescript, argument types are bivariant both covariant and contravariant, which is unsound although now in typescript 2.
In cartesian space they must be an orthogonal norm preserving matrix. Covariance and contravariance are collectively referred to as variance. The g term accounts for the change in the coordinates. Array covariance delegate covariance variance in generic type parameters conclusion. We may play this game in the euclidean space en with its \dot inner product. Covariance and contravariance of functors, in category theory. For example, if we have a matrix consisting of 3 rows, with 4 elements in each row columns, then the matrix is a tensor of dimension 3,4, or equivalently, dimension 12. Covariance and contravariance of vectors 5 then the frame f is related to the frame f by the inverse of the jacobian matrix of the coordinate transition.
Metaphors are borrowed from erik meijers talk contravariance is the dual of covariance implies iterable is the dual of observable making money using math meijer2014. A generic type parameter that is not marked covariant or contravariant is referred to as invariant. Here, each vector y j of the f basis is a linear combination of the vectors x i of the f basis, so that contravariant transformation a vector v in v is expressed uniquely as a linear combination of the elements of. Covariance and contravariance are polymorphism extension to the arrays, delegates and generics. Covariance and contravariance are properties of a mapping function that associates one member of a set with another.
The question is what is the difference between covariance and contravariance. The contravariant tensor conjugate to gij is denoted by gij satisfy 5. Converting contravariant or covariant tensors to mixed tensors. Covariance, mutation, and java generics all the builtin collections classes java. Intuitive way to understand covariance and contravariance in. Transformation laws and their relation to fancyschmancy tensors 17 2. Or, in indices, a tangent vector is by definition a vector that is a linear combination of the coordinate partials. More specifically, a mapping can be covariant or contravariant with respect to a relation on that set.
First of all, remember that the reason of having covariant or contravariant tensors is because you want to represent the same thing in a different coordinate system. First we will explain the distinction between the covariant and contravariant components of vectors, thinking of vectorfields where a vector is defined at a point rather than as a. On an elementary level, if a is an m x n matrix then it defines a function r n r m while its transpose matrix a t is n x m and defines a function in the opposite direction r m r n. The mnemonic for producer extends, consumer super pecs, from the book effective java by joshua bloch gives an easy way to remember when to use covariance and contravariance. Now that were firm on the concepts, lets talk about the terminology. Understanding covariance and contravariance dr dobbs. I have been wanting for a long time to do a series of articles about covariance and contravariance which i will shorten to variance for the rest of this series. Physicists use it this way, the terms contravariant and covariant in mathematics are defined for functors and not for tensors. Jul 21, 2017 contravariance in the argument type means a. This post explains concepts of covariance and contravariance. Tensors of rank 1, 2, and 3 visualized with covariant and contravariant components. We take the inner product of the two vectors which usually means resolving f along the direction of s. Covariance preserves the assignment compatibility and contravariance opposite the covariance functionality. Jul 29, 20 this illustrates a subtle and slightly unfortunate design choice in the method type inference algorithm, which of course was designed long before covariance and contravariance were added to the language.
General relativitycontravariant and covariant indices. For any given index we could generalize the idea of contravariance and covariance to include mixtures of these two qualities in a single index. The following code demonstrates the difference between assignment compatibility, covariance, and contravariance. Covariance and contravariance the astute reader may notice that the title of the article contains these two terms which i have carefully avoided using this whole time. In multilinear algebra and tensor analysis, covariance and contravariance describe how the. Covariance and contravariance fabulous adventures in coding. Covariance and contravariance of vectors wikimili, the best. By continuing to browse this site, you agree to this use. To state this strange behavior in the proper jargon, we allow function types to be covariant in their return type and contravariant in their argument type. Ultimately the distinction between covariance and contravariance comes from the distinction between a vector space and its dual space. When studying tensor calculus the distinction between covariance and contravariance may be obscure and is rarely explained visually. It provides implicit reference conversion for arrays, delegates and generic parameter types. For other uses of covariant or contravariant, see covariance and contravariance in multilinear algebra and tensor analysis, covariance and contravariance describe how the quantitative description of certain geometric or physical entities changes with a change of basis from one coordinate system to another.
The distinction between contravariance and covariance is important e. When one coordinate system is just a rotation of the other, this distinction is. If you check the msdn help it indicates that covariance is the ability to assign a narrower typeread childto a wider typeread parent, and contravariance permits assigning a wider type to a narrower type. Linear functionals, volume forms, and rethinking integration 15 2. List of car and you allowed mutation, then mutation would violate the covariance.
Intuitive way to understand covariance and contravariance. Jun 17, 2010 covariance preserves assignment compatibility and contravariance reverses it. The duality between covariance and contravariance intervenes whenever a vector or tensor quantity is represented by its components, although modern differential geometry uses more sophisticated indexfree methods to represent tensors. The covariant derivative of the r component in the q direction is the regular derivative plus another term. Conversion of mixed tensors into mixed tensors and into covariant or contravariant ones 0 i wanted to know of book suggestions that can help me overcome my fear of indices. To get an intuitive idea of the difference between invariance, covariance, and contravariance, suppose we have an aquarium tank filled with water, and we define rectangular cartesian coordinates x,y,z to identify each point in the tank. A change of scale on the reference axes corresponds to a change of units in the problem. Wikipedia covariance and contravariance of vectors tensor. The following code demonstrates the difference between assignment compatibility, covariance, and. A basic explanation of the covariance and contravariance of vectors and of tensors too, since vectors are tensors of rank math1math is best done with the help of a geometric representation or illustration. Net framework 4, variant type parameters are restricted to generic interface and generic. This is almost completely unintelligible, since the space which contains the. Covariance and contravariance in scala kamil korzekwa.
Here, each vector y j of the f basis is a linear combination of the vectors x i of the f basis, so that contravariant transformation a vector v in v is expressed uniquely as a linear combination of the elements of the f basis as 2. Another characteristic of a tensor is the dimension of the tensor, which is the count of each index. Introduction in this entire article we will learn all about covariance and contravariance, including what the issues were with development before these two. Wikipedia covariance and contravariance of vectors free download as pdf file. Tensor analysis and curvilinear coordinates phil lucht rimrock digital technology, salt lake city, utah 84103 last update. For other uses of covariant or contravariant, see covariance and contravariance disambiguation. The second is a brief introduction to coordinatefree geometry, which neces sitates a discussion of contravariant and covariant. Covariance and contravariance computer science wikipedia. Given two types s and t such that s covariance usually applies to functions or methods, a function. They just let you write code that youd expect to work.
With the notion of contravariant and covariant components of a vector, we. Covariance preserves assignment compatibility and contravariance reverses it. Covariance and contravariance an interface can be viewed as a set of method signatures, for example. Covariance and contravariance of vectors, in mathematics and theoretical physics. A brief summary of facts about variance in the common language runtime. Jan 15, 2012 covariance and contravariance are polymorphism extension to the arrays, delegates and generics. In this article, i explain that, together with some theory where the two concepts come from. Tensors can, in general, have rank greater than 2, and often do.
359 1413 1313 697 333 1512 1151 1478 246 1448 886 1029 1415 604 1005 1060 1369 1275 1269 1349 19 961 1514 934 260 688 648 760 492 1478 786 661 884 1389 736 180 805 686 140 47 163 330