« first day (2469 days earlier)      last day (2005 days later) » 

12:26 AM
I have defined a potential of the form
V[x_] := Piecewise[{{-\!\(TraditionalForm\`5.368246726385419*
\*SuperscriptBox[\(10\), \(-9\)]\)*(x - 2*10^-7), x < 2*10^-7}, {0,
2*10^-7 <= x <= 11*10^-7 }, {Infinity, x >= 11*10^-7}}]
and L = -[HBar]^2/(2*m)*y''[x] + V[x]*y[x];
{vals, funs} =
NDEigensystem[L, y[x], {x, -1, 11*10^-7}, 50,
Method -> {"SpatialDiscretization" -> {"FiniteElement", \
{"MeshOptions" -> {MaxCellMeasure -> 0.0001}}}}]
the eigenvalues i get are the wrong order of magnitude
and plotting one of the interpolated functions i cant get it doesnt go to zero at x = 11*10^(-7)..
i guess i have to explicitly impose the BCs somehow?
 
@getafix what units are you using? Those look terrible for numerical methods. Use more natural units (e.g. Hartrees or Wavenumbers) and life will be nicer I'm assuming. Also instead of Infinity pick some huge number instead. It'll get the same effect in a numerical method.
Is this suppose to be a particle-in-a-box variant with a linear left boundary?
 
uhh cgs units erg, cm etc.
@b3m2a1 yes indeed
 
I generally use wavenumbers and cm and the scale of the problem works out nicely
 
i see, can i ask a couple of questions about the syntax? under NDeigensystem
how to appropriately choose the specification, {x,..}
 
@getafix sure but I might not be able to answer them. I barely use it.
 
12:39 AM
and also, by choosing a huge number, i just chucked in 10^4, the results don't change much. So i guess it is an issue with units? I should translate my problem into better units?
 
I think so.
Things like 10^-7 don't play terribly well with machine precision
 
hmm I see..yeah the computer science confuses me more than the physics
 
I just multiplied everything by that and used a right barrier height of 10^9 and got this computing the energies over the range {-5, 20}:
{0.00225353, 0.0090127, 0.0202789, 0.0360498, 0.0563269, 0.0811067, \
0.110392, 0.144178, 0.182465, 0.225252}
Now these energies mean nothing as who knows what units they are and I didn't translate HBar at all
But it shows that it's possible to get totally normal energies just by rescaling
 
hmm but at least for me the Interpolating function doesn't go to zero at the BC..could that be fixed too by simple rescaling?
^That is the issue i am having right now..
 
Yeah and not using Infinity
 
12:45 AM
i will try rescaling, thanks though! :)
 
This is what I get for wavefunctions off a DVR:
For, again, some random parameters
But it looks like a particle in a box on the right and and not so particle-in-a-box on the left
The amount of penetration of course changes with the mass
 
yeah that matches with my physical intuition
how do you implement DVR in mathematica?
actually do you know of any good resources/textbook..for doing QM in mathematica
you seem to know a lot of stuff, so I thought I'd ask
 
If you want to roll your own use the Colbert and Miller DVR. It's really clean. Otherwise I have a package that does it: github.com/b3m2a1/mathematica-ChemTools/wiki/DVR
I just implement what I read in papers
If you want to use numerical methods like this I'd reccommend reading a lot of the performance tuning things here. Compile is useful (I used that for DFT) and knowing about SparseArray and packed arrays is a must.
@HenrikSchumacher does a lot of numerical stuff on meshes that can be used as inspiration for grid-based-methods
But there's a huge amount of information on this site about these things. On the other hand...I have no idea if this is in any textbook anywhere.
Most of the numerical differential equations ones I've seen use MATLAB or numpy or things like that.
@getafix by the way, here's an example of how NDEigensystem can be used in physics: mathematica.stackexchange.com/a/179308/38205
I use it to get radial wavefunctions for He in DFT there
 
Oh thanks a lot!!! I will try to digest this
 
1:44 AM
@CarlLange Thank you. yeah, I've seen the entities. I like that they're built-in, every self-respecting language should have that :P
 
2:32 AM
@b3m2a1 hey! if you are still around, I have a few small questions for you.
I was able to re-scale (hopefully correctly) moving from cgs units to a.u.
my eigenvalues converted back to erg...somewhat agree with what I expect to get..order of magnitude wise
plotting the interpolating function from the o/p it sorta goes to zero where it is supposed on the right...but not on the left..
V2[x_] :=
Piecewise[{{-\!\(TraditionalForm\`\(TraditionalForm\`6.\
516689755422356`*^-7\)\)*(x - \!\(TraditionalForm\`37.79451977158`\)),
x < 37.79451977158`}, {0,
37.79451977158` <=
x <= \!\(TraditionalForm\`207.86985874369`\) }, {10000,
x >= \!\(TraditionalForm\`207.86985874369`\)}}]
{evals, efuns} =
NDEigensystem[L2, y[x], {x, 35, 208}, 50,
Method -> {"SpatialDiscretization" -> {"FiniteElement", \
{"MeshOptions" -> {MaxCellMeasure -> 0.01}}}}]
I ran in the neighbourhood of the two walls, 35 and 208.and had to reduce the cell measure because it was taking way too long on my computer..do you know of a way to enforce the other BC
 
 
4 hours later…
6:18 AM
@getafix I think you might not be extending enough into the left-hand boundary. The wavefunction can't be allowed to hand amplitude out there, which means the potential needs to extend high enough. It looks like either the mass is too small or 35 isn't far enough out there. You could also make the left-hand-wall steeper.
In terms of cell-measure you should probably pick that so you get enough grid-points. For DVR I tend to go for like 250 in 1D (since 1D is so cheap). If I need to sample my potential really well I'll go up to 900, but I don't like waiting over 1s for results :)
And 900-1000 is like a 1s calculation
 
@b3m2a1 so..I have been dicking around with it for a bit..
{evals2, efuns2} =
NDEigensystem[{L2, DirichletCondition[y[x] == 0, x == -10^3],
DirichletCondition[y[x] == 0, x == 207.86985874369]},
y[x], {x, -10^3, 207.86985874369}, 50,
Method -> {"SpatialDiscretization" -> {"FiniteElement", \
{"MeshOptions" -> {MaxCellMeasure -> 0.01}}}}]
 
Does it work? I don't have L2 defined from you
 
at least qualitatively gives me a first eigenstate that hits zero at the right boundary, and decays on the left
my L2 is
 
That looks about right.
 
L2 = -1^2/(2*m2)*y''[x] + V2[x]*y[x];
m2 = 1.16*10^-23*10^-3*1.097768382881*10^30
^I just converted the reduced mass i had in g from my problem to atomic units (hopefully correctly)
i might try picking up the cell measure on a bigger computer
also, the Interpolating functions that mathematica spits out, after assing them to something like y[x]:=.. I can just call them and treat them like regular functions while plotting, NIntergrating etc.?
 
6:37 AM
@getafix Yeah that should work fine. I don't know how they're normalized, though, so you'd might want to check with @user21 to see what he knows.
They're probably not constrained to have norm 1 since NDEigensytem doesn't know it should expect L^2 functions.
@HenrikSchumacher can one use MathJax in chat here...?
 
Ahh okay, I didn't know that about NDEigensystem..but then again, it has no reason to expect that in general, I supposed.
 
@getafix I mean the solution it generates might be L2 automatically. I don't really know. I just know that other quantum-chem methods are intentionally constructed with wavefunctions in mind, but NDEigensystem just computes the spectrum of a differential operator, if I have my terminology right, and who knows that looks like in general.
 
yeah I get what you mean.
although I just tried NIntegrate for the first 2 eigenstates over the range I plotted them, and they seem to integrate to 1..
I think imma call it day for now, and see if I can catch a hold of user21 tomorrow, and if he is free, pick his brain a little..
Thanks for all your help! :)
 
7:12 AM
@b3m2a1 I don't know of a simple way. But I just found this post: meta.stackexchange.com/a/220976
 
7:46 AM
Can someone remind me how to make M's live spell checker be happy with British spellings?
 
8:24 AM
@Szabolcs Hmm, for me both GB and US words are correct
CellPrint[Cell["aerofoil airfoil", "Output", ShowAutoSpellCheck -> True,
  LanguageCategory -> "NaturalLanguage"]]
 
8:41 AM
@halirutan Now it works for me too. I don't know what went wrong before ..
It works:
@halirutan I don't use the image uploader much anymore because if often hangs for a very long time before it actually uploads. Do you experience this as well?
(It just happened again.)
When not uploading for a comment or chat, I usually do Copy As -> Bitmap (available on Mac), then simply paste into the image upload box (possible with Chrome).
 
8:58 AM
@Szabolcs I'm not sure on my side. I experience this as well, but for me, even the built-in uploader dialogue has gotten slow.
And there is not much room for error. We haven't changed anything so it is very likely a network issue with imgur. I'm quite certain that our site is one of the major players when it comes to uploading images. Maybe they limit our usage.
 
 
1 hour later…
10:16 AM
Or maybe Rasterize has gotten slower...
 
 
3 hours later…
1:26 PM
LibraryFunctionLoad performance on Mac has been consistently declining with newer versions. Is this also true on other OSs? Here's a test (nothing needs to be compiled as this example library is included with M):
Do[fun = LibraryFunctionLoad["demo", "demo_I_I", {Integer},
    Integer], {230}] // AbsoluteTiming
I get 1.57 s in 10.0 and 2.89 s in 11.3. Why would there be such a big difference? Does this function get slower when more functions are already loaded?
 
@b3m2a1 @getafix @b3m2a1 the NDEigensystem refpage has a section called 'Properties and Relations' that talks about the normalization used.
@Szabolcs I see the same but I do not know how this comes about.... 
 
2:07 PM
@user21 Yup! Found it Thanks! :)
 
2:59 PM
Anyone know if Mathematica can read in .czi images?
 
 
1 hour later…
4:07 PM
@KraZug Unlikely. But you can use this code and build a JLink Wrapper.
 
@KraZug not at a desktop now but i would check github.com/WolframResearch/BioFormatsLink
 
5:02 PM
@halirutan There is a bioformats link, see above. And now that I actually got a chance to look at it, I see that it extends Import. As I remember, it was you who asked about how to extend Import through a paclet.
 
5:21 PM
some quick initial tests look pretty promising. github.com/WolframResearch/WolframClientForPython
 
5:34 PM
@C.E. selector/XMLGraph syntax is pretty powerful and programmatically very clean. (although I'm sure there are many who don't like the obj@"method"[...] syntax I used to suppress the number of publicly exported symbols). Here's a query as it would be done in plain Mathematica:
Cases[testXML,
  XMLElement["td",
     _,
    code_
    ] :>
   FirstCase[code, XMLElement["code", _, {s_, ___}] :> s,
    Nothing, \[Infinity]],
   \[Infinity]
  ] // DeleteDuplicates
Here's the equivalent selector-based syntax:
First /@ Values@
  g@"Children"[g@"Select"["td code"]]
Both get you to the same spot
And really the First /@ Values is just because queries into the graph return an association with the node ID, which is in many ways more useful than the raw XMLElement structure.
 
5:54 PM
@b3m2a1 It looks very nice! Much better than parsing symbolic XML.
 
6:22 PM
@Szabolcs, thanks. I'll take a look at the BioFormatsLink tomorrow.
Looks promising, as the java part includes ZeissCZIReader
 
7:12 PM
@C.E. I think I love CSS selectors. This would be a huge Cases call:
seg = XMLGraph@
   Import["https://mathematica.stackexchange.com/", "XMLObject"];

nodes = seg@"Select"[".summary h3 a", 2]

{"a:aa6a457e", "a:7243db38"}

AssociationThread @@
 Flatten@*Values /@

  Through[{seg@"Attribute"[#, "href"] &, seg@"Children"}@nodes]

<|"/questions/184388/unable-to-implement-bisection-method-using-\
recursion" -> "Unable to implement bisection method using recursion",
 "/questions/184399/appending-numericq-automatically-to-every-\
variable-of-a-function-in-the-defini" ->
But instead getting the links and titles off the SE homepage is like a two-line process.
 
I'm trying to export a high resolution & size image from mma
eg Export["i.tiff",%3,ImageResolution->360, ImageSize->{4666, 6221}]
but I keep getting
Rasterize::bigraster: Not enough memory available to rasterize Cell expression.
anybody have a workaround?
 
7:27 PM
I'm doing it via wolframscript so hopefully not the frontend screwing up? but I don't really know.
best I can do is an IMageResolution of 140
 
@CarlLange Let's just wait for 12.0!
:)
 
Haaaa
I'm impressed you remembered that
anyway, my fix was to do Image@%3, for some reason that worked fine
(it was a Graphics before)
 
@CarlLange not sure how big your %3 is but the following runs with no issues on 12.0 PR2!
img = RandomImage[1, {10000, 10000}, ColorSpace -> "RGB"];
Export["i.tiff", img, ImageResolution -> 360,
 ImageSize -> {4666, 6221}]
 
Ah, what happens if you add a Show infront of img?
 
@b3m2a1 yup, I love it too. It's very elegant.
 
7:33 PM
@CarlLange wow, a surprisingly smooth-scrolling multi-screen image. surprising for the Mac front-end, historically, that is!
 
@kirkus Hey, great news!
 
@CarlLange so get yourself the pre-release :)
 
:)
That's really good news, delighted to hear the new osx frontend is actually going to be an improvement rather than a sidegrade
 
@CarlLange it is shockingly faster.
and I filed a handful of bugs in PR1 that are fixed in PR2, so they seem to be paying attention to getting it right
 
8:11 PM
@kirkus, how do you get access to the pre-release version?
 
 
4 hours later…
11:58 PM
@KraZug it's been awhile since I got in the program, but IIRC, try sending a request email to prerelease@wolfram.com
 

« first day (2469 days earlier)      last day (2005 days later) »