ListConvolve

The next cell demonstrates the basic use of ListConvolve. Next we see that ListConvolve is equivalent to flattening the result of a
certain matrix product. The next cell shows that ListConvolve is closely related to ListCorrelate. Specifying the "overhang" using In the next cell we provide ListConvolve {-1,-1} as a third argument. The previous example is equivalent to the matrix product in the next cell.
Here we have the last element of {a1, a2, a3, a4} in the upper left position
of the left matrix..  We also have the last element of {a1, a2, a3, a4} in
the lower right position of the left matrix.  The (-1) indicates last element
of {a1, a2, a3, a4}, and (-2) would indicate the second from the last element
of {a1, a2, a3, a4}. In the next cell we provide ListConvolve {1,1} as a third argument. The previous example is equivalent to the matrix product in the next cell.
Here we have the first element of {a1, a2, a3, a4} in the upper left position
of the left matrix..  We also have the first element of {a1, a2, a3, a4} in
the lower right position of the left matrix.  The (1) indicates first element
of {a1, a2, a3, a4}, and (2) would indicate the second element of {a1, a2,
a3, a4}. In the next cell we provide ListConvolve {1,-1} as a third argument. The previous example is equivalent to the matrix product in the next cell.
Here we have the first element of {a1, a2, a3, a4} in the upper left position
of the left matrix..  We also have the last element of {a1, a2, a3, a4} in
the lower right position of the left matrix.  The (1) indicates first element
of {a1, a2, a3, a4}, and (-1) indicates the last element of {a1, a2, a3, a4}. In the next cell we provide ListConvolve {-1,1} as a third argument. Notice
this gives the same result as

ListConvolve[{a1,a2,a3,a4},{b1,b2,b3,b4,b5,b6}]  (ie. {-1,1} is the default
for the third argument). The previous example is equivalent to the matrix product in the next cell.
Here we have the last element of {a1, a2, a3, a4} in the upper left position
of the left matrix..  We also have the First element of {a1, a2, a3, a4} in
the lower right position of the left matrix.  The (1) indicates first element
of {a1, a2, a3, a4}, and (-1) indicates the last element of {a1, a2, a3, a4}. In the next cell we provide (s) as a argument. The next cell performs a series of Dot products that give the same result as
in the previous cell.  Notice we gave ListConvolve {1,-1} as a third
argument, and the left part of the first row starts with the first part of
{a1,a2,a3,a4}.  Also the last row ends with the last element of
{a1,a2,a3,a4}. In the next cell we provide {u1 ,u2, u3, u4, u5, u6} as a argument. The next cell performs a series of Dot products that give the same result  as in the previous cell. Notice the difference between giving (s) and giving  {s,t,u} as a argument.  I actually have a hard time seeing when this would be useful. To make this more clear I give another example where we give ListConvolve  a argument in the next cell. The next cell performs a series of Dot products that give the same result as
in the previous cell. It's curious that providing an empty list as a argument is equivalent to providing the integer 1 as a argument. The next cell shows that by default ListConvolve uses the second argument  in place of a argument when none is provided. Generalizing beyond Times, Plus

In the next cell we provide ListConvolve (g) as a argument and it uses the head (g) in place of Times. In the next cell we provide ListConvolve (g, h) as a and arguments respectively and it uses the heads (g) and (h) in place of  Times and Plus respectively. ListConvolve with matrices

In the next cell we perform a ListConvolution on matrices. The next cell shows how the same ListConvolution can be done as Dot products
on parts of the matrices. We can give ListConvolve a level specification as a argument.  The next cell shows that level (2) is the default  specification when working on matrices. In the next cell we give ListConvolve the integer (1) as a level
specification. The next cell shows how the same ListConvolution can be done as Dot products
on parts of the matrices. The next cell shows two ways of expressing the default for the third argument
of ListConvolve when working with matrices. I am having a hard time seeing a pattern to how a ListConvolution on matrices
is done in different cases.  I would like to have a complete understanding
for what the third argument of ListConvolve does when working with matrices,
but it's too hard to decipher.  For example I would like to understand the
result of the examples below. I also understand we can also perform a ListConvolution on tensors, but that
is also too confusing for me to think about.

Created by Mathematica  (May 16, 2004)

Back to Ted’s Tricks index page
{"ft_lang_label":"__label__en","ft_lang_prob":0.84482485,"math_prob":0.9663811,"size":4810,"snap":"2019-13-2019-22","text_gpt3_token_len":1284,"char_repetition_ratio":0.18393674,"word_repetition_ratio":0.46412036,"special_character_ratio":0.25675675,"punctuation_ratio":0.1355276,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9822526,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138],"im_url_duplicate_count":[null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-03-19T15:35:33Z\",\"WARC-Record-ID\":\"<urn:uuid:66044199-48f7-4942-b2b8-3f84e5e21da2>\",\"Content-Length\":\"23331\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:04e24f22-7745-48fd-bf3b-c107bf492efc>\",\"WARC-Concurrent-To\":\"<urn:uuid:20cacb61-40c8-4dde-835c-13175e38276f>\",\"WARC-IP-Address\":\"101.0.112.3\",\"WARC-Target-URI\":\"http://verbeia.com/mathematica/tips/HTMLLinks/Tricks_L-O_3.html\",\"WARC-Payload-Digest\":\"sha1:K6ONNOA2SU7FWU5WRWJL57WYWRQP2AO2\",\"WARC-Block-Digest\":\"sha1:JOPNRPHALY4JX2WUUC43JOWT2NVACVYV\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-13/CC-MAIN-2019-13_segments_1552912201996.61_warc_CC-MAIN-20190319143502-20190319165502-00392.warc.gz\"}"}