How to resolve the algorithm Kronecker product step by step in the Sidef programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Kronecker product step by step in the Sidef programming language

Table of Contents

Problem Statement

Implement the   Kronecker product   of two matrices (arbitrary sized) resulting in a block matrix.

Show results for each of the following two samples:

Sample 1 (from Wikipedia): Sample 2:

See implementations and results below in JavaScript and PARI/GP languages.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Kronecker product step by step in the Sidef programming language

Source code in the sidef programming language

func kronecker_product(a, b) {
    a ~X b -> map { _[0] ~X* _[1] }
}

kronecker_product([[1, 2], [3, 4]],
                  [[0, 5], [6, 7]]).each { .say }

say ''
kronecker_product([[0,1,0],  [1,1,1],   [0,1,0]],
                  [[1,1,1,1],[1,0,0,1], [1,1,1,1]]).each { .say }


  

You may also check:How to resolve the algorithm Peripheral drift illusion step by step in the Perl programming language
You may also check:How to resolve the algorithm Sort stability step by step in the Liberty BASIC programming language
You may also check:How to resolve the algorithm Loops/Break step by step in the Lang5 programming language
You may also check:How to resolve the algorithm Bitmap/Midpoint circle algorithm step by step in the Go programming language
You may also check:How to resolve the algorithm Detect division by zero step by step in the SNOBOL4 programming language