Question about creating a 3-rank tensor in numpy with python3












0












$begingroup$


I'm trying to create a 3-rank tensor in numpy, with python3.x.



I need to create this 3-rank tensor A in a very particular way. If I have 3 matrices, let's say that all of them are some $Y$ matrix (which is dimensionally $4x4$), then it must be of the following mathematical form:



$A((in),(jk),(lm))$ from some type of multiplication roughly like: $"Y_{4}(i,j) otimes Y_{4}(k,l) otimes Y_{4}(m,n)"$. So, in a sense, I must connect the "input" of a matrix to the "output" of another identical matrix, for three identical matrices.



The final 3-rank tensor $A$ should have dimensions 16x16x16.



Mathematically, I'm not sure if this corresponds to a tensor product or a kronecker product. Obviously this makes a big difference, as in numpy for python, the functions numpy.kron() and numpy.tensordot() have different meanings.



I'd appreciate any help on this problem. I understand that this question may not exactly fit into the mathematics stack exchange, but I didn't know where else to ask, since this question deals with both mathematical and computational aspects.



So, just to clarify, my questions are:




  1. What is the difference between a tensor product and a kronecker product?

  2. How would I then create the above object? Would it require a tensor product or a kronecker product, or some combination of both?










share|cite|improve this question











$endgroup$












  • $begingroup$
    What does the arguments in $A$ mean? Shouldn't there be six arguments?
    $endgroup$
    – Emil
    Dec 20 '18 at 16:45












  • $begingroup$
    so the elements mean, for some cubic tensor of the form A(a,b,c), then a = in, b = jk, and c = l*m.
    $endgroup$
    – MatthewSteinberg13
    Dec 20 '18 at 16:49












  • $begingroup$
    Umm, so the sum is over products of indices? That does not look like a tensor to me, I usually think of a tensor as something where you sum over different terms where in each term you plug in vectors as arguments and multiply the result with the tensored duals of the arguments, or something like that.
    $endgroup$
    – Emil
    Dec 20 '18 at 16:53












  • $begingroup$
    that's because I accidentally forgot the tensor products. But this is a very general form.
    $endgroup$
    – MatthewSteinberg13
    Dec 20 '18 at 17:33
















0












$begingroup$


I'm trying to create a 3-rank tensor in numpy, with python3.x.



I need to create this 3-rank tensor A in a very particular way. If I have 3 matrices, let's say that all of them are some $Y$ matrix (which is dimensionally $4x4$), then it must be of the following mathematical form:



$A((in),(jk),(lm))$ from some type of multiplication roughly like: $"Y_{4}(i,j) otimes Y_{4}(k,l) otimes Y_{4}(m,n)"$. So, in a sense, I must connect the "input" of a matrix to the "output" of another identical matrix, for three identical matrices.



The final 3-rank tensor $A$ should have dimensions 16x16x16.



Mathematically, I'm not sure if this corresponds to a tensor product or a kronecker product. Obviously this makes a big difference, as in numpy for python, the functions numpy.kron() and numpy.tensordot() have different meanings.



I'd appreciate any help on this problem. I understand that this question may not exactly fit into the mathematics stack exchange, but I didn't know where else to ask, since this question deals with both mathematical and computational aspects.



So, just to clarify, my questions are:




  1. What is the difference between a tensor product and a kronecker product?

  2. How would I then create the above object? Would it require a tensor product or a kronecker product, or some combination of both?










share|cite|improve this question











$endgroup$












  • $begingroup$
    What does the arguments in $A$ mean? Shouldn't there be six arguments?
    $endgroup$
    – Emil
    Dec 20 '18 at 16:45












  • $begingroup$
    so the elements mean, for some cubic tensor of the form A(a,b,c), then a = in, b = jk, and c = l*m.
    $endgroup$
    – MatthewSteinberg13
    Dec 20 '18 at 16:49












  • $begingroup$
    Umm, so the sum is over products of indices? That does not look like a tensor to me, I usually think of a tensor as something where you sum over different terms where in each term you plug in vectors as arguments and multiply the result with the tensored duals of the arguments, or something like that.
    $endgroup$
    – Emil
    Dec 20 '18 at 16:53












  • $begingroup$
    that's because I accidentally forgot the tensor products. But this is a very general form.
    $endgroup$
    – MatthewSteinberg13
    Dec 20 '18 at 17:33














0












0








0





$begingroup$


I'm trying to create a 3-rank tensor in numpy, with python3.x.



I need to create this 3-rank tensor A in a very particular way. If I have 3 matrices, let's say that all of them are some $Y$ matrix (which is dimensionally $4x4$), then it must be of the following mathematical form:



$A((in),(jk),(lm))$ from some type of multiplication roughly like: $"Y_{4}(i,j) otimes Y_{4}(k,l) otimes Y_{4}(m,n)"$. So, in a sense, I must connect the "input" of a matrix to the "output" of another identical matrix, for three identical matrices.



The final 3-rank tensor $A$ should have dimensions 16x16x16.



Mathematically, I'm not sure if this corresponds to a tensor product or a kronecker product. Obviously this makes a big difference, as in numpy for python, the functions numpy.kron() and numpy.tensordot() have different meanings.



I'd appreciate any help on this problem. I understand that this question may not exactly fit into the mathematics stack exchange, but I didn't know where else to ask, since this question deals with both mathematical and computational aspects.



So, just to clarify, my questions are:




  1. What is the difference between a tensor product and a kronecker product?

  2. How would I then create the above object? Would it require a tensor product or a kronecker product, or some combination of both?










share|cite|improve this question











$endgroup$




I'm trying to create a 3-rank tensor in numpy, with python3.x.



I need to create this 3-rank tensor A in a very particular way. If I have 3 matrices, let's say that all of them are some $Y$ matrix (which is dimensionally $4x4$), then it must be of the following mathematical form:



$A((in),(jk),(lm))$ from some type of multiplication roughly like: $"Y_{4}(i,j) otimes Y_{4}(k,l) otimes Y_{4}(m,n)"$. So, in a sense, I must connect the "input" of a matrix to the "output" of another identical matrix, for three identical matrices.



The final 3-rank tensor $A$ should have dimensions 16x16x16.



Mathematically, I'm not sure if this corresponds to a tensor product or a kronecker product. Obviously this makes a big difference, as in numpy for python, the functions numpy.kron() and numpy.tensordot() have different meanings.



I'd appreciate any help on this problem. I understand that this question may not exactly fit into the mathematics stack exchange, but I didn't know where else to ask, since this question deals with both mathematical and computational aspects.



So, just to clarify, my questions are:




  1. What is the difference between a tensor product and a kronecker product?

  2. How would I then create the above object? Would it require a tensor product or a kronecker product, or some combination of both?







tensor-products tensors python kronecker-product






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Dec 20 '18 at 17:32







MatthewSteinberg13

















asked Dec 20 '18 at 16:14









MatthewSteinberg13MatthewSteinberg13

12




12












  • $begingroup$
    What does the arguments in $A$ mean? Shouldn't there be six arguments?
    $endgroup$
    – Emil
    Dec 20 '18 at 16:45












  • $begingroup$
    so the elements mean, for some cubic tensor of the form A(a,b,c), then a = in, b = jk, and c = l*m.
    $endgroup$
    – MatthewSteinberg13
    Dec 20 '18 at 16:49












  • $begingroup$
    Umm, so the sum is over products of indices? That does not look like a tensor to me, I usually think of a tensor as something where you sum over different terms where in each term you plug in vectors as arguments and multiply the result with the tensored duals of the arguments, or something like that.
    $endgroup$
    – Emil
    Dec 20 '18 at 16:53












  • $begingroup$
    that's because I accidentally forgot the tensor products. But this is a very general form.
    $endgroup$
    – MatthewSteinberg13
    Dec 20 '18 at 17:33


















  • $begingroup$
    What does the arguments in $A$ mean? Shouldn't there be six arguments?
    $endgroup$
    – Emil
    Dec 20 '18 at 16:45












  • $begingroup$
    so the elements mean, for some cubic tensor of the form A(a,b,c), then a = in, b = jk, and c = l*m.
    $endgroup$
    – MatthewSteinberg13
    Dec 20 '18 at 16:49












  • $begingroup$
    Umm, so the sum is over products of indices? That does not look like a tensor to me, I usually think of a tensor as something where you sum over different terms where in each term you plug in vectors as arguments and multiply the result with the tensored duals of the arguments, or something like that.
    $endgroup$
    – Emil
    Dec 20 '18 at 16:53












  • $begingroup$
    that's because I accidentally forgot the tensor products. But this is a very general form.
    $endgroup$
    – MatthewSteinberg13
    Dec 20 '18 at 17:33
















$begingroup$
What does the arguments in $A$ mean? Shouldn't there be six arguments?
$endgroup$
– Emil
Dec 20 '18 at 16:45






$begingroup$
What does the arguments in $A$ mean? Shouldn't there be six arguments?
$endgroup$
– Emil
Dec 20 '18 at 16:45














$begingroup$
so the elements mean, for some cubic tensor of the form A(a,b,c), then a = in, b = jk, and c = l*m.
$endgroup$
– MatthewSteinberg13
Dec 20 '18 at 16:49






$begingroup$
so the elements mean, for some cubic tensor of the form A(a,b,c), then a = in, b = jk, and c = l*m.
$endgroup$
– MatthewSteinberg13
Dec 20 '18 at 16:49














$begingroup$
Umm, so the sum is over products of indices? That does not look like a tensor to me, I usually think of a tensor as something where you sum over different terms where in each term you plug in vectors as arguments and multiply the result with the tensored duals of the arguments, or something like that.
$endgroup$
– Emil
Dec 20 '18 at 16:53






$begingroup$
Umm, so the sum is over products of indices? That does not look like a tensor to me, I usually think of a tensor as something where you sum over different terms where in each term you plug in vectors as arguments and multiply the result with the tensored duals of the arguments, or something like that.
$endgroup$
– Emil
Dec 20 '18 at 16:53














$begingroup$
that's because I accidentally forgot the tensor products. But this is a very general form.
$endgroup$
– MatthewSteinberg13
Dec 20 '18 at 17:33




$begingroup$
that's because I accidentally forgot the tensor products. But this is a very general form.
$endgroup$
– MatthewSteinberg13
Dec 20 '18 at 17:33










0






active

oldest

votes











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3047700%2fquestion-about-creating-a-3-rank-tensor-in-numpy-with-python3%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3047700%2fquestion-about-creating-a-3-rank-tensor-in-numpy-with-python3%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Probability when a professor distributes a quiz and homework assignment to a class of n students.

Aardman Animations

Are they similar matrix