57,182 reputation
5161254
bio website mathprogramming-intro.org
location St. Petersburg, Russia
age 37
visits member for 2 years, 7 months
seen 1 hour ago

Ok, an obligatory note: opinions expressed here are mine and not those of my employer.


Dec
13
revised Sorting function for non commuting bosons
Modified to better show the unit operator
Dec
13
comment Sorting function for non commuting bosons
@Karan Works for me too: expand[NonCommutativeMultiply[BosonA["a"], BosonA["a"], BosonC["a"], BosonC["a"]]] results in 2 NonCommutativeMultiply[] + 4 Boson[True, "a"] ** Boson[False, "a"] + (Boson[True, "a"])^2 ** Boson[False, "a"]^2. Make sure you use the corrected definitions for the boson operator formatting: I edited your post, since you had f instead of If in one place.
Dec
13
comment Sorting function for non commuting bosons
@Jens Thanks for testing and an upvote, good to know that it works. It basically does what we usually do by hand. But, if you ask me, it is esier to switch to path integrals, no operators - no problems :) (I am joking - operator formalism certainly has its merits)
Dec
13
comment Sorting function for non commuting bosons
@Jens No, I edited already after your comment on this, so you could not have used the edited version when you tried.
Dec
13
revised Sorting function for non commuting bosons
Corrected a bug in definitions for boson operator formatting
Dec
13
comment Sorting function for non commuting bosons
@Jens Right, I forgot to mention - should be If instead of f. I corrected it in the post.
Dec
13
comment Sorting function for non commuting bosons
@Jens Works for me expand[NonCommutativeMultiply[BosonA["a"],BosonC["a"]]] gives NonCommutativeMultiply[]+a^\[Dagger]**a
Dec
13
answered Sorting function for non commuting bosons
Dec
12
comment Find asymptotics of a function
@whuber Thanks for the bounty, b.t.w. :)
Dec
12
comment Find asymptotics of a function
@whuber I started writing the comment before yours appeared, but then got distracted by attempts to automatically neglect subleading terms, so that manual interference would not be needed. I did not quite succeed, published my comment and then saw yours :))
Dec
12
comment Find asymptotics of a function
Did not see the comment of @whuber, but what I got agrees with his estimate. The problem for usual expansion is that you have essential singularity, so standard tricks like expanding in 1/Log[n] around zero don't quite work.
Dec
12
comment Find asymptotics of a function
I think this is really much easier to do by hand. Expanding the log in denominator (after expanding the square), gives to the leading order -2^(1 - Sqrt[Log[n]]), which gives the final result to the leading order as 2^Sqrt[Log[n]] Log[n]. The log expansion can be done with this code Expand /@ Log[4^-Sqrt[Log[n]] + (-1 + 2^-Sqrt[Log[n]])^2] /. Log[1 + x_] :> Block[{y}, Normal@Series[Log[1 + y], {y, 0, 1}] /. y -> x]. (which is a fancy way of saying that Log[1+x]~x for small x)
Dec
12
comment Is there an issue tracker for already reported Mathematica bugs?
@halirutan I think Eric was speaking of those people in the industry who look at Mathematica more from a distance (think managers and pointy-haired bosses :)). They may not know about these nice user-developer interactions, but it is enough that one or two posts appear on some blogs where people would trash M based on the bug repository, that they will quickly form an opinion that it is "that buggy stuff", which would be very hard to change. I am not against your suggestion, I just think that what we here know is not quite the same thing as what more general audience might perceive.
Dec
11
answered Total elements of a list that have a common first element
Dec
11
comment Force integration to be linear over sum?
@AndrewJaffe That depends on the situation. The version of the Jens's answer will not attempt to compute the full integral, breaking it to pieces first. This one will first attempt to compute the full integral, and Distribute will work on the result. You probably do want this behavior in most cases, but I can also imagine cases where you don't want the full integration to be attempted. You could of course use this one with Unevaluated in those cases too.
Dec
11
comment Force integration to be linear over sum?
Nice application of Distribute - +1.
Dec
11
comment Force integration to be linear over sum?
@AndrewJaffe You can use a version like Replace[integrand, Plus[terms__]:>Plus@@Map[Integrate[#, mp] &,{terms}]. Since Replace only works on the level 0 by default, this should work fine. Yet another option is to create a custom function where you use pattern-matching to test the argument, like integrate[integrand_Plus]:=Map[...]. This will also effectively protect from inappropriate inputs.
Dec
11
awarded  Nice Answer
Dec
10
comment How do you deal with very large datasets in Mathematica?
You may also check out this question and answers therein, for some additional options.
Dec
10
comment How do you deal with very large datasets in Mathematica?
@ssch My framework is currently not optimized to work with huge data where each row is fairly small but the number of them is just huge. It's in the plans, but I haven't done so yet. One simple workaround is to store some fixed number of rows (like 100) in a single list element in the framework's list object, and use additional indexing to get the proper row. This should be not hard to add. The other part missing so far would be a more automatic way to convert files in other formats to the file-backed format used by the framework. After that, it should become fully usable.