Reputation
58,855
Next tag badge:
144/100 score
18/20 answers
Badges
2 90 230
Newest
 Nice Answer
Impact
~791k people reached

Jun
24
comment How to obtain all the distinct De Bruijn sequences?
I can reproduce the result in the question on version 8.0.4
Jun
24
comment How can we ensure the result of Mathematica is exactly correct?
I think this answers the issue that caused the question (+1). The title of the question is too broad to allow a better answer.
Jun
24
comment Finding the eigenfunctions of one and two dimensional Harmonic Oscillator
It's in there. Look carefully under Options.
Jun
24
comment Finding the eigenfunctions of one and two dimensional Harmonic Oscillator
Maybe I don't understand what you're asking. Perhaps you merely want to add the option DataRange -> {{-4,4},{-4,4}} as I did in this answer for the 1D case. You can look at the documentation for ListPlot3D for details on this option. This must be what you're after...
Jun
24
comment Finding the eigenfunctions of one and two dimensional Harmonic Oscillator
@SomeBody Because it's the ground state.
Jun
24
comment Matrix operations performed with column-vectors
Oh, I get it. So m2 is the "storage" for the results...
Jun
24
comment Matrix operations performed with column-vectors
Actually, m2 vanishes. So the result can be taken to be the columns of b alone, right?
Jun
24
comment Matrix operations performed with column-vectors
This seems to be precisely what you would get by just doing m1.m2 + b and extracting the columns of the result.
Jun
24
comment Export high resolution figure causes missing ticks
I envy your optimism...
Jun
23
comment Finding the eigenfunctions of one and two dimensional Harmonic Oscillator
That's what the earlier answer addresses. I don't think I can say anything beyond that.
Jun
23
comment Finding the eigenfunctions of one and two dimensional Harmonic Oscillator
No, that won't work. The real problem is that this is an elliptical boundary-value problem, for which NDSolve is not always able to give the solutions you want. That's why the approach based on matrix diagonalization is still necessary. In one dimension, the boundary-value problem isn't too hard because there is only one independent variable. But when there are more than 2 variables, you have a partial differential equation for which NDSolve is usually not able to find a solution.
Jun
23
comment Finding the eigenfunctions of one and two dimensional Harmonic Oscillator
But then you can't blame Mathematica for giving you the exact solution satisfying your approximate assumption.
Jun
23
comment Finding the eigenfunctions of one and two dimensional Harmonic Oscillator
Regarding the added term on the diagonal that you removed in my other answer: changing the diagonal shifts all the eigenvalues. In particular, omitting that positive offset makes some eigenvalues negative. But Mathematica always sorts the eigenvalues in descending order of absolute value. This will place the desired ground state somewhere in a (hard to find) non-extremal location in the list of eigenvectors. That's why you think you see nonsense. It's just a wrong eigenstate, not the ground state.
Jun
23
comment Finding the eigenfunctions of one and two dimensional Harmonic Oscillator
@acl - indeed, it's easy to overlook things like "Jens" hidden in a new question...
Jun
19
comment Plotting large datasets
@MichaelE2 Ah yes, great catch. I can't count the number of times this has bitten me before... usually I look for this pitfall when something slows down so much, but this time I just resorted to manual tuning.
Jun
15
comment Schrödinger eigenvalue problem in two dimensions (Harmonic Oscillator)
@NoOne With the scaling I used, the issue is that small a must be compensated by larger nX in order to avoid overlap of the wave function with the grid boundary where the finite-difference method fails. I added that to the end of the answer.
Jun
14
comment How to open Mathematica from the terminal in OS X
Related: How to create an executable notebook in Mac OS X
Jun
14
comment Schrödinger eigenvalue problem in two dimensions (Harmonic Oscillator)
@NoOne Ah, version 7 doesn't have AdjacencyMatrix - I'll add an alternative approach later. I thought what I did was actually more likely to work in all versions, but I guessed wrong...
Jun
14
comment Schrödinger eigenvalue problem in two dimensions (Harmonic Oscillator)
@NoOne No, you do have to modify the potential to make it consistent with the periodic boundary conditions. This could be done artificially while still maintaining a parabolic minimum in the center. But I'll have to let you try to figure that out yourself... in the meantime, could you modify your original question to include the ho potential $x^2 + y^2 + x y$? That's the more doable test case, after all.
Jun
14
comment Schrödinger eigenvalue problem in two dimensions (Harmonic Oscillator)
Actually, this is pretty much the simplest approach I can think of. By using NDSolve functionality, I only meant that the approximation for the second derivatives in the kinetic energy can be improved using some built-in functions. But the remainder, i.e., the construction and diagonalization of h, will stay the same. I'll hopefully get to that modification tomorrow.