Hot answers tagged

6

Since Mathematica 10, there is the TypeSystem` Context, that is nearly what you might be looking for. It is just a wrapper around patterns. TypeSystem`ConformsQ[ {1, 2, 3}, TypeSystem`Vector[TypeSystem`IntegerT, 3] ] (* --> True *) It is the thing being used internally by Dataset-related functions. (Maybe one should say something like Dataset[{}] ...


4

A standard way to do this is to Hold it, and Release when needed: r = Hold[D[f[x, y], {x, 2}]] Release[r] Release[r /. f[x, y] -> x h[x, y]] Compare the above to D[x h[x, y], {x, 2}] it is the same.


3

Some of these could be implemented differently, of course, but I've gone the way of making all of them pure functions (in the Mathematica sense). Every single one takes a Sequence of arguments as the inputs, but some of them accept function names as inputs first, and the projection function accepts an integer for which argument is chosen (I have chosen to ...


3

I'm a little bit late to this party, but I had written this function for another question that turned out not to need it, so I'll put this here. My strategy is to straightforwardly calculate the integral via $$ \begin{align} \int f(\vec x) &\, \exp\left( - \frac 1 2 \sum_{i,j=1}^{n}A_{ij} x_i x_j \right) d^nx = \\ & \sqrt{(2\pi)^n\over \det A} \, ...


2

Starting in version 10 you can use Inactivate and Activate. w = Inactivate[D[f[x, y], {x, 2}], D] wh = w /. f[x, y] -> x^2 h[x, y] Activate@wh Hope this helps.


2

As suggested already in the comments it is easier to work in a concrete basis e.g. as follows: x = {1, 0} ; y = {0, 1}; bv[a_, b_] := Flatten[KroneckerProduct[a, b]]; Then you can calculate your particular examples easily: (a*bv[x, x] + c bv[y, x]).(b bv[x, y]) (* 0 *) (a*bv[x, x] + c bv[x, y]).(b bv[x, x]) (* a*b *) Using the symbolic tensors in ...



Only top voted, non community-wiki answers of a minimum length are eligible