# Questions tagged [python]

A general purpose high-level programming language that emphasizes ease of code syntax and readability.

158 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
172 views

### fastest way to compute many small dot products

I have two n-by-3 blocks contiguous in memory ("n vectors of length 3") and I'd like to compute the dot product between each of the rows as fast as possible. In numpy, using ...
192 views

### Implementation of Lanczos method that returns tridiagonal matrix

The Lanczos method can be used to obtain extremal eigenpairs of sparse symmetric or hermitian matrices. I know there are several implementations of the Lanczos method (as well as Arnoldi, Davidson, ...
129 views

54 views

### Solving multiple linear regression in parallel

I am working on a problem where I need to solve approximately 500 Million Linear Regressions (OLS). What would be the most efficient way to do this (e.g. using GPU or a some framework that can do this ...
409 views

47 views

### Lexicographically order matrix into a vector

I am trying to implement the algorithm contained in this article here. It is about solving a 2 and 2.5D Fredholm integral, focused on bidimensional NMR experiments. I've made significant progress, ...
296 views

### Heisenberg Model python : Specific heat capacity for spin 2

I have the correct plot for specific heat capacity when I am using the formula which is $C_V$ = differentiation of entropy with respect to temperature. However, When I try to calculate $C_V$, by using ...
101 views

### Efficient algorithm to determine the intersection volume of simple convex polyhedra

TLDR: Is there an efficient algorithm to compute the intersection of polyhedra with 8 or fewer vertices? I have two sets of FEM meshes for one geometry (one exhibiting a skin effect). I have to ...
349 views

### Showing date in Paraview's Annotate Time Filter

I have a time dependent data set where each frame corresponds to a certain date. I need to show the time annotation, much like what Annotate Time Filter does, but show the date instead of time as a ...
126 views

### 2D reaction-diffusion system simulation

I am a complete beginner in numerical simulation and I am pretty lost about how to tackle this problem. I have been trying for some time to find the steady state (or simulate), the following system ...
268 views

### Finding integer/lattice points (coordinates) inside a polytope/polyhedra?

I am using Python but I wouldn't mind changing language. All I have gotten from my research are tools to count the number of (lattice) points inside a region given the equations for the planes that ...
131 views

### Precision not improving by decreasing step-size in nonlinear Schrödinger

I tried to simulate soliton propagation by solving the nonlinear Schrödinger equation using the split-step Fourier method. The following is an example of the Matlab code copied from a textbook. ...
192 views

### Optimizing for loops by using Einstein summations instead

I have some Python code containing a couple of for loops, which I would like to optimize by using low-level functions. My first approach is to use ...
271 views

### minimalistic library for classical molecular mechanics force-field in C/C++/Python

I would like some classical molecular mechanics forcefield library or super-simple program which does not have any external dependences, so that I can plug it into my software without worry of "...
2k views

### Using RK2 Method to solve the simple harmonic oscillator of a horizontal mass on a spring (1D)

Being new to numerical analysis techniques, in particular RK2, I decided the best way to jump in is by using python to solve the well known mass-spring oscillator using RK2 techniques. My problem is ...
302 views

### How to reuse permutation-orderings within scipy's SuperLU-wrapper?

i'm solving sparse linear equations within scipy 0.18 which internally resorts to SuperLU (after umfpack got removed due to license-issues). Current, i'm doing a complete re-factorization in each ...
124 views

### Clustering similar words and mapping to numbers in Python

I'm familiar with kmeans to cluster data points, but not text.. So I have one column of words in cvs format, which I want to cluster those which have similar word or more, and then mapping those ...
227 views

### Very long running time for Haase and Muller (2014) coded in Python + Gurobi

I have read the paper of Haase and Muller (2014) where they present the linear reformulations of the multinomial logit choice probabilities and compare different approaches. I have tried for an ...
248 views

### scipy.linalg.sparse.eigsh does not work for generalised eigenvalues

I asked this question over at StackOverflow and someone told me that I'd get a better answer here. So here's my problem: I'm working on a machine learning project which involves doing a Principal ...