{"id":23383362,"url":"https://github.com/blagojeblagojevic/ising-model","last_synced_at":"2025-04-08T09:44:58.916Z","repository":{"id":198278526,"uuid":"700487496","full_name":"BlagojeBlagojevic/Ising-model","owner":"BlagojeBlagojevic","description":"This repository contains a C implementation of the Ising model simulation, a mathematical model in statistical mechanics describing ferromagnetism. The simulation utilizes the Metropolis algorithm to update the spins of a 2D lattice. The visualization is done using the SDL2 library, allowing for real-time rendering of the Ising model evolution.","archived":false,"fork":false,"pushed_at":"2024-01-05T08:18:31.000Z","size":1885,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T06:36:42.938Z","etag":null,"topics":["c","ising-model","ising-model-2d","sdl","sdl2"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BlagojeBlagojevic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-04T17:29:16.000Z","updated_at":"2024-09-28T16:26:00.000Z","dependencies_parsed_at":"2025-02-14T06:42:58.101Z","dependency_job_id":null,"html_url":"https://github.com/BlagojeBlagojevic/Ising-model","commit_stats":null,"previous_names":["blagojeblagojevic/ising-model"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlagojeBlagojevic%2FIsing-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlagojeBlagojevic%2FIsing-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlagojeBlagojevic%2FIsing-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlagojeBlagojevic%2FIsing-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlagojeBlagojevic","download_url":"https://codeload.github.com/BlagojeBlagojevic/Ising-model/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247816830,"owners_count":21001048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","ising-model","ising-model-2d","sdl","sdl2"],"created_at":"2024-12-21T22:20:13.923Z","updated_at":"2025-04-08T09:44:58.862Z","avatar_url":"https://github.com/BlagojeBlagojevic.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ising Model Simulation using SDL2\nThis repository contains a C implementation of the Ising model simulation, a mathematical model in statistical mechanics describing ferromagnetism. The simulation utilizes the Metropolis algorithm to update the spins of a 2D lattice. The visualization is done using the SDL2 library, allowing for real-time rendering of the Ising model evolution.\n\n## Prerequisites\n* SDL2 library\n* C compiler\n\n## How to Use\n\n1. Clone the repository: git clone https://github.com/username/repo.git\n2. Compile the code using a C compiler: gcc main.c -o ising -lSDL2 -lm\n3. Run the executable: ./ising\n\n## Parameters\n\n* ***T (Temperature)***: The temperature of the system, which affects the behavior of spins. Input the desired temperature during program execution.\n* ***J (Interaction Strength)***: The interaction strength between neighboring spins. Input the desired value during program execution.\n* ***Distribution of Spins***: Set the initial distribution of spins (0 - 1). Spins are randomly initialized based on this distribution\n\n## How it Works\n\n* The Ising model consists of discrete variables representing magnetic dipole moments of atomic spins, which can be in one of two states: up (+1) or down (-1).\n* Spins are updated using the Metropolis algorithm, which calculates the change in energy for a spin flip and decides whether to accept or reject the flip based on the energy change and temperature.\n* The simulation runs indefinitely, continuously updating spins and visualizing the evolving state of the system.\n\n## Note\n\n* The code contains a basic implementation of the Ising model and may not cover all edge cases or optimizations.\n* Feel free to modify and experiment with the code to explore different aspects of the Ising model simulation.\n\n\n## References\n* https://en.wikipedia.org/wiki/Ising_model\n* https://www.youtube.com/watch?v=vwLb3XlPCB4\n* https://en.wikipedia.org/wiki/Metropolis%E2%80%93Hastings_algorithm\n* https://www.libsdl.org/\n\n\n\n\n\n\n\n\n\n\n\n\n![Screenshot_2](https://github.com/BlagojeBlagojevic/Ising-model/assets/100707842/9552fc54-dfb1-4c08-a67e-cd0736453e67)\n\n\n![Screenshot_1342](https://github.com/BlagojeBlagojevic/Ising-model/assets/100707842/422ce86e-59d6-4377-9a77-25b37d11dc30)\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblagojeblagojevic%2Fising-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblagojeblagojevic%2Fising-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblagojeblagojevic%2Fising-model/lists"}