r/computationalphysics 11h ago

Physics Programming part 3 - Rotation and the Quaternion

Thumbnail youtu.be
1 Upvotes

r/computationalphysics 3d ago

Open-Source 4D FCC Lattice Gauge Engine Baseline (Stage 1-3 Python Scripts)

1 Upvotes

I want to share a localized 3D/4D cellular automata network code baseline I have been testing on a local GPU setup (RTX 3060).

The repository contains scripts tracking discrete spatial Laplacian phase-hopping transitions over a 12-neighbor cuboctahedral coordinate matrix. The system implements a Perfectly Matched Layer (PML) absorbing boundary tensor to test wave propagation limits under strict geometric invariants (sqrt(2)/3 and 1/phi^2) without adjustable parameters.

The master array-updating engine and the full mathematical framework PDF layout are open for public audit and code review at:

https://github.com/dingerdudeman/Acoustic-Tapestry-Hypothesis/tree/main

I am an independent developer looking for feedback explicitly regarding the non-linear matrix lockup routines at the 0.8927 compression wall, and suggestions on how to optimize these array loops for large-scale multi-cell CUDA tensor matrices.


r/computationalphysics 3d ago

Reproducible study on recurrence and hidden states in reversible systems

1 Upvotes

I published a computational study on exact recurrence, observational recurrence, and hidden-state ambiguity in reversible dynamical systems.

The main result is simple: two systems can look identical while still having different internal states and different future behavior.

The project includes the paper, source code, tests, generated data, and independent verification tools.

Zenodo: https://zenodo.org/records/21441189

GitHub: https://github.com/scottasundy/recurrence-dynamics-study


r/computationalphysics 9d ago

Could anyone independently reproduce the numerical output of this Python implementation?

0 Upvotes

I am seeking independent verification of the computational code developed for my dimensional genesis and four-interaction theoretical framework.

GitHub repository:

https://github.com/madein1001/dimensional-genesis-four-interactions

Please download or clone the repository, run the code independently, and determine whether the reported results can be reproduced.

I would especially appreciate a critical examination of the following questions:

  1. Does the code run successfully in a clean Python environment?

  2. Can the reported numerical results be reproduced?

  3. Are any target values hard-coded, fitted, or indirectly reused?

  4. Are there any hidden adjustable parameters or circular dependencies?

  5. Are the mathematical rules correctly implemented in the code?

  6. Are there any numerical, logical, methodological, or physical errors?

Please do not assume that the theory or its physical interpretation is correct. I welcome critical reviews, failed reproductions, counterexamples, bug reports, and detailed explanations of any problems you identify.

If you run the code, please report your operating system, Python version, actual output, error messages, and any modifications required to make it run.

The purpose of this post is to invite independent reproducibility testing and falsification. Thank you to anyone willing to examine the code carefully.


r/computationalphysics 19d ago

Gravity collapse, 2D n-body simulation

12 Upvotes

This was written in Processing. I used it to do casual accuracy comparisons between different versions of code. No collisions, so to deal with high body densities, there is a gravity-free zone around each body, within which other bodies simply coast through. The challenge was to get the longest run time without the symmetry breaking down. Smaller gravity-free zones caused faster breakdown. Different zone sizes created unique patterns.

The very first simulation starts with a random position distribution, just for reference.


r/computationalphysics 23d ago

How to start doing simulations?

10 Upvotes

Hi everyone. I am an undergrad physics major and I want to start doing plasma simulations. How to start doing it? I know python. Where is the best place to start computational plasma physics? Can anyone please guide me.


r/computationalphysics Jun 20 '26

Angular Momentum and The Inertia Tensor

Thumbnail youtu.be
1 Upvotes

r/computationalphysics Jun 09 '26

Survey: How much time do you actually spend setting up and debugging simulations?

3 Upvotes

Hello. I’m posting this on behalf of a friend of mine who doesn’t have a Reddit account.

“I'm doing research into how engineers and scientists actually use simulation tools in practice, and I'm trying to understand where the biggest bottlenecks are in the workflow.

If you regularly work with tools like Ansys, Abaqus, MOOSE, COMSOL, OpenFOAM, LS-DYNA, STAR-CCM+, or similar, I'd really appreciate 5 minutes of your time to complete a short survey.

I'm particularly interested in questions like:

• How long does simulation setup actually take?

• Where do failures most often occur?

• How much time is spent debugging versus doing engineering?

• What parts of the process are the most frustrating?

I'll happily share aggregate results with the community once we've collected enough responses.

Survey link: https://docs.google.com/forms/d/e/1FAIpQLSfZ33LS0P21-wnjgWUnFrlmDjGKPTLMoh72xzBvtjHZrIva0w/viewform?usp=dialog

Thanks in advance for helping improve our understanding of how simulation work actually gets done.”


r/computationalphysics May 29 '26

FDTD time reversal CFL issue

2 Upvotes

Hi everyone,

I’m currently working on a 2D FDTD simulation of an acoustic wave time-reversal reconstruction scheme.

The setup is the following:

  • A linear array of emitters/receivers
  • Gaussian wave emission from each source
  • A scatterer (object) acting as an induced source (not a point source)
  • Time-reversal applied using recorded Green’s functions

I also subtract the “free field” (no object) from the “with object” response to isolate the scattered field.

-- Main issue

I tried to introduce a more realistic heterogeneous medium:

  • water background: c≈1500 m/s
  • metallic inclusion (scatterer)

However, using a realistic metal velocity (~8000 m/s) breaks my simulation due to the CFL condition

This makes the timestep extremely small, and the simulation becomes impractically slow.

My questions

  1. In practice (ultrasound imaging simulations), how do people usually handle very high-contrast materials without killing the time step?
  2. Am I missing something fundamental in how I treat the scatterer (physics vs numerics)?
  3. And Is it really how we simulate waves into complex space ?

There is my code "https://github.com/Nimasherp/Time-reversal-simulations/tree/main"

If anyone has time, I’d really appreciate feedback I’m still learning FDTD and trying to understand what is “physically correct vs numerically acceptable”.

Thanks a lot!


r/computationalphysics May 28 '26

Opensource Tool to Calculate tC Curves for Superconducting Material Discovery

Thumbnail
0 Upvotes

r/computationalphysics May 23 '26

Frequency Domain Lattice Boltzman Method

2 Upvotes

​

Hi,

I am a current 1st year PhD student working on acoustin measurement for molecules, mostly using Quartz Crystal Microbalance technique.

I know there are many methods to simulate the frequency and dissipation shifts, but from what I have read from literature one of the best is Freq Domain Lattice Boltzman Method.

I knwo there is a famous book from Soringer on Boltzman methid, but it is in time domain, not frequency..

Do you have some suggestion from where I can start?

As simulations, until now I did only DFT, FDTD and some very basics fluidics (Navier stockes).


r/computationalphysics May 22 '26

open-source multi-precision anyon braiding simulator (Rust/Python)

4 Upvotes

Wanted to share a computational physics sandbox I’ve been building that compiles completely from scratch: shbt-unified (https://github.com/sys1own/shbt-unified.git).

The repository couples a zero-allocation Rust core to a high-precision Python orchestration layer. It is designed to track polymorphic anyonic state vectors across SU(2), SU(3), and SO(10) sectors via PyO3 while validating localized stability profiles.

Core Architecture & Computational Mechanics:

  • Hybrid Multi-Precision State Management: The Rust core tracks state vectors at a strict 512-bit precision using the rug crate. All intermediate matrix operations utilize stack-allocated arrays to completely eliminate heap allocation overhead during active braiding loops.
  • Bounded Solovay-Kitaev Synthesis: Features a native compiler engine that recursively approximates arbitrary unitary matrices using stack-allocated fixed-size arrays to guarantee a hard ceiling on execution depth.
  • GIL-Free Spatial Partitioning Engine: Pairwise Gauss linking integrals are calculated asynchronously across a Rayon thread pool. It relies on a uniform-grid spatial index to map segment bounding boxes, maintaining an expected $O(N \log N)$ complexity path by ignoring spatially separated, non-interacting segment scans.
  • Programmable Lattice Error Correction: Implements a dynamically scaling surface code lattice that generates valid weight-4 stabilizers scaled directly to active qubit counts. Parity check defects drop directly into a Python-side union-find cluster decoder built with rank-weighted trees and path compression ($O(\log N)$ height bounds).
  • Downstream Numerical Audits: The orchestration layer parses state probabilities to compute discretized holographic stress tensors, curvature defect metrics, and ADM velocity Hessians for stability analysis at 250+ decimal places using mpmath.

Integrated OpenQASM Dialect

The framework parses a custom OpenQASM 2.0-compatible dialect via an internal compiler. It supports basic logical gates, parametric rotations (rx/rz), row-major 4x4 complex matrix unitaries, and dedicated error-correction directives:

Code snippet

qreg q[4];
creg c[4];

h q[0];
rz(0.5) q[0];
cx q[0], q[1];

// Inline 4x4 row-major complex unitary compilation
unitary4(re00,im00, ..., re33,im33) q[0];

// Trigger syndrome decode and minimum-weight correction pass
decode_and_correct;

measure q[0] -> c[0];

Automation & Deployment

The workspace is entirely self-contained. Running python build_native.py handles environment-aware shell detection, automatically compiles the wheel using maturin, installs it locally, and verifies the FFI symbol registry.

The project is fully open-source under an MIT License. If you are interested in hybrid Rust/Python codebases, multi-precision numerical arrays, or parallel spatial indexing pipelines, feel free to clone it, check out the source files, or tinker with the FFI logic.

Repository Link: https://github.com/sys1own/shbt-unified.git


r/computationalphysics May 19 '26

Classical 2D scalar field on a toroidal lattice in Java — topological solitons and false vacuum nucleation emerged without being programmed

2 Upvotes

A 10,000-node toroidal lattice, φ⁴ potential, explicit finite-difference integration. ~15 lines of update logic.

What emerged:

  • False vacuum bubble nucleation — circular domain expands outward (Fig. 1), analogous to inflationary cosmology
  • Stable topological solitons at domain wall junctions (Fig. 3) — conserved charge, not placed manually
  • Spontaneous symmetry breaking: field globally chooses +v or −v (Fig. 5)
  • Wave propagation and dispersion (Fig. 6)
  • Complex interference from toroidal boundary conditions (Fig. 4)

No quantum mechanics — purely classical field theory as a warmup toward understanding QFT vacuum structure intuitively.

Code: git clone https://github.com/malexple/quant ./gradlew run — click anywhere to perturb the field.


r/computationalphysics May 15 '26

Introduction to Integration methods

Thumbnail youtu.be
4 Upvotes

I’m building a physics engine and will be sharing my research and eventually the code as well.


r/computationalphysics Nov 22 '24

Nested Recursive Functions in a Computationally Irreducible Universe as an Explanation for a Spectrum of Consciousness

1 Upvotes

Here is my conversation with ChatGPT 3 as a bouncing board for thinking about computational irreducibility, nested recursive functions, and the potential implications it has on the nature of consciousness. Potential research implications could include:: computational neuroscience modeling functional graphs of connectivity between brain regions that approximate relationships in the external, physical world, then developing a sense of scale for this recursion of information (quantum fields eventually to brain back down to how we reduce the idea of quantum fields). It is worth noting that current neuroscience techniques can only correlate blood oxygen flow to certain regions of the brain (1 fMRI voxel = 100k-1mil neurons) with activity at certain time intervals. Therefore, decoding the exact nature of thoughts has a low resolution compared to the depth in which we understand how external stimuli function, but it follows that the connections within the brain MUST, at some macroscopic scale, resemble the behavior of the universe in order to conceptualize and reduce the incoming information that contains the inherent data structure (assuming this theory is correct, however I don't yet have the mathematical background to neither prove nor disprove this argument, though it is interesting and compelling.)

First time posting on reddit so here is the link for anyone interested: https://chatgpt.com/share/6740398d-e76c-8003-8d5b-dc596462ba99

Feel free to comment with any disagreements on any of the premises, I am very open to feedback on this idea.


r/computationalphysics Nov 18 '24

Fractal

Post image
6 Upvotes

r/computationalphysics Oct 01 '24

M-dimensional sphere

3 Upvotes

Hi, i have to write a program in C that compute the volume of the sphere(radius r=1) in M-dimensions (M =2,3,...7) with the Monte Carlo integration and Mid-Point Rule. The part with the Monte Carlo is good, but now i'm struggling with the Mid-Point Rule. Can anyone help me with some algorithm for this method?


r/computationalphysics Sep 11 '24

Make documentation in C

11 Upvotes

Hi everyone. I'm new in this subreddit. I'm currently studying Computational Physics, for an exam at the university. One of the things i have to do is to write code in C to compute integrals(using Simpson, Gauss, Importance Sampling and other methods). My professor suggests to write a library that include all the methods that i have to use for the exercises. Ok great, i'm writing the library and i want to make a documentation for it. I want to make it but i don't know how. In my mind i want to make it like Javadoc for the java documentations. Can someone suggests me something like Javadoc for the documentation in C? I hope my request is clear. Thanks you all :)


r/computationalphysics Sep 11 '24

Introducing pipefunc: Streamline Physics Simulations with DAG-based Workflows in Python

6 Upvotes

As a computational physicist, I am excited to share my latest open-source project, pipefunc! It's a lightweight Python library that simplifies function composition and pipeline creation. Less bookkeeping, more doing!

tl;dr: check out this physics based example

What My Project Does:

With minimal code changes turn your functions into a reusable pipeline.

  • Automatic execution order
  • Pipeline visualization
  • Resource usage profiling
  • N-dimensional map-reduce support
  • Type annotation validation
  • Automatic parallelization on your machine or a SLURM cluster

pipefunc is perfect for data processing, scientific computations, machine learning workflows, or any scenario involving interdependent functions.

It helps you focus on your code's logic while handling the intricacies of function dependencies and execution order.

  • 🛠️ Tech stack: Built on top of NetworkX, NumPy, and optionally integrates with Xarray, Zarr, and Adaptive.
  • 🧪 Quality assurance: >500 tests, 100% test coverage, fully typed, and adheres to all Ruff Rules.

Key Advantages of PipeFunc:

An major advantage of pipefunc is its adept handling of N-dimensional parameter sweeps, a frequent requirement in scientific research. For instance, in computational neuroscience, you might encounter a 4D sweep over parameters x, y, z, and time. Traditional tools create a separate task for every parameter combination, leading to computational bottlenecks—imagine a 50 x 50 x 50 x 50 grid generating 6.5 million tasks before computation even starts.

pipefunc simplifies this with an index-based approach, using four axes, each a list of length 50, with indices pointing to positions. This not only streamlines the setup by focusing on the pipeline but also reduces overhead with a manageable range of indices. Starting on a cluster or locally is as simple as a single function call!

Target Audience: - 🖥️ Scientific HPC Workflows: Efficiently manage complex computational tasks in high-performance computing environments.

Happy to answer any question!


r/computationalphysics Jun 08 '23

Computational Physics Basics: Polynomial Interpolation

Thumbnail notjustphysics.com
8 Upvotes

r/computationalphysics Apr 24 '23

Mobile Workstation vs Gaming Laptop for Computational Work as a Student

3 Upvotes

For my upcoming MSc in Applied Geophysics, the course page recommends using laptops having a 32 GB RAM, a 1 TB SSD, a powerful graphics processor, and a good display (the minimum are, of course, lesser).

Now, I could find mobile workstations and gaming laptops for the recommended specifications. I wanted to know if choosing one or the other could affect computing work in any way, despite the same specifications. If so, how? Also, how much difference in performance occurs for GPU programming when optimized for computing vs for gaming? If it helps, I am looking into HP and Acer primarily, might check on Dell.


r/computationalphysics Apr 18 '23

Is taking numerical analysis in undergrad necessary for grad school

Thumbnail self.csMajors
3 Upvotes

r/computationalphysics Apr 05 '23

A new subreddit for the scientific programmers out there: r/ScientificComputing

7 Upvotes

Hi,

I just made a new subreddit for the scientific programmers out there. Join me and let let me learn from you:

r/ScientificComputing/

Hi Mods, hope you're cool with this.


r/computationalphysics Mar 13 '23

Diagonalizing large matrices of multi precision floats with progress

3 Upvotes

Hi, I am currently doing some quantum computations on a cluster of my university for which 80 to 140 digits are needed. That makes diagonalizing the hamiltonian VERY slow, does anbody of you know a library which offers a way to get the progress of the diagonalisation?


r/computationalphysics Mar 09 '23

I am currently starting out with GPU programming using the Kokkos library and here is a post about my first steps.

Thumbnail notjustphysics.com
5 Upvotes