# All Questions

32 questions
Filter by
Sorted by
Tagged with
806 views

### How to speed up large double sums in a table?

I am calculating a 3-by-3 matrix whose elements are given as follows: $$M_{mn} = \frac{1}{N}\sum_{i=1}^N \sum_{j=1}^N (r^i_m - r^j_m)(r^i_n - r^j_n) \tag{1}$$ where $N$ is the total number of ...
92 views

### Efficiently define a function as the numerical result of infinite sums

I want to approximate the solution to the following sum, in such a way that I can plot the function for the variable $\phi$, for a fixed value of $\mu$. \begin{equation} f(r(\phi), \mu)=4 e^{-\mu ...
72 views

### How to speed up summations with many list callings?

I am trying something similar to the following code with NN as large as a few hundred (at least 100). Now it's very slow and most time is spent on calculating the ...
41 views

### Performance Tuning: Construction of Matrix with Summations

I am trying to solve an eigenvalue problem of a large matrix. The issue is that it takes too much time to construct this large matrix. This is the code that I built: ...
52 views

### How do I make this summation work faster?

Is there any way to make this summation be faster? I previously had spherical harmonics integration which was taking forever to run How can I do a faster integration? Using math, I tried to use ...
750 views

### How to optimize Mathematica code that depends on eigenvalues of big matrices and big sums?

I've been using Mathematica recently to generate some plots of a few functions. I've been able to get it right after a few questions here. The resulting code, which works, is this: ...
329 views

### Speeding up the calculation of a binomial sum

Is it possible to speed up this calculation? A[j_, p_, n_] := Sum[Binomial[n, k] p^k (1 - p)^(n - k), {k, 0, j}] Plot[{A[j, 0.5, 12000]}, {j, 0, 12000}] Thanks!
64 views

### Sum of part of a list that increases in length

I have a list of numbers whose length increases by 1 for every iteration of a loop. I need to take the sum of the last 5 elements of the list, and if the list's length is smaller than 1 I need to have ...
103 views

### Why does this nested sum appear to sleep between iterations?

I have a weird performance problem in a nested sum, which I've reduced to the following test case: ...
142 views

### Faster sum of products of tuples?

My function: sumprob[lst_,size_]:=Sum[Product[x,{x,part}],{part,Tuples[lst,{size}]}]; Example: ...
457 views

### Speed up double summation

Is there any way how to speed up this double summation? ...
134 views

### Why is summing 1 million slow? [duplicate]

I was playing around with Sum and noticed that summing all integers from 1 to a million is order of magnitudes slower than summing other numbers ...
43 views

### Error with Parallel Calculation on Large Multiple Sums [closed]

I am attempting to complete the following quadruple sum: ...
108 views

### Accessing the elements in a table is slower than calculating each time?

This is a follow-up of How to accelerate combinations and sum calculations here? I have tried all tricks but when N reaches 35 the time is still intimidating in a 16-core server, which is far better ...
145 views

### How to accelerate combinations and sum calculations here?

I have a 4d matrix H defined as below (embedded with combinations and sums) ...