Bill Allombert on Tue, 02 Apr 2024 21:28:32 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: kronecker product of matrices
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: kronecker product of matrices
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Tue, 2 Apr 2024 21:28:23 +0200
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1712086107; c=relaxed/relaxed; bh=9r4uB553GYlgjB05/tG6q/ijah5fg8mFroqACKMuh8c=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:Mail-Followup-To: References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; b=qLARHdRHKKvaIY8mtPj/3Y4rDEWe1sMpeKgdyZk8zGrrFdVG7lnsd5X6G6qq99i8YYw+IUsJgLzD0yj6WOOdSM8RmwMCzS0SaKp2KUPOh2kmE4R2cSdBhS8b0tH2jyhH7aQYmHc3WZkbmiyYc7cItoDtTBz7MDJ37B67KOwGjthgDESzk+tZTx41tH7iPWzbwUIJgYa/EtcFQvTrYWAzaInXdvXwU0YPgPTiqUdxGHn59ii62OjQaBUlmi2xV9WTTRn0RcY2iObJ5+tMWuOsE96Edz7AaREmTmISx4eA172YP0FBpEZPrYTrId8+8P/0Yh/jLZcZ6jRSd+EUVk2OF9T9F1WBJWkd8OwcJgXVLSlZTxCFwT0TgNcOhi8BufBiYy+dUYDZ3uP/2YkTyFKWC29G6ayMuTetDSrvVY8kSkLSMYfCSkU6vyGdr9ddF3SeRwC8eo8ZbpnBTSPTiHgGTL3ivvUAuF4iKZSsLRhuirtu4EyC39gfQ4bKxmlymAB70fSMITv0KfCI7tYaXKEig+S77XObSVotWYjT19/do8lwZKSYd/tH38DL3GXDTlzNb4EAQ1eaF/VFT0/FbXp5F1pVzH7Cr9nTjHNNe6NRYmnVEoeQIVYgPgcCDcnJ/bBSXEtDNefwMXy3vHkrteBjQxAip8GGOFjafr8mMBbDPXo=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1712086107; cv=none; b=QbYhWse75O6Ojd6cuzBoZt24TTlpVylgUPQMwRyRRmwFPsJxX19thu/1PkmusCgAktwncjMo3aB+FbsrpKAUzjKCeI0IYWU/a0k49Ty9N9MJtMPKaVyEsdSNL6iRLS13Iy5gop3X90jHy9mRTIHtUVCxoDWH8+vwdK9h7BFRbFt7TBWx5d0w2bo71ZwxvRyOfFEndbSGkxMnSA/W9NItXViTnKKmyLHVR4zzdM7oz33Q+z0wH1o8bM2ltkmxx9zyHDx3dN1aFQMyKrBcyfYhp2a3fmRexw3jEpumLK8dtpTTYqfQzH600B4SOW52NE+j0uqEEqYICNZ5LmHzGdJ9uA2jjQ4dDjadssL+X67a0QsT35fFkqDY9rzgSyFw4a1ZvRWmnPYV1hN7XFvwJReOUv5haaElrFUUsP4plJuceHLcAMkhHOLxWjjFiIQW9LGdawm7C+y9WYu8HeDkM2qBzjBQCYq5PJ2sLKL7pQW3vchR6gq4Fi3NMlCzP7Np/7c/5Whi1yc0PxmfWZT5Kndev/3DLC7QR/IKXH8BbM9J+//j+f+x+G5rAR2RDPN/IH04Lw0d2d1qJL0JAc9EkMoT1ArDgMgOLSpN2DkZ6k8JFU9d7hkwiouDGNbnDrB8lU4xsN3M14JYJYfA4eGhfNjR08PT8cgIuKqyl6Xm4RTJRps=
- Authentication-results: smail; dmarc=none header.from=math.u-bordeaux.fr
- Authentication-results: smail; arc=none
- Delivery-date: Tue, 02 Apr 2024 21:28:32 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1712086107; bh=9r4uB553GYlgjB05/tG6q/ijah5fg8mFroqACKMuh8c=; h=Date:From:To:Subject:References:In-Reply-To:From; b=hdk88hSZihqD3FEGHUVBmXkFPRQ8/r82R79wPgYGX0YUZT2p25rLswu9mTKu9+cI5 y500Ig74uUEmLZLNJXcsK7AffsjnWnmckOeORXALnqDu7nF9bFwkhXwv8wKqUi8TOz jBM6EQHfykKa7j3/dNv1k4arDhXlu6F/C4UtzKFUek5Z/eIpwMJk/iDqjUtn4Ia4Kh mBZ6pLBMpYv5/c0/esvKuV5v+V61z6NEegyFewa4UCAv4NxRs1CQ7rDVeaq5y0Kekw V0v0YeCUop5sq41NS8IZI7MOjIUPGxDtsRvdc1/sq4tbIUpd1UAnu9WJUzTV9Adn22 UotPDFwbp3mN8AsH0lCOLv/pWE4righbMI/5My621YQL8xlWiH+oIRvvFRSsTItCJm lsLANi4fZ7AN9JXndbXGLLob9f7d15BP9yPb9HHcdbSUfdrgt+2O7ciotx1GYCd4Ow Dl9wgvr9WqCt2Oq578A52XmX9ED+24xJBt+LVtjNNODgZ6gfu1zmYrDn6O8zkSk10x 2855j9y5d7QjwaHAy5Ov37gCjvGtnGP947vJXaj3NxZuqRIRek6ocDj8QDBJxGi8RI d9tuwUrsR78Y8XM4d8UPsCeLMMLkeInDybJFpgd5JMp8jrEdAnLb4nZQSR9vPJsN9R gGk6ufZJXIepRx1ZSyl5a0Ac=
- In-reply-to: <CAJkPp5OJk15cedAtNn3goesDrfWXjU6EfaADhyTwXDr5pNYRYA@mail.gmail.com>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <CAJkPp5OJk15cedAtNn3goesDrfWXjU6EfaADhyTwXDr5pNYRYA@mail.gmail.com>
On Tue, Apr 02, 2024 at 02:31:00PM -0400, Max Alekseyev wrote:
> Does PARI/GP provide functionality for Kronecker (tensor) products of
> matrices?
> I could not find anything upon a quick search.
> If such functionality is missing, can it be added to future versions?
>
> For now, I use a custom function:
>
> { matkron(A,B) = my(sa=matsize(A), sb=matsize(B)); matrix(sa[1]*sb[1],
> sa[2]*sb[2], i, j, A[(i-1)\sb[1]+1,(j-1)\sb[2]+1] *
> B[(i-1)%sb[1]+1,(j-1)%sb[2]+1]); }
You can use matconcat:
matk(A,B)=matconcat(apply(x->x*B,A))
Cheers,
Bill.