Research project
Completed

Cosmology Simulation

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

Cosmology Simulation

Institution

PNU Cosmology Group, Pusan National University

Collaboration

Prof. Junsup Shim

Timeline

Apr 2026 - Jun 2026

Updated:
Tags:cosmologysimulation

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

Visualization of dark matter halos and large-scale cosmic structure
Cosmic web visualization (AI-enhanced)

A concise summary of my undergraduate internship research experience over the past two months.

GroupPNU Cosmology Group
AdvisorProf. Junsup Shim
PeriodApr 17, 2026 - Jun 30, 2026
RoleUndergraduate Intern
StatusCompleted

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 Lbox/NgridL_\mathrm{box}/N_\mathrm{grid}.

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 NpN_p, grid-coordinate position xgrid\mathbf{x}_\mathrm{grid}, and the catalog's xx and qq second-moment tensor blocks. The basic conversions were MFoF=NpmpM_\mathrm{FoF}=N_p m_p and x=xgridLbox/Ngrid\mathbf{x}=\mathbf{x}_\mathrm{grid}L_\mathrm{box}/N_\mathrm{grid}.

The HMF plot counted ΔN\Delta N for each logarithmic mass bin, and divided by the volume and bin width in the form dn/dlog10MΔN/(VboxΔlog10M)dn/d\log_{10}M \approx \Delta N/(V_\mathrm{box}\Delta\log_{10}M). For 2pCF, DDDD, DRDR, and RRRR were counted for each separation bin, and ξ^LS(r)=(DD2DR+RR)/RR\hat{\xi}_\mathrm{LS}(r)=(DD-2DR+RR)/RR 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 λi\lambda_i. Following the code's scaling diagnostics, xx was treated as a particle-summed Eulerian second moment with ai=Lboxλi/Npa_i=L_\mathrm{box}\sqrt{\lambda_i/N_p}, while qq was treated as a particle-averaged Lagrangian second moment with ai=Lboxλia_i=L_\mathrm{box}\sqrt{\lambda_i} for the principal RMS half-axis. The shape statistics calculated s=c/as=c/a, q=b/aq=b/a, and T=(a2b2)/(a2c2)T=(a^2-b^2)/(a^2-c^2), 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 N×NN \times N 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.