Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Dot product

From Wikipedia, the free encyclopedia
Algebraic operation on coordinate vectors
"Scalar product" redirects here. For the abstract scalar product, seeInner product space. For the product of a vector and a scalar, seeScalar multiplication.

Inmathematics, thedot product orscalar product[note 1] is analgebraic operation that takes two equal-length sequences of numbers (usuallycoordinate vectors), and returns a single number. InEuclidean geometry, the dot product of theCartesian coordinates of twovectors is widely used. It is often called theinner product (or rarely theprojection product) ofEuclidean space, even though it is not the only inner product that can be defined on Euclidean space (seeInner product space for more). It should not be confused with thecross product.

Algebraically, the dot product is the sum of theproducts of the corresponding entries of the two sequences of numbers. Geometrically, it is the product of theEuclidean magnitudes of the two vectors and thecosine of the angle between them. These definitions are equivalent when using Cartesian coordinates. In moderngeometry,Euclidean spaces are often defined by usingvector spaces. In this case, the dot product is used for defining lengths (the length of a vector is thesquare root of the dot product of the vector by itself) and angles (the cosine of the angle between two vectors is thequotient of their dot product by the product of their lengths).

The name "dot product" is derived from thedot operator· " that is often used to designate this operation;[1] the alternative name "scalar product" emphasizes that the result is ascalar, rather than a vector (as with thevector product in three-dimensional space).

Definition

[edit]

The dot product may be defined algebraically or geometrically. The geometric definition is based on the notions of angle and distance (magnitude) of vectors. The equivalence of these two definitions relies on having aCartesian coordinate system for Euclidean space.

In modern presentations ofEuclidean geometry, the points of space are defined in terms of theirCartesian coordinates, andEuclidean space itself is commonly identified with thereal coordinate spaceRn{\displaystyle \mathbf {R} ^{n}}. In such a presentation, the notions of length and angle are defined by means of the dot product. The length of a vector is defined as thesquare root of the dot product of the vector by itself, and thecosine of the (non oriented) angle between two vectors of length one is defined as their dot product. So the equivalence of the two definitions of the dot product is a part of the equivalence of the classical and the modern formulations of Euclidean geometry.

Coordinate definition

[edit]

The dot product of two vectorsa=[a1,a2,,an]{\displaystyle \mathbf {a} =[a_{1},a_{2},\cdots ,a_{n}]} andb=[b1,b2,,bn]{\displaystyle \mathbf {b} =[b_{1},b_{2},\cdots ,b_{n}]}, specified with respect to anorthonormal basis, is defined as:[2]ab=i=1naibi=a1b1+a2b2++anbn{\displaystyle \mathbf {a} \cdot \mathbf {b} =\sum _{i=1}^{n}a_{i}b_{i}=a_{1}b_{1}+a_{2}b_{2}+\cdots +a_{n}b_{n}}whereΣ{\displaystyle \Sigma } denotessummation andn{\displaystyle n} is thedimension of thevector space. For instance, inthree-dimensional space, the dot product of vectors[1,3,5]{\displaystyle [1,3,-5]} and[4,2,1]{\displaystyle [4,-2,-1]} is: [1,3,5][4,2,1]=(1×4)+(3×2)+(5×1)=46+5=3{\displaystyle {\begin{aligned}\ [1,3,-5]\cdot [4,-2,-1]&=(1\times 4)+(3\times -2)+(-5\times -1)\\&=4-6+5\\&=3\end{aligned}}}

Likewise, the dot product of the vector[1,3,5]{\displaystyle [1,3,-5]} with itself is: [1,3,5][1,3,5]=(1×1)+(3×3)+(5×5)=1+9+25=35{\displaystyle {\begin{aligned}\ [1,3,-5]\cdot [1,3,-5]&=(1\times 1)+(3\times 3)+(-5\times -5)\\&=1+9+25\\&=35\end{aligned}}}

If vectors are identified withcolumn vectors, the dot product can also be written as amatrix productab=aTb,{\displaystyle \mathbf {a} \cdot \mathbf {b} =\mathbf {a} ^{\mathsf {T}}\mathbf {b} ,}whereaT{\displaystyle \mathbf {a} {^{\mathsf {T}}}} denotes thetranspose ofa{\displaystyle \mathbf {a} }.

Expressing the above example in this way, a 1 × 3 matrix (row vector) is multiplied by a 3 × 1 matrix (column vector) to get a 1 × 1 matrix that is identified with its unique entry:[135][421]=3.{\displaystyle {\begin{bmatrix}1&3&-5\end{bmatrix}}{\begin{bmatrix}4\\-2\\-1\end{bmatrix}}=3\,.}

Geometric definition

[edit]
Illustration showing how to find the angle between vectors using the dot product
Calculating bond angles of a symmetricaltetrahedral molecular geometry using a dot product

InEuclidean space, aEuclidean vector is a geometric object that possesses both a magnitude and a direction. A vector can be pictured as an arrow. Its magnitude is its length, and its direction is the direction to which the arrow points. Themagnitude of a vectora{\displaystyle \mathbf {a} } is denoted bya{\displaystyle \left\|\mathbf {a} \right\|}. The dot product of two Euclidean vectorsa{\displaystyle \mathbf {a} } andb{\displaystyle \mathbf {b} } is defined by[3][4][1]ab=abcosθ,{\displaystyle \mathbf {a} \cdot \mathbf {b} =\left\|\mathbf {a} \right\|\left\|\mathbf {b} \right\|\cos \theta ,}whereθ{\displaystyle \theta } is theangle betweena{\displaystyle \mathbf {a} } andb{\displaystyle \mathbf {b} }.

In particular, if the vectorsa{\displaystyle \mathbf {a} } andb{\displaystyle \mathbf {b} } areorthogonal (i.e., their angle isπ2{\displaystyle {\frac {\pi }{2}}} or90{\displaystyle 90^{\circ }}), thencosπ2=0{\displaystyle \cos {\frac {\pi }{2}}=0}, which implies thatab=0.{\displaystyle \mathbf {a} \cdot \mathbf {b} =0.}At the other extreme, if they arecodirectional, then the angle between them is zero withcos0=1{\displaystyle \cos 0=1} andab=ab{\displaystyle \mathbf {a} \cdot \mathbf {b} =\left\|\mathbf {a} \right\|\,\left\|\mathbf {b} \right\|}This implies that the dot product of a vectora{\displaystyle \mathbf {a} } with itself isaa=a2,{\displaystyle \mathbf {a} \cdot \mathbf {a} =\left\|\mathbf {a} \right\|^{2},}which givesa=aa,{\displaystyle \left\|\mathbf {a} \right\|={\sqrt {\mathbf {a} \cdot \mathbf {a} }},}the formula for theEuclidean length of the vector.

Scalar projection and first properties

[edit]
Scalar projection

Thescalar projection (or scalar component) of a Euclidean vectora{\displaystyle \mathbf {a} } in the direction of a Euclidean vectorb{\displaystyle \mathbf {b} } is given byab=acosθ,{\displaystyle a_{b}=\left\|\mathbf {a} \right\|\cos \theta ,}whereθ{\displaystyle \theta } is the angle betweena{\displaystyle \mathbf {a} } andb{\displaystyle \mathbf {b} }.

In terms of the geometric definition of the dot product, this can be rewritten asab=ab^,{\displaystyle a_{b}=\mathbf {a} \cdot {\widehat {\mathbf {b} }},}whereb^=b/b{\displaystyle {\widehat {\mathbf {b} }}=\mathbf {b} /\left\|\mathbf {b} \right\|} is theunit vector in the direction ofb{\displaystyle \mathbf {b} }.

Distributive law for the dot product

The dot product is thus characterized geometrically by[5]ab=abb=baa.{\displaystyle \mathbf {a} \cdot \mathbf {b} =a_{b}\left\|\mathbf {b} \right\|=b_{a}\left\|\mathbf {a} \right\|.}The dot product, defined in this manner, ishomogeneous under scaling in each variable, meaning that for any scalarα{\displaystyle \alpha },(αa)b=α(ab)=a(αb).{\displaystyle (\alpha \mathbf {a} )\cdot \mathbf {b} =\alpha (\mathbf {a} \cdot \mathbf {b} )=\mathbf {a} \cdot (\alpha \mathbf {b} ).}It also satisfies thedistributive law, meaning thata(b+c)=ab+ac.{\displaystyle \mathbf {a} \cdot (\mathbf {b} +\mathbf {c} )=\mathbf {a} \cdot \mathbf {b} +\mathbf {a} \cdot \mathbf {c} .}

These properties may be summarized by saying that the dot product is abilinear form. Moreover, this bilinear form ispositive definite, which means thataa{\displaystyle \mathbf {a} \cdot \mathbf {a} } is never negative, and is zero if and only ifa=0{\displaystyle \mathbf {a} =\mathbf {0} }, the zero vector.

Equivalence of the definitions

[edit]

Ife1,,en{\displaystyle \mathbf {e} _{1},\cdots ,\mathbf {e} _{n}} are thestandard basis vectors inRn{\displaystyle \mathbf {R} ^{n}}, then we may writea=[a1,,an]=iaieib=[b1,,bn]=ibiei.{\displaystyle {\begin{aligned}\mathbf {a} &=[a_{1},\dots ,a_{n}]=\sum _{i}a_{i}\mathbf {e} _{i}\\\mathbf {b} &=[b_{1},\dots ,b_{n}]=\sum _{i}b_{i}\mathbf {e} _{i}.\end{aligned}}}The vectorsei{\displaystyle \mathbf {e} _{i}} are anorthonormal basis, which means that they have unit length and are at right angles to each other. Since these vectors have unit length,eiei=1{\displaystyle \mathbf {e} _{i}\cdot \mathbf {e} _{i}=1}and since they form right angles with each other, ifij{\displaystyle i\neq j},eiej=0.{\displaystyle \mathbf {e} _{i}\cdot \mathbf {e} _{j}=0.}Thus in general, we can say that:eiej=δij,{\displaystyle \mathbf {e} _{i}\cdot \mathbf {e} _{j}=\delta _{ij},}whereδij{\displaystyle \delta _{ij}} is theKronecker delta.

Vector components in an orthonormal basis

Also, by the geometric definition, for any vectorei{\displaystyle \mathbf {e} _{i}} and a vectora{\displaystyle \mathbf {a} }, we note thataei=aeicosθi=acosθi=ai,{\displaystyle \mathbf {a} \cdot \mathbf {e} _{i}=\left\|\mathbf {a} \right\|\left\|\mathbf {e} _{i}\right\|\cos \theta _{i}=\left\|\mathbf {a} \right\|\cos \theta _{i}=a_{i},}whereai{\displaystyle a_{i}} is the component of vectora{\displaystyle \mathbf {a} } in the direction ofei{\displaystyle \mathbf {e} _{i}}. The last step in the equality can be seen from the figure.

Now applying the distributivity of the geometric version of the dot product givesab=aibiei=ibi(aei)=ibiai=iaibi,{\displaystyle \mathbf {a} \cdot \mathbf {b} =\mathbf {a} \cdot \sum _{i}b_{i}\mathbf {e} _{i}=\sum _{i}b_{i}(\mathbf {a} \cdot \mathbf {e} _{i})=\sum _{i}b_{i}a_{i}=\sum _{i}a_{i}b_{i},}which is precisely the algebraic definition of the dot product. So the geometric dot product equals the algebraic dot product.

Properties

[edit]

The dot product fulfills the following properties ifa{\displaystyle \mathbf {a} },b{\displaystyle \mathbf {b} },c{\displaystyle \mathbf {c} } andd{\displaystyle \mathbf {d} } are realvectors andα{\displaystyle \alpha },β{\displaystyle \beta },γ{\displaystyle \gamma } andδ{\displaystyle \delta } arescalars.[2][3]

Commutative
ab=ba,{\displaystyle \mathbf {a} \cdot \mathbf {b} =\mathbf {b} \cdot \mathbf {a} ,} which follows from the definition (θ{\displaystyle \theta } is the angle betweena{\displaystyle \mathbf {a} } andb{\displaystyle \mathbf {b} }):[6]ab=abcosθ=bacosθ=ba.{\displaystyle \mathbf {a} \cdot \mathbf {b} =\left\|\mathbf {a} \right\|\left\|\mathbf {b} \right\|\cos \theta =\left\|\mathbf {b} \right\|\left\|\mathbf {a} \right\|\cos \theta =\mathbf {b} \cdot \mathbf {a} .} The commutative property can also be easily proven with the algebraic definition, and inmore general spaces (where the notion of angle might not be geometrically intuitive but an analogous product can be defined) the angle between two vectors can be defined as

θ=arccos(abab).{\displaystyle \theta =\operatorname {arccos} \left({\frac {\mathbf {a} \cdot \mathbf {b} }{\left\|\mathbf {a} \right\|\left\|\mathbf {b} \right\|}}\right).}

Bilinear (additive, distributive and scalar-multiplicative in both arguments)
(αa+βb)(γc+δd)=αγ(ac)+αδ(ad)+βγ(bc)+βδ(bd).{\displaystyle {\begin{aligned}(\alpha \mathbf {a} +\beta \mathbf {b} )&\cdot (\gamma \mathbf {c} +\delta \mathbf {d} )\\&=\alpha \gamma (\mathbf {a} \cdot \mathbf {c} )+\alpha \delta (\mathbf {a} \cdot \mathbf {d} )+\beta \gamma (\mathbf {b} \cdot \mathbf {c} )+\beta \delta (\mathbf {b} \cdot \mathbf {d} ).\end{aligned}}}
Notassociative
Because the dot product is not defined between a scalarab{\displaystyle \mathbf {a} \cdot \mathbf {b} } and a vectorc,{\displaystyle \mathbf {c} ,} associativity is meaningless.[7] However, bilinearity impliesc(ab)=(ca)b=a(cb).{\displaystyle c(\mathbf {a} \cdot \mathbf {b} )=(c\mathbf {a} )\cdot \mathbf {b} =\mathbf {a} \cdot (c\mathbf {b} ).} This property is sometimes called the "associative law for scalar and dot product",[8] and one may say that "the dot product is associative with respect to scalar multiplication".[9]
Orthogonal
Two non-zero vectorsa{\displaystyle \mathbf {a} } andb{\displaystyle \mathbf {b} } areorthogonal if and only ifab=0{\displaystyle \mathbf {a} \cdot \mathbf {b} =0}.
Nocancellation
Unlike multiplication of ordinary numbers, where ifab=ac{\displaystyle ab=ac}, thenb{\displaystyle b} always equalsc{\displaystyle c} unlessa{\displaystyle a} is zero, the dot product does not obey thecancellation law:
Ifab=ac{\displaystyle \mathbf {a} \cdot \mathbf {b} =\mathbf {a} \cdot \mathbf {c} } anda0{\displaystyle \mathbf {a} \neq \mathbf {0} }, then we can write:a(bc)=0{\displaystyle \mathbf {a} \cdot (\mathbf {b} -\mathbf {c} )=0} by thedistributive law; the result above says this just means thata{\displaystyle \mathbf {a} } is perpendicular to(bc){\displaystyle (\mathbf {b} -\mathbf {c} )}, which still allows(bc)0{\displaystyle (\mathbf {b} -\mathbf {c} )\neq \mathbf {0} }, and therefore allowsbc{\displaystyle \mathbf {b} \neq \mathbf {c} }.
Product rule
Ifa{\displaystyle \mathbf {a} } andb{\displaystyle \mathbf {b} } are vector-valueddifferentiable functions, then the derivative (denoted by a prime{\displaystyle {}'}) ofab{\displaystyle \mathbf {a} \cdot \mathbf {b} } is given by the rule(ab)=ab+ab.{\displaystyle (\mathbf {a} \cdot \mathbf {b} )'=\mathbf {a} '\cdot \mathbf {b} +\mathbf {a} \cdot \mathbf {b} '.}

Application to the law of cosines

[edit]
Triangle with vector edgesa andb, separated by angleθ
Main article:Law of cosines

Given two vectorsa{\displaystyle {\color {red}\mathbf {a} }} andb{\displaystyle {\color {blue}\mathbf {b} }} separated by angleθ{\displaystyle \theta } (see the upper image), they form a triangle with a third sidec=ab{\displaystyle {\color {orange}\mathbf {c} }={\color {red}\mathbf {a} }-{\color {blue}\mathbf {b} }}. Leta{\displaystyle \color {red}a},b{\displaystyle \color {blue}b} andc{\displaystyle \color {orange}c} denote the lengths ofa{\displaystyle {\color {red}\mathbf {a} }},b{\displaystyle {\color {blue}\mathbf {b} }}, andc{\displaystyle {\color {orange}\mathbf {c} }}, respectively. The dot product of this with itself is:cc=(ab)(ab)=aaabba+bb=a2abab+b2=a22ab+b2c2=a2+b22abcosθ{\displaystyle {\begin{aligned}\mathbf {\color {orange}c} \cdot \mathbf {\color {orange}c} &=(\mathbf {\color {red}a} -\mathbf {\color {blue}b} )\cdot (\mathbf {\color {red}a} -\mathbf {\color {blue}b} )\\&=\mathbf {\color {red}a} \cdot \mathbf {\color {red}a} -\mathbf {\color {red}a} \cdot \mathbf {\color {blue}b} -\mathbf {\color {blue}b} \cdot \mathbf {\color {red}a} +\mathbf {\color {blue}b} \cdot \mathbf {\color {blue}b} \\&={\color {red}a}^{2}-\mathbf {\color {red}a} \cdot \mathbf {\color {blue}b} -\mathbf {\color {red}a} \cdot \mathbf {\color {blue}b} +{\color {blue}b}^{2}\\&={\color {red}a}^{2}-2\mathbf {\color {red}a} \cdot \mathbf {\color {blue}b} +{\color {blue}b}^{2}\\{\color {orange}c}^{2}&={\color {red}a}^{2}+{\color {blue}b}^{2}-2{\color {red}a}{\color {blue}b}\cos \mathbf {\color {purple}\theta } \\\end{aligned}}}which is thelaw of cosines.

Triple product

[edit]
Main article:Triple product

There are twoternary operations involving dot product andcross product.

Thescalar triple product of three vectors is defined asa(b×c)=b(c×a)=c(a×b).{\displaystyle \mathbf {a} \cdot (\mathbf {b} \times \mathbf {c} )=\mathbf {b} \cdot (\mathbf {c} \times \mathbf {a} )=\mathbf {c} \cdot (\mathbf {a} \times \mathbf {b} ).}Its value is thedeterminant of the matrix whose columns are theCartesian coordinates of the three vectors. It is the signedvolume of theparallelepiped defined by the three vectors, and is isomorphic to the three-dimensional special case of theexterior product of three vectors.

Thevector triple product is defined by[2][3]a×(b×c)=(ac)b(ab)c.{\displaystyle \mathbf {a} \times (\mathbf {b} \times \mathbf {c} )=(\mathbf {a} \cdot \mathbf {c} )\,\mathbf {b} -(\mathbf {a} \cdot \mathbf {b} )\,\mathbf {c} .}This identity, also known asLagrange's formula,may be remembered as "ACB minus ABC", keeping in mind which vectors are dotted together. This formula has applications in simplifying vector calculations inphysics.

Physics

[edit]

Inphysics, the dot product takes two vectors and returns ascalar quantity. It is also known as the "scalar product". The dot product of two vectors can be defined as the product of the magnitudes of the two vectors and the cosine of the angle between the two vectors. Thus,ab=|a||b|cosθ{\displaystyle \mathbf {a} \cdot \mathbf {b} =|\mathbf {a} |\,|\mathbf {b} |\cos \theta } Alternatively, it is defined as the product of the projection of the first vector onto the second vector and the magnitude of the second vector.

For example:[10][11]

Generalizations

[edit]

Complex vectors

[edit]

For vectors withcomplex entries, using the given definition of the dot product would lead to quite different properties. For instance, the dot product of a vector with itself could be zero without the vector being the zero vector (e.g. this would happen with the vectora=[1 i]{\displaystyle \mathbf {a} =[1\ i]}). This in turn would have consequences for notions like length and angle. Properties such as the positive-definite norm can be salvaged at the cost of giving up the symmetric and bilinear properties of the dot product, through the alternative definition[12][2]ab=iaibi¯,{\displaystyle \mathbf {a} \cdot \mathbf {b} =\sum _{i}{{a_{i}}\,{\overline {b_{i}}}},}wherebi¯{\displaystyle {\overline {b_{i}}}} is thecomplex conjugate ofbi{\displaystyle b_{i}}. When vectors are represented bycolumn vectors, the dot product can be expressed as amatrix product involving aconjugate transpose, denoted with the superscript H:ab=bHa.{\displaystyle \mathbf {a} \cdot \mathbf {b} =\mathbf {b} ^{\mathsf {H}}\mathbf {a} .}

In the case of vectors with real components, this definition is the same as in the real case. The dot product of any vector with itself is a non-negative real number, and it is nonzero except for the zero vector. However, the complex dot product issesquilinear rather than bilinear, as it isconjugate linear and not linear ina{\displaystyle \mathbf {a} }. The dot product is not symmetric, sinceab=ba¯.{\displaystyle \mathbf {a} \cdot \mathbf {b} ={\overline {\mathbf {b} \cdot \mathbf {a} }}.}The angle between two complex vectors is then given bycosθ=Re(ab)ab.{\displaystyle \cos \theta ={\frac {\operatorname {Re} (\mathbf {a} \cdot \mathbf {b} )}{\left\|\mathbf {a} \right\|\left\|\mathbf {b} \right\|}}.}

The complex dot product leads to the notions ofHermitian forms and generalinner product spaces, which are widely used in mathematics andphysics.

The self dot product of a complex vectoraa=aHa{\displaystyle \mathbf {a} \cdot \mathbf {a} =\mathbf {a} ^{\mathsf {H}}\mathbf {a} }, involving the conjugate transpose of a row vector, is also known as thenorm squared,aa=a2{\textstyle \mathbf {a} \cdot \mathbf {a} =\|\mathbf {a} \|^{2}}, after theEuclidean norm; it is a vector generalization of theabsolute square of a complex scalar (see also:Squared Euclidean distance).

Inner product

[edit]
Main article:Inner product space

The inner product generalizes the dot product toabstract vector spaces over afield ofscalars, being either the field ofreal numbersR{\displaystyle \mathbb {R} } or the field ofcomplex numbersC{\displaystyle \mathbb {C} }. It is usually denoted usingangular brackets bya,b{\displaystyle \left\langle \mathbf {a} \,,\mathbf {b} \right\rangle }.

The inner product of two vectors over the field of complex numbers is, in general, a complex number, and issesquilinear instead of bilinear. An inner product space is anormed vector space, and the inner product of a vector with itself is real and positive-definite.

Functions

[edit]

The dot product is defined for vectors that have a finite number ofentries. Thus these vectors can be regarded asdiscrete functions: a length-n{\displaystyle n} vectoru{\displaystyle u} is, then, a function withdomain{kN:1kn}{\displaystyle \{k\in \mathbb {N} :1\leq k\leq n\}}, andui{\displaystyle u_{i}} is a notation for the image ofi{\displaystyle i} by the function/vectoru{\displaystyle u}.

This notion can be generalized tosquare-integrable functions: just as the inner product on vectors uses a sum over corresponding components, the inner product on functions is defined as an integral over somemeasure space(X,A,μ){\displaystyle (X,{\mathcal {A}},\mu )}:[2]u,v=Xuvdμ.{\displaystyle \left\langle u,v\right\rangle =\int _{X}uv\,{\text{d}}\mu .}

For example, iff{\displaystyle f} andg{\displaystyle g} arecontinuous functions over acompact subsetK{\displaystyle K} ofRn{\displaystyle \mathbb {R} ^{n}} with the standardLebesgue measure, the above definition becomes:f,g=Kf(x)g(x)dnx.{\displaystyle \left\langle f,g\right\rangle =\int _{K}f(\mathbf {x} )g(\mathbf {x} )\,\operatorname {d} ^{n}\mathbf {x} .}

Generalized further tocomplex continuous functionsψ{\displaystyle \psi } andχ{\displaystyle \chi }, by analogy with the complex inner product above, gives:ψ,χ=Kψ(z)χ(z)¯dz.{\displaystyle \left\langle \psi ,\chi \right\rangle =\int _{K}\psi (z){\overline {\chi (z)}}\,{\text{d}}z.}

Weight function

[edit]

Inner products can have aweight function (i.e., a function which weights each term of the inner product with a value). Explicitly, the inner product of functionsu(x){\displaystyle u(x)} andv(x){\displaystyle v(x)} with respect to the weight functionr(x)>0{\displaystyle r(x)>0} isu,vr=abr(x)u(x)v(x)dx.{\displaystyle \left\langle u,v\right\rangle _{r}=\int _{a}^{b}r(x)u(x)v(x)\,dx.}

Dyadics and matrices

[edit]

A double-dot product formatrices is theFrobenius inner product, which is analogous to the dot product on vectors. It is defined as the sum of the products of the corresponding components of two matricesA{\displaystyle \mathbf {A} } andB{\displaystyle \mathbf {B} } of the same size:A:B=ijAijBij¯=tr(BHA)=tr(ABH).{\displaystyle \mathbf {A} :\mathbf {B} =\sum _{i}\sum _{j}A_{ij}{\overline {B_{ij}}}=\operatorname {tr} (\mathbf {B} ^{\mathsf {H}}\mathbf {A} )=\operatorname {tr} (\mathbf {A} \mathbf {B} ^{\mathsf {H}}).}And for real matrices,A:B=ijAijBij=tr(BTA)=tr(ABT)=tr(ATB)=tr(BAT).{\displaystyle \mathbf {A} :\mathbf {B} =\sum _{i}\sum _{j}A_{ij}B_{ij}=\operatorname {tr} (\mathbf {B} ^{\mathsf {T}}\mathbf {A} )=\operatorname {tr} (\mathbf {A} \mathbf {B} ^{\mathsf {T}})=\operatorname {tr} (\mathbf {A} ^{\mathsf {T}}\mathbf {B} )=\operatorname {tr} (\mathbf {B} \mathbf {A} ^{\mathsf {T}}).}

Writing a matrix as adyadic, we can define a different double-dot product (seeDyadics § Product of dyadic and dyadic) however it is not an inner product.

Tensors

[edit]

The inner product between atensor of ordern{\displaystyle n} and a tensor of orderm{\displaystyle m} is a tensor of ordern+m2{\displaystyle n+m-2}, seeTensor contraction for details.

Computation

[edit]

Algorithms

[edit]

The straightforward algorithm for calculating a floating-point dot product of vectors can suffer fromcatastrophic cancellation. To avoid this, approaches such as theKahan summation algorithm are used.

Libraries

[edit]

A dot product function is included in:

  • BLAS level 1 realSDOT,DDOT; complexCDOTU,ZDOTU = X^T * Y,CDOTC,ZDOTC = X^H * Y
  • Fortran asdot_product(A,B) orsum(conjg(A) * B)
  • Julia as  A' * B or standard library LinearAlgebra asdot(A, B)
  • R (programming language) assum(A * B) for vectors or, more generally for matrices, asA %*% B
  • Matlab as  A' * B  or  conj(transpose(A)) * B  or  sum(conj(A) .* B)  or  dot(A, B)
  • Python (packageNumPy) as  np.matmul(A, B)  or  np.dot(A, B)  or  np.inner(A, B)
  • GNU Octave as  sum(conj(X) .* Y, dim), and similar code as Matlab
  • Intel oneAPI Math Kernel Library real p?dotdot = sub(x)'*sub(y); complex p?dotcdotc = conjg(sub(x)')*sub(y)

See also

[edit]

Notes

[edit]
  1. ^The termscalar product means literally "product with ascalar as a result". It is also used for othersymmetric bilinear forms, for example in apseudo-Euclidean space. Not to be confused withscalar multiplication.

References

[edit]
  1. ^ab"Dot Product".www.mathsisfun.com. Retrieved2020-09-06.
  2. ^abcdeS. Lipschutz; M. Lipson (2009).Linear Algebra (Schaum's Outlines) (4th ed.). McGraw Hill.ISBN 978-0-07-154352-1.
  3. ^abcM.R. Spiegel; S. Lipschutz; D. Spellman (2009).Vector Analysis (Schaum's Outlines) (2nd ed.). McGraw Hill.ISBN 978-0-07-161545-7.
  4. ^A I Borisenko; I E Taparov (1968).Vector and tensor analysis with applications. Translated by Richard Silverman. Dover. p. 14.
  5. ^Arfken, G. B.; Weber, H. J. (2000).Mathematical Methods for Physicists (5th ed.). Boston, MA:Academic Press. pp. 14–15.ISBN 978-0-12-059825-0.
  6. ^Nykamp, Duane."The dot product".Math Insight. RetrievedSeptember 6, 2020.
  7. ^Weisstein, Eric W. "Dot Product". From MathWorld--A Wolfram Web Resource.http://mathworld.wolfram.com/DotProduct.html
  8. ^T. Banchoff; J. Wermer (1983).Linear Algebra Through Geometry. Springer Science & Business Media. p. 12.ISBN 978-1-4684-0161-5.
  9. ^A. Bedford; Wallace L. Fowler (2008).Engineering Mechanics: Statics (5th ed.). Prentice Hall. p. 60.ISBN 978-0-13-612915-8.
  10. ^K.F. Riley; M.P. Hobson; S.J. Bence (2010).Mathematical methods for physics and engineering (3rd ed.). Cambridge University Press.ISBN 978-0-521-86153-3.
  11. ^M. Mansfield; C. O'Sullivan (2011).Understanding Physics (4th ed.). John Wiley & Sons.ISBN 978-0-47-0746370.
  12. ^Berberian, Sterling K. (2014) [1992].Linear Algebra. Dover. p. 287.ISBN 978-0-486-78055-9.

External links

[edit]
Wikimedia Commons has media related toScalar product.
Basic concepts
Three dimensional Euclidean space
Matrices
Bilinear
Multilinear algebra
Vector space constructions
Numerical
Scope
Mathematics
Notation
Tensor
definitions
Operations
Related
abstractions
Notable tensors
Mathematics
Physics
Mathematicians
Authority control databases: NationalEdit this at Wikidata
Retrieved from "https://en.wikipedia.org/w/index.php?title=Dot_product&oldid=1277638023"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp