-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
non-commuting functions, denominators, and brackets #466
Comments
The problem here is that using the 1/(…) is a built-in function that is not very powerful.
To begin with, it is only simplified in the simplest of cases. And Form does not look inside
it, once it is not simple. Hence it does not know whether the content is commuting or not.
Therefore it has to assume that it is non-commuting.
Basically this function is tolerated, but you are far better off to define your own denominator
function like den(x1-x2) stands for 1/(x1-x2). In that case you can decide yourself whether it
is commuting. Also, in that case, all rules of pattern matching apply. The 1/(x1-x2) variety
cannot do much with pattern matching and other operations on functions.
… On 18 Jan 2024, at 17:34, Joachim Brod ***@***.***> wrote:
Hello, just a quick question (not very urgent). Is there a reason that fractions of e.g. symbols are pulled out of a bracket if they are to the left a non-commuting function that is bracketed? I.e. it seems that denom_ is internally always treated as non-commuting (why)?
As a simple example, this code
s x1,x2;
f fun;
l exp1 = fun(x1) + 1/(x1-x2) * fun(x1);
b fun;
print +s;
.end
gives two terms in the final result:
exp1 =
+ 1/( - x2 + x1)*fun(x1) * (
+ 1
)
+ fun(x1) * (
+ 1
);
This does not happen if fun is commuting, or if in my expression I have the denominator to the right of fun.
Just curious -- thanks for any comments!
—
Reply to this email directly, view it on GitHub <#466>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABJPCEWEJNEXJIKTWS2KQZTYPFFLFAVCNFSM6AAAAABCASONEGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA4DQNRVHE2DAMQ>.
You are receiving this because you are subscribed to this thread.
|
OK, thanks for the quick clarification and the advice! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, just a quick question (not very urgent). Is there a reason that fractions of e.g. symbols are pulled out of a bracket if they are to the left a non-commuting function that is bracketed? I.e. it seems that denom_ is internally always treated as non-commuting (why)?
As a simple example, this code
gives two terms in the final result:
This does not happen if
fun
is commuting, or if in my expression I have the denominator to the right offun
, or if the symbols appear only in a numerator.Just curious -- thanks for any comments!
The text was updated successfully, but these errors were encountered: