John Fredsted

2238 Reputation

15 Badges

20 years, 171 days

MaplePrimes Activity


These are replies submitted by John Fredsted

You can combine your conditions into one solve statement as follows:
s  := k[1,1]*x[1]+k[2,2]*x[1];
s1 := k[1,1]*x[1]+k[1,2]*x[2];
l := solve({
	coeff(s,x[1])=coeff(s1,x[1]),		# Your former l
	coeff(s,x[2])=coeff(s1,x[2]),k[1,2]=0	# Your former p
	},{k[1,1],k[2,2],k[1,2],k[2,1]}
);
assign(l);
It is a very nice function you here provide (one that I want to bookmark), one that gives the argument-number-path, so to speak. From your post I also learn that op([n1,...,nk],expr) = op(nk,...op(n1,expr)...) a fact I did not know, even though it appears quite clearly on the help page on op (having just, a bit late, I suppose, looked it up). Thanks for that. However, it is not quite what I need because, so it seems to me, it presupposes specific knowledge of what you are searching for. I need to be able to pull out, say, the part which contains all the entries (without any specific knowledge of these) of a matrix, that is, the _Inert_SET part. I (somehow) know how to do that, compare my former post, but I would like to know, from the Maple masters themselves, if there is some canonical, i.e., generally accepted, way to do such a thing.
Happy to hear that you have solved your problem. And now I have suddenly realized what you meant by the set T. It specifies your side relations. Actually, and that is quite embarrasing, I thought that simplify took only one argument, a misconception which lies behind one of the questions in my former post. After having consulted the help page on simplify, I now know otherwise. Oh boy, when will I ever learn to frequently consult those pages.
Happy to hear that you have solved your problem. And now I have suddenly realized what you meant by the set T. It specifies your side relations. Actually, and that is quite embarrasing, I thought that simplify took only one argument, a misconception which lies behind one of the questions in my former post. After having consulted the help page on simplify, I now know otherwise. Oh boy, when will I ever learn to frequently consult those pages.
Sorry, but I am still confused. I would like to know the following:
  • How do you define d(x)? Do you use Maple Document mode or Maple Worksheet mode? Could you show me the exact code for d(x)? In Worksheet mode I would define d(x) something like d := (x) -> a*x + b*y. But that seems useless in connection with the commutator because neither x nor y have the correct noncommutative prefix N.
  • If I define something like dx := a*N1 + b*N2, the expression Commutator(dx,N2) comes out correctly, i.e., it inserts the sum into the commutator. Of course, that definition of dx also seems pretty useless because it is not even a function. Anyhow, why do you not get any insertion of the sum into the commutator?
  • What do you mean by the set T? And what do you mean by simplify(Commutator(dx,y),T)?
Sorry, but I am still confused. I would like to know the following:
  • How do you define d(x)? Do you use Maple Document mode or Maple Worksheet mode? Could you show me the exact code for d(x)? In Worksheet mode I would define d(x) something like d := (x) -> a*x + b*y. But that seems useless in connection with the commutator because neither x nor y have the correct noncommutative prefix N.
  • If I define something like dx := a*N1 + b*N2, the expression Commutator(dx,N2) comes out correctly, i.e., it inserts the sum into the commutator. Of course, that definition of dx also seems pretty useless because it is not even a function. Anyhow, why do you not get any insertion of the sum into the commutator?
  • What do you mean by the set T? And what do you mean by simplify(Commutator(dx,y),T)?
I am afraid I do not understand your problem as presently formulated. Could you provide more information, or reformulate it?
I am afraid I do not understand your problem as presently formulated. Could you provide more information, or reformulate it?
I realized that too last evening after, naturally, having turned off my computer, and, even though I was quite certain that it would be commented on, I did not bother (sorry) to turn on my computer again because it takes quite a while to boot.
I realized that too last evening after, naturally, having turned off my computer, and, even though I was quite certain that it would be commented on, I did not bother (sorry) to turn on my computer again because it takes quite a while to boot.
Seconded regarding the Physics package part.
Is the suggestion given by Doug Meade really what you ask for? Using the function powerset, it seems to me that it mixes subsets of different sizes. To avoid that use choose as follows:
with(ListTools):
with(combinat):
classes := (A::listlist,n::posint) -> map(convert,[
	Categorize((x,y) -> evalb({x[]} = {y[]}),map(convert,choose(A,n),`+`))
],set):
Then, the various equivalence classes for sums of various subset sizes may be found as follows:
A := [[1,0,1,0],[1,1,0,0],[0,0,1,1]]:
classes(A,1);
classes(A,2);
classes(A,3);
Note that A must be provided as a list of lists.
Is the suggestion given by Doug Meade really what you ask for? Using the function powerset, it seems to me that it mixes subsets of different sizes. To avoid that use choose as follows:
with(ListTools):
with(combinat):
classes := (A::listlist,n::posint) -> map(convert,[
	Categorize((x,y) -> evalb({x[]} = {y[]}),map(convert,choose(A,n),`+`))
],set):
Then, the various equivalence classes for sums of various subset sizes may be found as follows:
A := [[1,0,1,0],[1,1,0,0],[0,0,1,1]]:
classes(A,1);
classes(A,2);
classes(A,3);
Note that A must be provided as a list of lists.
Happy to hear that you solved your problem.
Happy to hear that you solved your problem.
First 49 50 51 52 53 54 55 Last Page 51 of 68