Giter VIP home page Giter VIP logo

spin-ed's Introduction

SpinED

GitHub CI GitHub Release BSD-3-Clause license

User-friendly exact diagonalization package for quantum many-body systems.

๐Ÿ”ง Installing

We provide pre-built static executables for Linux. Go to Releases page and download the executable to your location of choice. That's it! ๐Ÿฅณ

โ„น๏ธ Note: executables are currently tagged by git commits from which they were built. It is suggested that after downloading the application you create a symbolic link to it:

ln --symbolic SpinED SpinED-8b0138b # the commit hash may differ in your case

๐Ÿ“ Usage

Using SpinED is quite simple. Just feed it your input yaml file. For example:

./SpinED my_system.yaml

where my_system.yaml looks like this:

basis:
  number_spins: 4
  symmetries: []
hamiltonian:
  name: "Heisenberg Hamiltonian"
  terms:
    - matrix: [[1,  0,  0,  0],
               [0, -1,  2,  0],
               [0,  2, -1,  0],
               [0,  0,  0,  1]]
      sites: [[0, 1], [1, 2], [2, 3], [3, 0]]
observables: []

This will create a file exact_diagonalization_result.h5 which will contain the ground state of the Hamiltonian.

$ h5dump -H exact_diagonalization_result.h5
HDF5 "exact_diagonalization_result.h5" {
GROUP "/" {
   GROUP "basis" {
      DATASET "representatives" {
         DATATYPE  H5T_STD_U64LE
         DATASPACE  SIMPLE { ( 16 ) / ( 16 ) }
      }
   }
   GROUP "hamiltonian" {
      DATASET "eigenvalues" {
         DATATYPE  H5T_IEEE_F64LE
         DATASPACE  SIMPLE { ( 1 ) / ( 1 ) }
      }
      DATASET "eigenvectors" {
         DATATYPE  H5T_IEEE_F64LE
         DATASPACE  SIMPLE { ( 16, 1 ) / ( 16, 1 ) }
      }
      DATASET "residuals" {
         DATATYPE  H5T_IEEE_F64LE
         DATASPACE  SIMPLE { ( 1 ) / ( 1 ) }
      }
   }
}
}

And we can check that it computed the correct energy:

$ h5dump -d /hamiltonian/eigenvalues exact_diagonalization_result.h5
HDF5 "exact_diagonalization_result.h5" {
DATASET "/hamiltonian/eigenvalues" {
   DATATYPE  H5T_IEEE_F64LE
   DATASPACE  SIMPLE { ( 1 ) / ( 1 ) }
   DATA {
   (0): -8
   }
}
}

This was a very simple example! Have a look at template.yaml which describes all supported fields. example/ folder also contains various usage examples.

Contributing and support

If you use this package for your research and have questions or suggestions, please, don't hesitate to contact me on Github or email.

Also, if the fact that most code here is written in Haskell doesn't scare you, feel free to create a pull request implementing new features or fixing bugs!

spin-ed's People

Contributors

twesterhout avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

jankoziol

spin-ed's Issues

Lower required glibc version

Currently SpinED-x86_64.AppImage requires quite modern libstdc++ and glibc to run. It should be possible to recompile everything for, say, glibc 2.12 and bundle libstdc++ in the AppImage.

Convergence Issues

Hi there!

General

I am new to ED and was playing around with QuSpin for a while and stumbled upon SpinED. I am interested in determining the elementary gap of a Heisenberg ladder with long-range interactions using ED. I want to follow the same procedure as in (Yang et al. 2020). I can reproduce the the results but I noticed that system sizes of L=16 become pretty challenging and since i have a larger parameter space in my project and need to repeat the procedure several times I was hoping I could speed up these calculations for large systems with SpinED.

Issue

I tried to reproduce the results that I calculated with QuSpin and simply modified my python script to output a yaml-file for the ground-state energy and and the excitation.

Example for L=10:
yaml-file for ground-state energy:

basis:
  number_spins: 20
  hamming_weight: 10
  spin_inversion: 1
  symmetries:
    - permutation: [18, 19,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17]
      sector: 0
    - permutation: [19, 18, 17, 16, 15, 14, 13, 12, 11, 10,  9,  8,  7,  6,  5,  4,  3,  2,  1,  0]
      sector: 0
hamiltonian:
  name: LR_Heisenberg_Ladder_GS
  terms:
  - matrix: [[ 0.25,  0.  ,  0.  ,  0.  ],
                 [ 0.  , -0.25,  0.5 ,  0.  ],
                 [ 0.  ,  0.5 , -0.25,  0.  ],
                 [ 0.  ,  0.  ,  0.  ,  0.25]]
     sites: [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9], [10, 11], [12, 13], [14, 15], [16, 17], [18, 19]]
    ...
observables: []
number_vectors: 1
datatype: float32
output: output/LR_Heisenberg_Ladder_GS_L10.h5

yaml-file for excitation: (only difference in the symmetry sector)

basis:
  spin_inversion: -1
  symmetries:
    - permutation: [18, 19,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17]
      sector: 3

While I quickly obtain the same ground-state energy as in QuSpin the other calculation does not seem to stop. I looked at the terminal output and noticed that the residual norm quickly gets smaller but then starts grow and continues to do so such that the precision goal is never met. To compare the result anyway I reduced the precision for the excitation to get an idea whether I am doing something completely wrong:

# GS Energy Ex Energy Gap
# QuSpin
-13.499565 -13.083627 0.41593838
# SpinED (precision for excitation 0.01)
-13.499563 -12.942371 0.55719185 

Though the deviation seems to be larger than the precision goal, i think the results are close enough that this might indeed be a convergence issue. Further, I checked my matrices, bond lists and symmetries and compared it to my QuSpin input and couldn't find any deviation so far. I just don't see the issue here.

Questions

Do you have any suggestions what might be the problem or what can I try further?
Are there any known issues of the Lanczos algorithm that might explain the strange convergence behaviour?
Or might there be an issue in SpinED or PRIMME itself?

PS.

I attached the complete yaml-files and the terminal output for the ground-state energy and excitation.
LR_Heisenberg_Ladder.zip

I am looking forward for any kind of help!

Change interaction axis

I have a SpinED file and a .yaml file where I define an Ising model for a system of n spins (see attachments). At this point, the interactions between the spins are directed along the Z-axis, and the magnetic field along the X-axis.
I need to change these axes, that is, so that the interaction is along the X-axis, and the magnetic field is along the Z-axis.
How to do it?
ising_16.zip

J1-J2 Model

I need to do an exact diagonalization and get the eigenvectors J1-J2 model (square lattice) with different J2 (J1 is fixed and equal to 1). Is it possible to do this using SpinED?

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.