Questions tagged [algorithms]

For questions about an algorithm as it relates to physics. DO NOT ask how to implement an algorithm, questions like that belong on Stack Overflow or Computational Science. DO NOT ask about the efficiency of an algorithm, or other such questions, questions like that belong on Computational Science.

Filter by
Sorted by
Tagged with
1 vote
0 answers
35 views

Why are time-reversible integration algorithms in molecular dynamics simulations favorable?

I read that integration algorithms that are not time-reversible tend to be less "stable". Where stable means that the total energy stays constant (is conserved). I'd like to know what it ...
user avatar
0 votes
0 answers
29 views

Cosmology: Can we compute the curve of scale factor $a(t)$ from Angular and/or Matter power spectrum?

I have generated matter power spectra (with CAMB and CLASS codes) which are in agreement: and also angular power spectra: I would like to be able to infer from these spectra the curve of scale ...
user avatar
  • 1
-1 votes
1 answer
100 views

Brans-Dicke's model: how to shift to the left the curve of scale factor to get a standard age for universe?

Using a MCMC code that implements the Brans-Dicke's model with all the modified equations of field. Finally, I get this curve that represents the scale factor versus cosmic time: with the following ...
user avatar
  • 1
0 votes
0 answers
15 views

Shifting polynomials in Fast Multipole Method

There is one thing I don't get about the FMM algorithm (of coulombic potential in 2D - https://cims.nyu.edu/~donev/Teaching/WrittenOral/Projects/JasonKaye-WrittenAndOral.pdf). Suppose we have ...
user avatar
  • 1
0 votes
0 answers
19 views

Are there ways to find representations of matrices given an algebra?

Given an equation (or a set of equations) involving matrices, is there an algorithm to find possible representations of these matrices? For example, we can consider a matrix $A$ such that $A^2=\begin{...
user avatar
1 vote
0 answers
4 views

Applying Divergence to query moving points

Problem statement :- There is a moving source($s$) and other moving points ($p_{1}.... p_{n}$). There are fixed obstacles and a fixed destination point($d$). In each time step I have to query "Is ...
user avatar
  • 111
1 vote
0 answers
37 views

Reference request: Numerical techniques, Monte-Carlo (MC), Density Matrix Renormalization Group (DMRG), Dynamical Mean-Field Theory (DMFT)

I am an undergraduate student and my previous learning in physics is more on theory instead of numerics. I would be very grateful if you can point me to good introductory lecture notes/lecture videos ...
3 votes
1 answer
36 views

Could we have a quantum algorithm that have the quantum speed-up, but don’t need universal gates?

When it comes to building a quantum computer, it's like we need to consider how to perform universal gates fault-tolerantly, which is an unsolvable problem so far. While Clifford gates may be easier ...
user avatar
  • 31
0 votes
0 answers
54 views

Algorithm for solving Poisson's equation numerically

I need an algorithm to solve Poisson's equation for gravitational potential. $$ \nabla^2\phi = 4\pi G\rho $$ where, $\phi$ is Gravitational Potential. I am trying PDE for the first time so, I need ...
user avatar
  • 13
0 votes
0 answers
47 views

Numerical solutions to the 3D wave equation

I am doing a research to explore the existing numerical schemes that are used to solve the $3$D wave equation. The standard form of the problem in $3$ dimensional setting is : $$\Delta u= \frac{1}{c^2}...
user avatar
0 votes
0 answers
27 views

Dynamic Programming and legendre transformation?

I read once (I can't find it anymore:( ), that the Legendre transformation from the Lagrange formalism to the Hamilton formalism can be seen as dynamic programming. I have never seen it like this and ...
user avatar
  • 319
2 votes
1 answer
45 views

Compressing the Hilbert Space in Traditional DMRG

The traditional, non Matrix Product State, formulation of the Density Matrix Re-normalization Group (DMRG) algorithm can be coded in python. Such a code can be found in the following link: https://...
user avatar
1 vote
0 answers
19 views

Algorithm that checks if a subspace of states contains a product state

Suppose I have two identical qudits, the full Hilbert space is $\mathcal{H}=(\mathbb{C}^{d})^{\otimes 2}$. Say I'm given a supspace of states $\Lambda\subset \mathcal{H}$. What is the fastest ...
user avatar
  • 743
0 votes
1 answer
28 views

Why does the chain be at equilibrium in the MH algorithm?

I'm implementing the Metropolis algorithm to solve the 2D Ising model. I've understood how to implement it and now I'm trying to understand a bit of how the algorithm works. In the site I'm reading it ...
user avatar
  • 135
1 vote
0 answers
28 views

Is Shor's algorithm for factoring still efficient in the presence of small phase noise

Quantum Fourier transform of $|a\rangle\in H_N$ $$|a\rangle\longrightarrow\sum_{l=0}^{N-1}e^{\frac{i2\pi a l}{N}}|l\rangle$$ where $N=2^n$ and $H_N$ is $N$-dimensional Hilbert space. The ...
user avatar
  • 51
0 votes
0 answers
21 views

Determining track velocity of a transmitter given time of signal arrival at $n$ receivers

I have $3$ ground-based radio receivers (call them $i$, $j$, and $k$), with known coordinates $x_i,y_i,z_i$. A transmitter (call it $m$) with unknown coordinates $x(t)_m, y(t)_m, z(t)_m$, moving with ...
user avatar
  • 759
1 vote
0 answers
118 views

Which is more accurate: Euler's method or modified Euler's method?

I was solving a differential equation, the equation being, $$\frac{dv}{dt} = g-\frac{c_d}{m}v^2,$$ which can be solved analytically to give $$v = \sqrt{\frac{mg}{c_d}}\left(\frac{e^{2t\sqrt{\frac{c_dg}...
user avatar
2 votes
0 answers
104 views

How Do Quantum Computers Work, Like Really [closed]

I understand in plain terms superposition and entanglement, but I'm very unclear how either of these could work as a means to increase computation power. A helpful metaphor is that of the maze. A ...
user avatar
1 vote
1 answer
151 views

Number of qubits required in Shor's algorithm

People say that the number of qubits required in Shor's algorithm for factorizing $N$ should be $2\log N$ for control register and $\log N$ for target register. What is the reason why these numbers of ...
user avatar
  • 183
1 vote
0 answers
61 views

Is there a comparison table for quantum algorithms like VQE, QPE, QAOA, and so on?

I have one question: Recently, I studied about several algorithms like VQE, QPE, QAOA and so on. I would like to make some comparison tables about those algorithms, their strengths and weaknesses. If ...
11 votes
1 answer
646 views

Why use Crank-Nicolson over Matrix Exponential when solving Schrödinger's equation?

For Schrödinger's equation, $$\psi(x,t+\Delta t)=e^{-i H\Delta t}\psi(x,t)\approx\frac{1-\frac{1}{2}i H\Delta t}{1+\frac{1}{2}i H\Delta t}\psi(x,t).$$ The right-most expression is the Crank-Nicolson ...
user avatar
  • 756
1 vote
0 answers
80 views

Final Hamiltonian for Adiabatic Grover

X-Posted on Quantum-Computing Stack Exchange In quantum computation, there is a famous algorithm to search a marked item in an unstructured database called Grover's algorithm. It achieves a quadratic ...
user avatar
2 votes
0 answers
34 views

Why is the boundary of friends-of-friends (FOF) halo corresponding to iso-density contour?

The friends-of-friends algorithm (hereafter FOF) is commonly used to find halos in cosmological simulations. (For more information, please refer to here and here) I found that some literature argues ...
user avatar
  • 489
2 votes
2 answers
215 views

Is the universe's Kolmogorov complexity growing over time?

The Kolmogorov complexity of a deterministic universe is constant. The Kolmogorov complexity of a nondeterministic universe grows over time. It grows whenever something happens that is not ...
user avatar
  • 99
1 vote
1 answer
203 views

Bell State Measurement Algorithm

I'm relatively new to quantum computation and am taking a course in it. I was wondering if it is possible to code an algorithm which would be able to take an input of a 2 qubit state and perform a ...
user avatar
  • 21
1 vote
0 answers
21 views

Modeling curved light in media with "complex" indices of refraction

I've written an algorithm to solve the Time Difference of Arrival (TDoA) localization problem, using Bancroft's method (see). Given the coordinates of $n$ nodes in ...
user avatar
  • 759
0 votes
1 answer
196 views

How to calculate acceleration due to gravity in a 3D $N$-Body system?

How do you calculate acceleration due to gravity for objects in 3D space? My current understanding for the force due to gravity on object $i$ from object $j$ is $$\mathbf{F}_g=(\mathbf{r}_j-\mathbf{r}...
user avatar
0 votes
1 answer
45 views

Novikov self-consistency and computability

The Wikipedia article on the Novikov self-consistency principle has a section on time loop logic, where it discusses using time travel to solve any NP problem by finding an algorithm where the only ...
user avatar
4 votes
0 answers
151 views

Is the only difference between tDMRG and TEBD the way the central sites are shifted?

I have been reading up on time evolution methods using matrix product states. Reading from Schollwoeck's notes on the density matrix renormalization group, (https://arxiv.org/abs/1008.3477), I looked ...
user avatar
8 votes
1 answer
119 views

Github for Physicists

I am wondering if there is a platform to which researchers share or publish the code they used in their research. I noticed that many researchers explain their algorithm and math and present the ...
1 vote
0 answers
92 views

Numerical renormalization of 2D Ising lattice

I'm trying to make some toy computations on the $2D$ Ising model on a square lattice. I want to apply a renormalization transformation, and try to estimate observables on the renormalized lattice ...
user avatar
  • 4,396
2 votes
1 answer
224 views

Is estimation partition functions without resorting to markov chain monte carlo still an open question?

I was told estimation of partition functions without resorting to MCMC was still an open question in physics about a year and a half ago. An example is that say you have some physical model that ...
user avatar
  • 73
2 votes
1 answer
47 views

Can I have detailed balance without reverse updates?

I am implementing a Markov Chain Monte Carlo algorithm and want to obtain a stationary distribution. In order to do this I want to have detailed balance, as this is a sufficient, although not ...
user avatar
  • 1,671
0 votes
2 answers
87 views

Equations of motion: Calculate location of point [closed]

The scenario is that a user is dragging an object on a touchscreen. I want to calculate the position of the object as the finger drags it across the screen. I also want to account for any acceleration ...
user avatar
0 votes
2 answers
518 views

Calculating end position from existing position, velocity, deceleration and time

I am writing a piece of software where the user can drag an element only on the x axis. When the user lets go of the drag while the item is in motion I can determine the x velocity and the current x ...
user avatar
1 vote
0 answers
66 views

Maybe a stupid question: I read about equations in physics but are algorithms not also important? [closed]

I wonder if indeed the term "equation" is being used loosely and that algorithms for describing physical reality are also used frequently in physics? Or are algorithms relatively rare? Could it be ...
user avatar
  • 1,946
1 vote
0 answers
60 views

Numerically solving unbounded Fokker-Planck equation

I am wanting to solve a 3D Fokker-Planck equation of the form: $$\partial_{t}p(\mathbf{x}, t) = -\nabla \cdot \mathbf{J}$$ where $\mathbf{J} = \mathbf{v}(\mathbf{x})p(\mathbf{x}, t) - D\nabla p(\...
user avatar
  • 41
0 votes
1 answer
169 views

Las Vegas algorithm versus Monte-Carlo algorithm in Quantum Field Theory

I used the las Vegas algorithm to calculate the multidimensional integrals of a cross-section in tree-level. I don't quite understand what the Monte Carlo algorithm is for: Could I also calculate with ...
user avatar
  • 35
0 votes
1 answer
338 views

How can I use Runge-Kutta4 to solve this orbit in polar coordinates?

I want to simulate a simple orbit of a planet moving around a star which is fixed in position. I have formulated the ODEs for this problem using Lagrangian Mechanics and have found the equations of ...
user avatar
3 votes
2 answers
382 views

How to actually find a Hartree-Fock ground state?

I am interested in finding the Hartree-Fock ground state for a system of interacting fermions (with totally local scattering, so a delta-function interaction potential). I have read through some ...
user avatar
0 votes
1 answer
55 views

Metropolis Algorithm Transition-Proposal Probability

I'm working my way through a short section on the Metropolis algorithm in the lecture notes on Computational Quantum Physics by Prof. Troyer. However, I am not sure what probability distribution was ...
user avatar
1 vote
1 answer
57 views

References about "neutronic" algorithms

I am looking forward to apply for an internship in 5 months and I looked up the Jobs offers from last year, and some of them asked for a candidate with knowledge of "algorithms applied to neutronics". ...
1 vote
1 answer
659 views

Modification of the Verlet algorithms for the pendulum problem

I'm trying to write a program to integrate the motion equations of the pendulum in the damped and forced case, that is, following this equation: $$ \frac{d^2\theta}{dt^2}=-\frac{g}{L}\sin(\theta)-\mu\...
user avatar
  • 169
0 votes
0 answers
48 views

Fluid simulations on spherical coordinate grid: How to handle $\theta=0$ axis?

I am working on a fluid simulation code written in spherical coords. Whoever wrote the original didn't do a great job with the boundary conditions at $\theta=0$ and $\theta=\pi$ axes. My task is to "...
user avatar
0 votes
1 answer
122 views

Veto algorithm in particle decays and Monte Carlo techniques

What is the main concept behind Veto algorithm and how does it contribute to efficiency in Monte Carlo methods like when used in designing a parton shower?
user avatar
  • 101
4 votes
0 answers
102 views

Method to build a polyhedral die with given probabilities [closed]

Let's define a die as a polyhedron that, if rolled over a perfect horizontal plane, ends up being in a physically stable unambiguous state labelled $n$. The die has $N$ states. Each state $n$ has a ...
user avatar
  • 141
1 vote
0 answers
82 views

Numerically Solving EM problems. Book covering: ABS, PML, Near field calcul., LU fact, BicGstab, Pardiso etc

I looking for a book (or two) covering a range of topics: numerical implementation of boundary conditions (PEC, PMC, ABS); perfect matching layer; LU factorisation; numerical solvers and when to use ...
1 vote
1 answer
61 views

State of $N$-body system after time $t$ (elastic collision & no gravity)

I am creating a gas particle simulator based game. All nodes (green circles) represent gaseous particles and collide elastically. My algorithm correctly accounts for two-particle collisions, as the ...
user avatar
4 votes
0 answers
243 views

$N$-body gravity simulator: why does energy conservation break down when introducing an adaptive timestep?

I am playing with an N-body gravity simulator using the velocity-verlet algorithm. In the actual simulation I normalize everything so that it is nicely behaved numerically, but I'll express things in ...
user avatar
  • 429
3 votes
1 answer
169 views

What the difference is between Størmer Verlet and regular Verlet method?

I was wondering what the difference is between the Størmer Verlet method and the regular Verlet method, if there is any.
user avatar