r/ScientificComputing • • Apr 04 '23

r/ScientificComputing Lounge

8 Upvotes

A place for members of r/ScientificComputing to chat with each other


r/ScientificComputing • • 4h ago

Glassbox Lonk: Causal Investigation of Internal Representations and Learned Communication in Lightweight Adaptive Agents

Thumbnail
reddit.com
1 Upvotes

r/ScientificComputing • • 5h ago

I wrote this code for squares-in-square optimization problem

0 Upvotes

https://github.com/Timinesh/squares-in-squares

Please follow and star on GitHub you like this


r/ScientificComputing • • 16h ago

solving nth order ODE with $y^{n}=F(y,y^{'},y^{''},..,y^{n-1},t)$ method

Thumbnail scicomp.stackexchange.com
0 Upvotes

hi, I already posted the question on stack exchange sci comp, it would be nice if you could try to take a look!


r/ScientificComputing • • 16h ago

Looking for some feedback on my scientific research harness.

Thumbnail reddit.com
0 Upvotes

r/ScientificComputing • • 1d ago

In praise of CuPy and float32: 10× faster scientific computing

7 Upvotes

We've just released a new version of FaST-LMM, an open-source scientific computing program for genome-wide association studies (GWAS). Originally developed at Microsoft Research and published in Nature Methods in 2011, its original paper has received more than 1,200 citations. The software is based on Python and NumPy.

Two changes made a remarkable difference in performance:

  • Making floating-point precision selectable (float32 or float64).
  • Supporting CuPy as an alternative to NumPy, enabling computation on NVIDIA GPUs.

In our benchmark, float32 alone gave us a 2.6× CPU speedup. Combining float32 with CuPy gave us a 13× speedup on a consumer NVIDIA GPU, with nearly identical scientific results.

One caveat: consumer NVIDIA GPUs can perform float64 arithmetic 50 times slower than float32, so GPU acceleration alone may yield little or no speedup.

Of course, not every scientific computation can tolerate single precision, but it's worth investigating. And CuPy makes GPU acceleration remarkably accessible to developers of existing NumPy-based scientific software.

Kudos to the CuPy developers.

Benchmark and numerical accuracy details: https://fastlmm.github.io/FaST-LMM/benchmark.html


r/ScientificComputing • • 2d ago

AI Programming in Scientific computing (Trust Issues)

12 Upvotes

I work as software engineer developing simulation engine for multiphase 1D wellbore flow. I am starting to transition from mostly writing code with help of AI to managing AI writing the code.

Half year ago it seemed crappy but nowadays it is getting very good. Nonetheless I still feel anxious about letting just implement everything and just ask about the tests. Also I am always worried that it my seem to work but underlying physics is screwed up.

I am curious what is your experience with developing simulation software with AI. Do you have some tips and tricks how to do it efficient but still know what is going on in the heart of the solver ?


r/ScientificComputing • • 1d ago

[Article] An energy-form physics-informed neural network with geometry-adaptive hard constraints for steady heat conduction across two- and three-dimensional domains

Thumbnail reddit.com
1 Upvotes

r/ScientificComputing • • 2d ago

math behind the finite element analysis: sharing a content

Thumbnail
youtu.be
3 Upvotes

r/ScientificComputing • • 3d ago

Variance v0.1.0 - Open-source (GPL-3.0) desktop app for biostatistics and scientific graphing

Thumbnail
github.com
3 Upvotes

Hi everyone,

I'm a microbiologist and I just published Variance v0.1.0, a free and open-source (GPL-3.0) desktop app written in Rust for biostatistics and publication graphs.

In biology labs, a lot of day-to-day stats and figures are still done in closed, subscription-based software, while writing R or Python scripts from scratch isn't always practical for quick exploratory work or multi-panel layouts. I wanted something completely local and offline, where every statistical result stays auditable.

Variance covers 49 statistical analyses and 104 built-in curve-fitting equations across 8 table types, with vector and raster exports (PDF, SVG, EPS, EMF, TIFF, .docx/.pptx) and a built-in English/French guide. The part I focused on most is numerical verification: all 49 analyses were differentially tested against R 4.6.2 and NIST StRD datasets (60k+ cases, 63 numerical edge-case bugs caught and fixed in validation/DISCREPANCIES.md), and a Check in R button exports your data with a standalone R script so anyone can rerun and verify the exact numbers in R.

Right now there is a standalone Windows x64 executable on the Releases page, and it builds from source on Linux and macOS via cargo build --release (I plan to add prebuilt Linux and macOS packages next).

Happy to answer any questions or hear feedback, especially from people doing lab stats or using open-source scientific software.


r/ScientificComputing • • 3d ago

I built a physics-checking workflow (PhysGate) to catch silent numerical/physical bugs when coding with AI agents

0 Upvotes

I do lightning and atmospheric physics research, and lately I kept running into an annoying problem when using AI coding agents (Claude Code, Codex, Gemini CLI) for diagnostic scripts: the Python code runs cleanly and passes basic unit tests, yet silently breaks physics. Things like negative humidity (q < 0) from spectral ringing, forgetting the cos(phi) factor in spherical divergence, or integrating pressure right through coastal mountains.

So I put together PhysGate, a small open-source SKILL.md + pytest workflow (MIT license) to keep myself from vibe-coding straight into broken math.

What it actually does: Before writing implementation code, /physgate forces the agent to ask clarifying questions in plain language and freeze a SPEC.md file with physical red lines. Then it writes automated pytest checks for conservation laws, units, positivity/bounds, and limiting cases, splits implementation into isolated git worktree slices, and sends the result to two other model families in read-only mode for blind review instead of letting one model grade its own work.

There is a reproducible 3D North Pacific atmospheric river & jet-streak audit example in examples/ar_ai_physics_audit/ if you want to run pytest on it locally.

Repo: https://github.com/oldsixxiaolv/PhysGate

Curious how others here validate AI-generated scientific or numerical Python before trusting the plots—what invariant checks do you always enforce?


r/ScientificComputing • • 3d ago

Ramanujan vs CPython: performance matrix

Thumbnail reddit.com
0 Upvotes

Hi!

Ramanujan-Computing is an MIT-licensed open-source project that aims to harness idle compute power[CPU/GPU] of digital device for scientific computing.

The way its different from BOINC or Folding@Home/SETI@Home is : for a new kind of scientific simulation, the developer dont need to compile a new binary, distribute it, and get it installed on the volunteering devices [as needed in BOINC]. They just need to submit their code onto cluster of devices, and devices can just run the simulation. Technically the devices have an interpreter which can run any simulation. The attached comparision is for the interpreter's perf against CPython.

Additionally, computation can be sharded across devices, and developer can control on how data should move around shards.

This project is very much in nascent stage and has potential to help science move forward, welcome any feedback on the project.

code: https://gitlab.com/ramanujan-computing/Ramanujan

Thanks!


r/ScientificComputing • • 3d ago

Which is better for tensor network simulations, Tenpy or Quimb?

Thumbnail reddit.com
2 Upvotes

r/ScientificComputing • • 3d ago

Mi primer trabajo relacionado a la astronomía

Thumbnail
reddit.com
0 Upvotes

r/ScientificComputing • • 4d ago

UNIQUANT: Replacing float32/float64 with exact integer & rational arithmetic across hydrodynamics, timekeeping, and optimization (verified in Lean 4)

1 Upvotes

Hi everyone,

I just published the first public release (v1.0.0) of UNIQUANT-Formal alongside my primary research repository Uniquant23.

Standard scientific simulations, astronomical calendars, and optimization solvers rely almost universally on float32 and float64. Over long time horizons or millions of computational steps, tiny rounding errors, subtractive cancellation, and hardware discrepancies silently accumulate—causing drift, mass-conservation violations, and divergence between CPUs and GPUs.

Instead of patching floating-point drift after the fact, the UNIQUANT framework eliminates it at the mathematical root by rebuilding time scales, reference frames, fluid solvers, optimization routines, and statistical diagnostics purely on exact integer and rational arithmetic. To ensure complete soundness, the core theorems and algorithms are machine-verified in Lean 4 (40 modular files, 0 sorry).

Key highlights across the framework:

  • Integer-First Hydrodynamics & GPU Contracts: Backlog-free integer volume ledgers, cancellation-free trapezoidal channel geometry, tridiagonal M-matrix integer solvers with certified L_infinity error bounds, and overflow-free 128/256-bit multi-limb arithmetic for bit-exact CPU/CUDA execution.
  • Discrete Time & Astronomy: Exact rational time quantum (q = 75/1012 s), 529-year (23^2) anchor cycles, bounded lunar parabolas, and 299 = 13 × 23 phase lattices.
  • Observer Geometry & Climate Networks: Apparent zero-point accelerations, three-anchor orthonormal triads with full SO(3) rotational invariance, and spatial correlation bias (N_eff < N).
  • Convex Optimization & Diagnostics: Strictly convex Ridge-QP Hessians, root-free squared RMS guards, lossless main/remainder gradient accumulation, and integer block-CUSUM change-point detectors.
  • Stylometry, Calendars & Decipherment: Burrows' Delta corpus-mean cancellation, the 365-day Egyptian calendar identity, 6-test minimal hitting sets, and Shannon unicity distance bounds.

Links & DOIs:


r/ScientificComputing • • 4d ago

I built an open-source Python physics sandbox where every solver is tested against an analytic result. What should I add next?

Thumbnail gallery
0 Upvotes

r/ScientificComputing • • 5d ago

генерация тетраэдральной сетки gmsh на python

1 Upvotes

Всем привет!
Помогите разобраться с кодом. Задача кода соединить три stl-файла в замкнутый объем и построить внутри тетраэдральную сетку, первый файл - стенка аорты, второй и третий - крышки, в итоге должно получиться что-то похожее на трубу, у которой стенки заполнены тетраэдральной сеткой. При объединении в единый файл и просмотре в ParaView поверхность выглядит замкнутой и хорошей, но при делении на поверхности для gmsh получается сильно больше чем 3, и далее код падает на генерации сетки. Были попытки ввести функции для подчистки мест соединения, т.е. соединения близких точек, удаление ненужных точек и вырожденных треугольников, но поверхностей при делении становилось только больше. Проверка на нормали треугольников тоже не помогла. Как это можно исправить?

import math
import os
import gmsh
import vtk

def generate_aorta_mesh():
address = r“C:\Users\User\Desktop\aorta”

append = vtk.vtkAppendPolyData()
for name in (“aortaWall_comb.stl”, “bottom.stl”, “top.stl”):
reader = vtk.vtkSTLReader()
reader.SetFileName(os.path.join(address, name))
reader.Update()
append.AddInputData(reader.GetOutput())
append.Update()

temp_stl = os.path.join(address, “temp_aorta.stl”)
writer = vtk.vtkSTLWriter()
writer.SetFileName(temp_stl)
writer.SetInputConnection(append.GetOutputPort())
writer.Write()

gmsh.initialize()
gmsh.model.add(“aorta_mesh”)
gmsh.merge(temp_stl)

gmsh.model.mesh.classifySurfaces(30 * math.pi / 180, True, True)
gmsh.model.mesh.createGeometry()

surface_tags = [s for s in gmsh.model.getEntities(2)]
s_loop = gmsh.model.geo.addSurfaceLoop(surface_tags)
gmsh.model.geo.addVolume()
gmsh.model.geo.synchronize()

gmsh.model.mesh.generate(3)
gmsh.write(os.path.join(address, “aorta_gmsh.vtk”))

gmsh.finalize()

if __name__ == “__main__”:
generate_aorta_mesh()


r/ScientificComputing • • 5d ago

induction heating system in COMSOL using a planar spiral copper coil

2 Upvotes

Hello everyone,

I'm modelling an induction heating system in COMSOL using a planar spiral copper coil and a steel plate.

I have two questions:

  1. When using Single Conductor, where should I apply the excitation current? Should it be imposed at the coil terminals or on the outer boundaries of the air domain?
  2. What is the main difference between Single Conductor and Homogenized Multiturn, and which one is more suitable for a planar spiral induction coil?

Thank you for your help!


r/ScientificComputing • • 5d ago

A new guy to learn ai for chem

2 Upvotes

Are direct adsorption energy prediction models still competitive in the era of universal MLIPs?

I am currently developing a lightweight attention-based model for predicting adsorption energies on metallic and alloy surfaces using DFT-relaxed adsorption structures.

Unlike MLIPs, my model directly predicts adsorption energies without learning atomic forces or the full potential energy surface.

I would like to discuss the following questions:

  • Is relaxed-structure-to-adsorption-energy prediction still a meaningful research task?
  • Are there recent specialized models addressing this task rather than IS2RE or S2EF?
  • What benchmarks would enable a fair comparison between specialized energy prediction models and universal MLIPs?
  • Could specialized models offer meaningful advantages in accuracy, data efficiency, or transferability?

Any recommendations for recent papers, models, or benchmark datasets would be greatly appreciated.


r/ScientificComputing • • 5d ago

Cove: a research workspace on a CernVM-FS software stack, in the Compute Canada / EESSI mould

2 Upvotes

For a researcher: you open a project and the R, Python and libraries it needs are already built and loaded. The app you're working on runs at its own address, and the same environment goes with it to a server or a Slurm job. You never build software or manage environments.

The stack follows the model Compute Canada built and EESSI generalised: EasyBuild recipes, Lmod, CernVM-FS. If your site already mounts EESSI or the Compute Canada stack, those are broader and better tested. Cove's part is the workspace on top: projects, the running app, saved versions and container images. Running Cove against those stacks, not only its own, is the next thing I want to build.

  • Build recipes turn R, Python, Julia, scientific libraries and their dependencies into versioned installations on a known compiler toolchain (foss-2024a), loaded through Lmod with `ml`
  • Each CPU architecture (x86_64, aarch64) gets its own build; CUDA packages are built on a GPU machine. Nothing is rebuilt per user
  • Finished builds go to a versioned repository on object storage, and a published version never changes. Machines mount it with CernVM-FS and fetch only the files they touch
  • A saved project can become a container image, tested under podman and Apptainer. The image holds the app, not the stack: run as a Slurm job, it mounts the same stack read-only
  • On top sits the IDE: code, consoles, plots and an AI agent in one window. MIT-licensed, self-hostable

Install on Linux:

curl -fsSL https://ndexr.io/install.sh | sh

Site: https://ndexr.io

Source: https://github.com/fdrennan/cove

If your cluster already mounts EESSI or the Compute Canada stack, what would a workspace on top of it need to do before you'd use it?


r/ScientificComputing • • 6d ago

Force-field benchmarking for fatty-acid crystallisation in LAMMPS: PCFF, OPLS-AA, CHARMM and TraPPE-UA

1 Upvotes

Hi everyone,

I’m the first author of a recent open-access study that may be relevant to people simulating fatty acids, organic PCMs, or crystallisation more generally.

We wanted to examine how strongly force-field choice affects the predicted phase behaviour of fatty acids. Using a unified LAMMPS protocol, we compared PCFF, OPLS-AA, CHARMM and TraPPE-UA across six saturated fatty acids from C4 to C18. We evaluated crystallisation, phase-change temperatures and enthalpies, densities, and thermal conductivities.

A few results stood out:

  • Under our simulation protocol, PCFF was the only tested force field that reproduced crystallisation across C8–C18.
  • PCFF predicted the transition temperatures for these systems with a mean absolute error of 3.2%.
  • OPLS-AA produced crystallisation for C16 and C18, while CHARMM and TraPPE-UA showed no clear ordering transition under the same protocol.

The paper’s Supporting Information includes a ZIP archive containing all LAMMPS input files and the Python scripts used for post-processing, so others can inspect, reproduce, or adapt the workflow.

Paper: https://doi.org/10.1038/s41598-026-80735-3

I’d be interested to hear from others who have compared force fields for organic crystallisation. Have you observed similarly large differences in ordering behaviour under otherwise comparable simulation protocols?


r/ScientificComputing • • 6d ago

GridLock: an open-source debugger built for MPI and parallel C++ development

Thumbnail
reddit.com
4 Upvotes

r/ScientificComputing • • 6d ago

What are your biggest frustrations with scientific data analysis software like OriginPro?

Thumbnail reddit.com
2 Upvotes