Cosmology Simulation
PNU Cosmology Group · Advised by Prof. Junsup Shim · Spring 2026 Supporting Research

Project Overview
During a two-month Spring 2026 internship, I conducted supporting research by reading Friends-of-Friends (FoF) halo catalog binary files generated by Prof. Junsup Shim at the Department of Earth Science Education, Pusan National University, via Fortran simulations in a Python environment and summarizing them into plots.
The main goal was not simply to reproduce finished figures or draw histograms, but to understand the binary data and its structure, and to convert catalog particle counts, coordinates, and auxiliary tensor information into masses, distance pairs, orientations, and visualization scales to construct and plots. Along the way, I also learned about eigenvalue decomposition, matrix and tensor symmetrization, estimators, periodic boundary conditions, and large-array processing.
Some of the code I wrote will be uploaded to the GitHub repository, youngjinphys/FoF_Simulation_Plot.
Public Scope Notice
This document only summarizes the learning and implementation scope during the internship process. It does not include binary data, plots of actual data, interpretation of research results, or conclusions that I do not have permission to publish or that have not undergone peer review.
Role & Activities

A concise summary of my undergraduate internship research experience over the past two months.
Scope of Work
Binary Catalog Reading and Scale Conversion
The code separated the per-halo particle count, grid-coordinate positions, and COM-centered blocks into named fields. Coordinates were converted from grid units to Mpc/h by multiplying by .
FoF Masses and HMF Plot
Used the per-halo particle count in the catalog to build a , then grouped the masses into logarithmic bins and displayed a .
2pCF and Estimator Learning
Converted catalog coordinates to the simulation length scale and computed separation-bin pair counts considering periodic boundary conditions. I then learned why random baselines and normalization are needed through the .
Auxiliary Halo-Scale Visualization
Symmetrized catalog second-moment tensors and used their eigenvalues to compute principal RMS scales. These values were used only as and were not interpreted as published results or boundary measurements.
How Original Data Entered the Calculations
Based on the code, the shareable inputs were each halo's particle count , grid-coordinate position , and the catalog's xx and qq second-moment tensor blocks. The basic conversions were and .
The HMF plot counted for each logarithmic mass bin, and divided by the volume and bin width in the form . For 2pCF, , , and were counted for each separation bin, and was applied to the normalized pair counts.
For halo-size display, xx and qq were each made into 3x3 symmetric matrices before using their eigenvalues . Following the code's scaling diagnostics, xx was treated as a particle-summed Eulerian second moment with , while qq was treated as a particle-averaged Lagrangian second moment with for the principal RMS half-axis. The shape statistics calculated , , and , but these values were visualization and learning summaries, not published as peer-reviewed physical conclusions.
Key Learnings & Insights
- Large-scale Python computation experience: While working with large scientific arrays in Python for the first time, I learned practical operation habits such as NumPy/SciPy/Matplotlib-based processing, chunked pair counts, multicore Pool execution, cache reuse, and explicit figure closing.
Debugging Notes & Troubleshooting
- MLX acceleration attempt and return to the CPU path: Because pair counting took too long, I tried Apple MLX GPU acceleration. That path constructed the full distance matrix and used only part of it for the histogram, so it did not reduce memory use or latency. The final 2pCF path used CPU pair counting based on
cKDTree.count_neighbors, chunk processing, and cache reuse. - 2D projection of 3D tensors: Instead of simply projecting 3D eigenvectors onto a plane and drawing them, the visualization path re-diagonalizes the projected 2x2 tensor to find the major axis on the screen. This is a mathematical correction to reduce visualization-direction errors.
Acknowledgments
I would like to express my gratitude to Prof. Junsup Shim for his active guidance and the opportunity to work with research data, despite the short period.