# Tag Info

### How to raise a vector to powers contained in a vector, change the list into a product, and do this for all the lines of a matrix, efficiently?

Use Inner Inner[Power, var, #, Times] & /@ expo (* {x[1],x[2],x[3] x[4],x[2] x[5]} *)
• 2,570
Accepted

### Faster simulation of two spins

Everything, up to your last expression can be solved analytically. ...
• 5,470

### How to raise a vector to powers contained in a vector, change the list into a product, and do this for all the lines of a matrix, efficiently?

This feels like I was just following the directions in the OP: Times @@ (var^#) & /@ expo
• 241k

### How to raise a vector to powers contained in a vector, change the list into a product, and do this for all the lines of a matrix, efficiently?

Here is another Inner strategy: Inner[OperatorApplied[Power], expo, var, Times]
• 31.7k

### Nested For runs really slow

The For loop is not the whole problem here: even AbsoluteTiming[Do[i = 1, M, M, M]] (* {4.50839, Null} *) takes very long....
• 49.3k

### How to optimize performance with DeleteDuplicates?

I build upon A. Kato's idea to use a normalization: First turn each element into a unique representative of the equivalence class. Then run vanilla DeleteDuplicates....

### How to optimize performance with DeleteDuplicates?

This answer is for the case where the order does matter. While OP's question asks for case where the order does not matter at any level. First of all rules can be ...
• 20.9k

### How to speed up estimation of mean and Gaussian curvatures on triangular meshes?

This is longer than a comment hence the new answer (it also took a few years to get around to testing everything... ). The answer by @user68078 shows how to implement a much faster version of the MDSB ...
• 4,123
Accepted

### Problem with illustrating pathways

The code is a bit heavy and slow as you are not taking advantage of a few built-in functions or functional programming patterns. I applied a functional programming approach which reduces the code and ...
• 43.1k
Accepted

### Help defining all pathways of a sample from the same start-point

Recursive function call will help you. (I understand that $x_0, x_1,..., x_7$ are all distinct, and a permutation of all the points in $S$.) ...
• 2,570

### How to raise a vector to powers contained in a vector, change the list into a product, and do this for all the lines of a matrix, efficiently?

expo . Log@var // Exp (* {x[1],x[2],x[3] x[4],x[2] x[5]} *)
• 958
1 vote

### Speeding up NMaximize for an optimisation problem in thousands of variables

I have played with smaller numbers, decreasing accuracy, and obtained the following. ...
• 27.7k
1 vote
Accepted

### Faster evaluation of matrix operation

Essentially, your code is a double loop: the outer loop goes over n (with a trip count of 750) and the inner loop goes over the list ...
1 vote

### Problem with illustrating pathways

Function paths[s] finds all possible paths for set of points s. Function hg[path] highlights ...
• 20.9k

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