Reputation
87,843
Next tag badge:
821/400 score
77/80 answers
Badges
6 231 496
Newest
 Nice Answer
Impact
~1.1m people reached

1h
revised Small World network on a square grid
added 1 character in body
1h
revised Small World network on a square grid
added 1 character in body
1h
comment Small World network on a square grid
Marginal to your question, but it's good to not that if you start with the grid shown here, the rewired networks will not have the small world property as originally defined by Watts and Strogatz because a simple lattice like this does not have a high clustering coefficient.
1h
revised Small World network on a square grid
added 2334 characters in body
1h
answered Small World network on a square grid
2h
comment UnitaryMatrixQ function not returning true for a unitary matrix
@Xavier Thank you for the comments, I did not know that. Is it otherwise generally true what I said about Q functions? Are you aware of other exceptions (which are not as trivial as IsomorphicGraphQ saying that multigraph isomorphisms is not yet implemented)?
11h
comment Small World network on a square grid
The IGraph/M package has the IGRewire function which will randomly rewire edges while keeping the degree sequence. There's also IGRewireEdges which keeps the total number of edges (thus also the average degree), but it does not preserve the degree sequence. Take a look. These can be implemented in pure Mathematica too, but I would be lazy to do that ;-) GridGraph will be useful too.
12h
answered UnitaryMatrixQ function not returning true for a unitary matrix
12h
comment UnitaryMatrixQ function not returning true for a unitary matrix
it is SameTest -> (FullSimplify[#1 - #2] == 0 &). If the SameTest doesn't return an explicit True, it is automatically assumed to be False (as if TrueQ were applied to it, think TrueQ[a==1]). At least that's my idea about what is happening. Thinking about it like this explains the behaviour and makes some sense. I'm not sure if these comments constitute an answer ... I'll leave them as comments for now.
12h
comment UnitaryMatrixQ function not returning true for a unitary matrix
But the function just says False. So maybe this should be interpreted as "Hermitian for any value of a,b,c,d"? But that interpretation brings its own problems too: sometimes the system just won't be able to check and come to a certain conclusion, yet the function will always return either True or False. So what is going on? I think that what is really happening is that the function computes the required criterion (i.e. $U\dagger U=I$), but then leaves it to the SameTest setting to test that condition. You can set this manually and the documentation gives an example where
12h
comment UnitaryMatrixQ function not returning true for a unitary matrix
Interesting observations. I never used these functions. There's this (as far as I know unwritten) rule that ...Q functions will always return either True or False but nothing else. Think Equal vs SameQ. a==1 stays unevaluated but SameQ always evaluates. It's also a reason why Positive is not PositiveQ: Positive[x] does evaluate until x gets a value. In light of this I find it a little strange that UnitaryMatrixQ and HermitianMatrixQ have the ...Q naming and behaviour. Is {{a,b},{c,d}} Hermitian? Well, it depends on the value of b and c!
14h
comment Rounded rectangle with color gradient
First ideas: You can use Texture or you can write a formula for a rounded rectangle and use RegionFunction with DensityPlot.
21h
revised Display line number/stack trace of error in script (i.e. batch mode / command line interface)
added 13 characters in body
21h
revised Display line number/stack trace of error in script (i.e. batch mode / command line interface)
added 242 characters in body
21h
answered Display line number/stack trace of error in script (i.e. batch mode / command line interface)
21h
comment Display line number/stack trace of error in script (i.e. batch mode / command line interface)
Mathematica will report the line number of a syntax error. It cannot report the line number of an arbitrary Message because there's no direct link between the in-memory program and the source file. In most of the cases there is no source file at all. Definitions can be issued from the command line, or created completely programmatically. Looking at the title of the question my first reaction would be to say, "inherently impossible". But you are not asking only for line numbers but also for some sort of stack trace, which should be possible. Therefore I suggest re-titling the question.
23h
comment Using ListInterpolation to get a vector-valued function
You could use Interpolation instead of ListInterpolation, but settling for three ListInterpolations might be easier actually. Personally I would go for three ListInterpolations.
23h
comment Using ListInterpolation to get a vector-valued function
Can you note in your question that Interpolation does support interpolating arbitrary dimensional vectors? Just to get this out of the way.
23h
comment read Python-generated data file
How many elements are there approximately? The simplest solutions tend to be the slowest, and often Interpreter is the simplest: Interpreter["ComplexNumber"]["-0.998722569699-0.000124681423362j"] does work for this form.
23h
comment How to equate coefficient of two polynomials?
Are you looking for SolveAlways?