Coder Social home page Coder Social logo

badhonnef's Introduction

This repository contains some template code that may be useful for algorithms-related exercises from the July 2021 Bad Honnef Physics School, Methods of Effective Field Theory and Lattice Field Theory. There's no need to use it if you already have a preferred codebase. Model solutions (with no guarantee of correctness) are in a separate branch.

Hybrid Monte Carlo

The goal is to write and test a hybrid Monte Carlo (HMC) algorithm for scalar phi^4 field theory in three dimensions. We can break this up into several small exercises, adapting larger-scale tutorials run by Stefan Schaefer at the 2009 Les Houches Summer School, Modern perspectives in lattice QCD.

First are fundamental coding tasks:

  • Generate gaussian-distributed momenta
  • Implement the computation of the effective hamiltonian H
  • Derive the 'force' needed to update the momenta
  • Implement the elementary updates of the scalar field variables and their conjugate momenta
  • Combine the elementary updates into a leap-frog integrator
  • Implement the computation of ΔH and set up the accept/reject test

Now we can test the code (optionally using the model solution):

  • Check the reversibility of the integrator
  • Check that the root-mean-square ΔH scales appropriately with the step size
  • Check the Creutz equality
  • Combine the elementary updates into an Omelyan--Mryglod--Folk integrator and compare the root-mean-square ΔH vs. the leap-frog integrator

Once the tests are passed, we can compute more interesting things:

  • Measure the magnetization
  • Monitor the equilibration of the magnetization across the critical line
  • Estimate the auto-correlation time of the magnetization across the critical line
  • Experiment as curiosity drives you (hep-lat/9806012 might provide inspiration)

Conjugate gradient

The goal is to write a conjugate gradient (CG) algorithm to invert a lattice fermion operator. Since lattice fermions are trickier than scalar field theories, a more complete framework is provided for those who don't have an existing codebase they would prefer to work with.

The provided code considers the tight-binding hamiltonian of graphene on the spatial honeycomb lattice. It is not suitable for serious research, in part because the fermion operator is implemented as a full matrix rather than a function carrying out the matrix--vector operation. On the other hand, this may make the CG implementation more transparent.

Note that this template code needs LAPACK in order to handle more than two spatial sites (L=1).

While the CG implementation is the only coding task here, there are various experiments to do once it is in place (optionally using the model solution):

  • Monitor the residual as a function of iteration number
  • Check how the convergence changes for different stopping conditions (resid in run)
  • Check how the convergence changes for different L or Nt (the setup time increases rapidly for larger L)

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.