GithubHelp home page GithubHelp logo

silky / spin-models-on-gpu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kshyatt/spin-models-on-gpu

0.0 2.0 0.0 2.54 MB

An implementation of a variety of spin models on 1- and 2-D lattices in CUDA

Cuda 58.40% C++ 40.69% Makefile 0.72% Shell 0.19%

spin-models-on-gpu's Introduction

Spin Models on GPU

Author: Katharine Hyatt (kshyatt AT uwaterloo DOT ca) Date: May 03 2012

Introduction

This code is intended to simulate the 1D and 2D Heisenberg, 2D XY, and 1D and 2D transverse field Ising models. The 2D models are simulated on variety of square Betts lattices. It generates the sparse Hamiltonian in COO format and then applies the Lanczos method to it.

The GPU code is based off of CPU code written by Roger Melko.

Requirements

Since this code is CUDA based, you will need an nVidia GPU as well as the latest version of the CUDA toolkit and developer driver. The Hamiltonian-generating code also relies on Sean Baxter's Modern GPU library, which you will need to download and compile.

Installation

Make sure that the CUDA toolkit and developer divers are installed following the guide here. Then:

For later builds you can simply type "make". If setup does not work you may have to manually download the MGPU library from the above link.

What Works and What Doesn't

The makefile will compile all the code. See nVidia's nvcc guide for more compiler flags you can pass.

Right now hamiltonian and lanczos should work to deliver the correct eigenvalues for the Heisenberg, TF Ising, and XY models. Lanczos applies reorthogonalization to prevent eigenstates from collapsing into each other.

To pass parameters, you will need to create data.dat. This file contains information that launcher.cu reads in to pass to functions. This way, you'll only need to compile when you make changes to the code itself. Each line in data.dat corresponds to one set of parameters, so if you're simulating five systems, data.dat should have five lines. On each line, you should put:

Number of sites | Sz sector considered (ignored for TFIM) | First coupling parameter (J1) | Second coupling parameter (J2) | Model considered | System dimension

For one parameter models (Heisenberg and XY), you only need to change J1. For the TFIM,the quantity usually called h is denoted J2 here.

Testing

The tests folder contains code which uses Google's C++ testing framework to run some unit tests on hamiltonian and lanczos. Follow gtest's README for compilation instructions. gtest is available as a package through most Linux distros.

To Do

  • Change the way lanczos looks for convergence
  • Improve the diagonalization scheme in lanczos
  • Add benchmarking information
  • Improve makefile to allow testing
  • Add additional geometries to lattice
  • Add more unit tests, especially to graphs

spin-models-on-gpu's People

Contributors

aparent avatar kshyatt avatar rgmelko avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.