1,757 reputation
939
bio website
location
age 29
visits member for 2 years, 2 months
seen 3 hours ago

As time goes on, I grow more disillusioned with quantum field theory.


Oct
18
accepted How to re-parse (or re-map) character '.' to user-defined function
Oct
16
comment How to re-parse (or re-map) character '.' to user-defined function
@mfvonh This looks like what I need! But there are few issues: Inputing x.y^2 leads to some problems with rendering the boxes. Do you know how to fix it? Also. Dot[x,y] leads to x.y. But I'd like Dot not to get changed to . . Do you know how to stop this behavior? Thanks!
Oct
15
comment How to re-parse (or re-map) character '.' to user-defined function
Next, I tried to format the output of myDot. Following the link at the end of your answer, I came up with MakeBoxes[myDot[arg1__, arg2__], _] ^:= InterpretationBox[RowBox[{arg1, ".", arg2}], myDot[arg1, arg2]]. The problem with this is that (1) myDot[a,b] leads to Global'a.Global'b. How do I get rid of the Global context? and (2) myDot[a,b^2] leads to error message "An unknown box name (Power) was sent as the BoxForm for the expression. Check the format rules for the expression." Do you know how I can allow more complicated structures inside RowBox?
Oct
15
comment How to re-parse (or re-map) character '.' to user-defined function
Hmm... now that I think about it, the answer is actually no; it is not necessary, and probably wiser to always map . to myDot. The original reason for requiring that the arguments be symbolic is that if the objects on both sides of . had head List, then it should proceed to operate as built-in Dot on the two lists. But I realize this can be confusing to the users, and users would anyway fall back on explicit use of Dot to sum the products of list elements.
Oct
15
awarded  Tumbleweed
Oct
15
revised How to re-parse (or re-map) character '.' to user-defined function
added 1 character in body
Oct
15
comment How to re-parse (or re-map) character '.' to user-defined function
Very helpful! This is in the direction of precisely what I need. There is a strange effect that I need help understanding. Suppose (in v 9.0.1) I am now manipulating the expression in the following way: 3.14 + foo.bar/22 - Dot[x, y] /. myDot[x_, y_] :> x@y, I get the expected result. But look what happens when I surround the rule with braces: 3.14 + foo.bar/22 - Dot[x, y] /. {myDot[x_, y_] :> x@y}. I get a ToExpression::sntxi: error message, although the replacement is still successful. Do you know how to understand the origin of that error?
Oct
14
asked How to re-parse (or re-map) character '.' to user-defined function
Oct
14
comment Changing default behavior of Series to give slightly different SeriesData
Series seems to be smart enough to recognize that certain special functions have a pole. For example, Series[Gamma[x]],{x,0,1} and Series[BesselY[1,x]],{x,0,1} all give a leading 1/x. So either Series or the special function have some information that has been set...
Oct
14
comment Changing default behavior of Series to give slightly different SeriesData
I wrote answer answer to my own question here: mathematica.stackexchange.com/questions/60891/…. It looks like it is possible to define upvalues for Series. But as I mentioned there, it doesn't work for compound expressions. Is there a workaround?
Oct
13
accepted How to get `Series` to recognize user-defined function has pole
Oct
13
answered How to get `Series` to recognize user-defined function has pole
Oct
11
comment Fine tuning compiled code that computes dilogarithm function
@ybeltukov You know something interesting? My original code Sum[x^k/k^2., {k, 1, 23}] went faster than your suggestion Sum[x^k/k^2, {k, 1., 23}]. And Sum[x^k/k^2, {k, 1, 23}] goes even faster still! Maybe raising numbers to power exact 2 is better than raising to approximate 2, and performing sum with exact numbers is faster than with approximate numbers...
Oct
11
comment Fine tuning compiled code that computes dilogarithm function
I finished fixing the code so that SetSystemOptions[...] no longer complains. Many thanks to @ybeltukov for pointing this out, but I'm not entirely sure how it will benefit me. Any other suggestions would be most helpful.
Oct
11
revised Fine tuning compiled code that computes dilogarithm function
Edited code according to ybeltukov's comments
Oct
11
comment Fine tuning compiled code that computes dilogarithm function
Ok, I will fix this...
Oct
11
comment Fine tuning compiled code that computes dilogarithm function
Something strange is going on. When use SetSystemOptions[...] as you suggested, I get an error that region1, region3, etc.. all can't be compiled. But this is not true. For example, I can compile region1 just fine by replacing Function with Compile... strange..
Oct
11
asked Fine tuning compiled code that computes dilogarithm function
Oct
9
accepted Disable templates for user defined functions with usages
Oct
8
asked Catching error in middle of evaluation of compiled function