Outer Product: Difference between revisions

Jump to navigation Jump to search
300 bytes added ,  20:20, 25 June 2023
m (Text replacement - "<source" to "<syntaxhighlight")
Tags: Mobile edit Mobile web edit
Line 6: Line 6:
The result of an inner product is an array with rank two less than the sum of the argument ranks. The result of an outer product, on the other hand, is always an array of rank equal to the sum of the argument ranks. This follows from the fact that the reduction operation, which collapses two dimensions in an inner product, is not used in the outer product. The notation for outer product reflects this by canonically using a small circle as the first symbol. Thus, the ordinary outer product is written as <code>a∘.×b</code> .
The result of an inner product is an array with rank two less than the sum of the argument ranks. The result of an outer product, on the other hand, is always an array of rank equal to the sum of the argument ranks. This follows from the fact that the reduction operation, which collapses two dimensions in an inner product, is not used in the outer product. The notation for outer product reflects this by canonically using a small circle as the first symbol. Thus, the ordinary outer product is written as <code>a∘.×b</code> .
</blockquote>
</blockquote>
 
(Note however that the above quote is not technically correct; the reduction in inner product actually does not collapse any dimensions, since it is applied within each enclosure/box. Rather, these are collapsed as a result of enclosing one axis of each argument prior to the outer product operation.) The syntactical inconsistency is resolved in [[J]] and [[BQN]], where the outer product operator, called Table, and denoted <syntaxhighlight lang=j inline>/</syntaxhighlight> and <code>⌜</code> respectively, has the usual operator syntax.
This syntactical inconsistency is resolved in [[J]] and [[BQN]], where the outer product operator, called Table, and denoted <syntaxhighlight lang=j inline>/</syntaxhighlight> and <code>⌜</code> respectively, has the usual operator syntax.


=== Examples ===
=== Examples ===
trusted
83

edits

Navigation menu