emendes

225 Reputation

6 Badges

3 years, 324 days

MaplePrimes Activity


These are replies submitted by emendes

@acer Many thanks.  That is exactly what I need.   It seems that Iterator:-Combination is another good option.   

@Kitonum Many thanks but let us consider combinat:-numbcomb(30,10) = 30045015.  Depending on my previous calculations I will have to test them all and I am not sure if they will fit the memory.  

 

@acer Since you opened the door, here is the problem.  I will take the 3D quadratic form as an illustration.

f := [x^2*alpha[1, 4]+x*y*alpha[1, 5]+x*z*alpha[1, 6]+y^2*alpha[1, 7]+y*z*alpha[1, 8]+z^2*alpha[1, 9]+x*alpha[1, 1]+y*alpha[1, 2]+z*alpha[1, 3]+alpha[1, 0], x^2*alpha[2, 4]+x*y*alpha[2, 5]+x*z*alpha[2, 6]+y^2*alpha[2, 7]+y*z*alpha[2, 8]+z^2*alpha[2, 9]+x*alpha[2, 1]+y*alpha[2, 2]+z*alpha[2, 3]+alpha[2, 0], x^2*alpha[3, 4]+x*y*alpha[3, 5]+x*z*alpha[3, 6]+y^2*alpha[3, 7]+y*z*alpha[3, 8]+z^2*alpha[3, 9]+x*alpha[3, 1]+y*alpha[3, 2]+z*alpha[3, 3]+alpha[3, 0]]

To test the symmetry (another problem) I need to swap y with z and vice-versa. That was the problem in the head of this thread.  Suppose now the test for the symmetry y-z in the 3D cubic form 

f1 := [x^3*alpha[1, 10]+x^2*y*alpha[1, 11]+x^2*z*alpha[1, 12]+x*y^2*alpha[1, 13]+x*y*z*alpha[1, 14]+x*z^2*alpha[1, 15]+y^3*alpha[1, 16]+y^2*z*alpha[1, 17]+y*z^2*alpha[1, 18]+z^3*alpha[1, 19]+x^2*alpha[1, 4]+x*y*alpha[1, 5]+x*z*alpha[1, 6]+y^2*alpha[1, 7]+y*z*alpha[1, 8]+z^2*alpha[1, 9]+x*alpha[1, 1]+y*alpha[1, 2]+z*alpha[1, 3]+alpha[1, 0], x^3*alpha[2, 10]+x^2*y*alpha[2, 11]+x^2*z*alpha[2, 12]+x*y^2*alpha[2, 13]+x*y*z*alpha[2, 14]+x*z^2*alpha[2, 15]+y^3*alpha[2, 16]+y^2*z*alpha[2, 17]+y*z^2*alpha[2, 18]+z^3*alpha[2, 19]+x^2*alpha[2, 4]+x*y*alpha[2, 5]+x*z*alpha[2, 6]+y^2*alpha[2, 7]+y*z*alpha[2, 8]+z^2*alpha[2, 9]+x*alpha[2, 1]+y*alpha[2, 2]+z*alpha[2, 3]+alpha[2, 0], x^3*alpha[3, 10]+x^2*y*alpha[3, 11]+x^2*z*alpha[3, 12]+x*y^2*alpha[3, 13]+x*y*z*alpha[3, 14]+x*z^2*alpha[3, 15]+y^3*alpha[3, 16]+y^2*z*alpha[3, 17]+y*z^2*alpha[3, 18]+z^3*alpha[3, 19]+x^2*alpha[3, 4]+x*y*alpha[3, 5]+x*z*alpha[3, 6]+y^2*alpha[3, 7]+y*z*alpha[3, 8]+z^2*alpha[3, 9]+x*alpha[3, 1]+y*alpha[3, 2]+z*alpha[3, 3]+alpha[3, 0]]

T1 and T2 need to be updated in the routines.   I haven't given much thought on that now but it will be in my mind soon. 

@acer Many many thanks.  I will certainly take into account your advice.  Since my maple proficiency is as bad as you could see by the questions I sent to the list,  I am afraid that I have a long way to find the cleanest and fastest solution to the problem.

@Carl Love Many thanks.  I need help to understand the last line.  specindex is barely touched in the help file (I am running 2017 and 2020).  And the op part as well. 

 

@acer Many many thanks.  I have thousands of lists like the one in the example.  That one is just to prepare the set of coefficients to be tested for the symmetry y->z in a full 3D quadratic model.  It is my plan to extend that to a higher degree and a higher dimension.  The problem will be now to build T1 and T2 programmatically for all cases.  

@Carl Love Many many thanks. I am carefully checking the line after varA. I know what is going on but I think I will never come up with a solution like that.  

 

@Carl I found the mistake.   It works flawlessly.  Would you have a shorter solution?   That is, no need to apply your solution four times. 

@Carl Love Many thanks.   It worked but please my answer to @Joe Riel.   I could not figure out how to change your solution to accommodate the remaining substitutions.  I have to confess that I did not completely understand it.  For the extra 3 steps I did:

1st step - Back to A.

T:= table([0=0,1=1,2=2,3=3,4=4,5=5,6=6,7=7,8=8,9=9]):
newA1:=subsindets(
    newA, 
    `?[]`~(B, `[]`~(anything, {indices(T,'nolist')})), 
    a-> A[op(1,a), T[op(2,a)]]
);

2nd step

T:= table([2= 3, 3= 2]):
newA2:=subsindets(
    newA1, 
    `?[]`~(A, `[]`~(anything, {indices(T,'nolist')})), 
    a-> B[T[op(1,a)], op(2,a)]
);

 almost gave me the right answer.  The first B terms were messed up.  

 

 

@Joe Riel Many thanks.  It seems that you guessed the next step but I need to apply two more substitutions so the final output is

{Subscript[A, 1, 0], Subscript[A, 1, 1], Subscript[A, 1, 3], \
Subscript[A, 1, 2], Subscript[A, 1, 4], Subscript[A, 1, 6], \
Subscript[A, 1, 5], Subscript[A, 1, 9], Subscript[A, 1, 8], \
Subscript[A, 1, 7], Subscript[A, 3, 0], Subscript[A, 3, 1], \
Subscript[A, 3, 3], Subscript[A, 3, 2], Subscript[A, 3, 4], \
Subscript[A, 3, 6], Subscript[A, 3, 5], Subscript[A, 3, 9], \
Subscript[A, 3, 8], Subscript[A, 3, 7], Subscript[A, 2, 0], \
Subscript[A, 2, 1], Subscript[A, 2, 3], Subscript[A, 2, 2], \
Subscript[A, 2, 4], Subscript[A, 2, 6], Subscript[A, 2, 5], \
Subscript[A, 2, 9], Subscript[A, 2, 8], Subscript[A, 2, 7]}

the extra 3 steps in Mathematica to get the result shown above are:

 

Subscript[B, m_, n_] -> Subscript[A, m, n] 
{Subscript[A, 2, m_] -> Subscript[B, 3, m],  Subscript[A, 3, m_] -> Subscript[B, 2, m]}
Subscript[B, m_, n_] -> Subscript[A, m, n]

With your solution, I do not need the first step.

I tried to modify the code to do the second step but it didn't work (that means that I did not understand what you did). 

 

@Carl Love  Many thanks.  For the example shown above the output should be

{Subscript[A, 1, 0], Subscript[A, 1, 1], Subscript[B, 1, 3], \
Subscript[B, 1, 2], Subscript[A, 1, 4], Subscript[B, 1, 6], \
Subscript[B, 1, 5], Subscript[B, 1, 9], Subscript[A, 1, 8], \
Subscript[B, 1, 7], Subscript[A, 2, 0], Subscript[A, 2, 1], \
Subscript[B, 2, 3], Subscript[B, 2, 2], Subscript[A, 2, 4], \
Subscript[B, 2, 6], Subscript[B, 2, 5], Subscript[B, 2, 9], \
Subscript[A, 2, 8], Subscript[B, 2, 7], Subscript[A, 3, 0], \
Subscript[A, 3, 1], Subscript[B, 3, 3], Subscript[B, 3, 2], \
Subscript[A, 3, 4], Subscript[B, 3, 6], Subscript[B, 3, 5], \
Subscript[B, 3, 9], Subscript[A, 3, 8], Subscript[B, 3, 7]}

if I change varA to {Subscript[A, 1, 9], Subscript[A, 2, 9], Subscript[A, 3, 9]}, the output is {Subscript[B, 1, 7], Subscript[B, 2, 7], Subscript[B, 3, 7]}

 

@Carl Love Many thanks.   I hope my days of sending silly questions will be over soon (I have been bothering you since 2016!).  

@acer Thank you.   Please don't apologize. The answer was spot on in the first post. 

@acer  Many thanks.  I didn't imagine that it would be that easy.  Many thanks.  Since you've mentioned the possibility of forming both in a single call, please show how it should be done.    

@Thomas Richard Many thanks.   It seems that the only improvement was from 2017 to 2018 and no change after that.

3 4 5 6 7 8 9 Last Page 5 of 13