Giter Site home page Giter Site logo

itensorparallel.jl's Introduction

Homepage: http://itensor.org/

An efficient and flexible C++ library for performing tensor network calculations.

The foundation of the library is the Intelligent Tensor or ITensor. Contracting ITensors is no harder than multiplying scalars: matching indices automatically find each other and contract. This makes it easy to transcribe tensor network diagrams into correct, efficient code.

Installation instructions can be found in the INSTALL file.

Citation

If you use ITensors.jl in your work, for now please cite the arXiv preprint:

@misc{fishman2020itensor,
    title={The \mbox{ITensor} Software Library for Tensor Network Calculations},
    author={Matthew Fishman and Steven R. White and E. Miles Stoudenmire},
    year={2020},
    eprint={2007.14822},
    archivePrefix={arXiv},
    primaryClass={cs.MS}
}

itensorparallel.jl's People

Contributors

b-kloss avatar jamesetsmith avatar mtfishman avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

itensorparallel.jl's Issues

Use package extensions

Switch to using a package extension for any code that depends on MPI, so that MPI doesn't need to be a dependency (and same for Distributed, but that one is a standard library so not as important).

In fact, we could make this package a package extension of ITensors.jl once it is a bit more developed.

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

[BUG] Threaded_blocksparse incompatible with MPI when using DMRG with QNs

If one tries to activate threaded_blocksparse and MPI parallelization together to perform DMRG calculation using number conserving sites (doesn't matter the SiteType) the following error is returned during the exact diagonalization step (in this particular case the code ran was this example)

ERROR: LoadError: BoundsError: attempt to access 4-element Vector{Pair{QN, Int64}} at index [5]
Stacktrace:
  [1] getindex
    @ ./array.jl:861 [inlined]
  [2] getindex
    @ ./abstractarray.jl:1221 [inlined]
  [3] blockdim
    @ ~/.julia/packages/ITensors/5dcHw/src/qn/qnindex.jl:15 [inlined]
  [4] blockdim
    @ ~/.julia/packages/ITensors/5dcHw/src/qn/qnindex.jl:256 [inlined]
  [5] blockdim
    @ ~/.julia/packages/ITensors/5dcHw/src/qn/qnindex.jl:273 [inlined]
  [6] blockdim
    @ ~/.julia/packages/NDTensors/lbVmG/src/blocksparse/blockdims.jl:131 [inlined]
  [7] #124
    @ ~/.julia/packages/NDTensors/lbVmG/src/blocksparse/blockdims.jl:140 [inlined]
  [8] macro expansion
    @ ./ntuple.jl:74 [inlined]
  [9] ntuple
    @ ./ntuple.jl:69 [inlined]
 [10] blockdims
    @ ~/.julia/packages/NDTensors/lbVmG/src/blocksparse/blockdims.jl:140 [inlined]
 [11] blockdim
    @ ~/.julia/packages/NDTensors/lbVmG/src/blocksparse/blockdims.jl:149 [inlined]
 [12] blockoffsets(blocks::Vector{Block{4}}, inds::NTuple{4, Index{Vector{Pair{QN, Int64}}}})
    @ NDTensors ~/.julia/packages/NDTensors/lbVmG/src/blocksparse/blockoffsets.jl:71
 [13] (NDTensors.BlockSparseTensor)(#unused#::Type{Float64}, blocks::Vector{Block{4}}, inds::NTuple{4, Index{Vector{Pair{QN, Int64}}}})
    @ NDTensors ~/.julia/packages/NDTensors/lbVmG/src/blocksparse/blocksparsetensor.jl:97
 [14] _Allreduce(#unused#::Type{NDTensors.BlockSparse{Float64, Vector{Float64}, 4}}, sendbuf::ITensor, op::Function, comm::MPI.Comm)
    @ ITensorParallel ~/.julia/packages/ITensorParallel/63YWQ/src/mpi_projmposum.jl:44
 [15] _Allreduce(sendbuf::ITensor, op::Function, comm::MPI.Comm)
    @ ITensorParallel ~/.julia/packages/ITensorParallel/63YWQ/src/mpi_projmposum.jl:22
 [16] eigsolve(A::MPISum{ProjMPO}, x₀::ITensor, howmany::Int64, which::Symbol, alg::KrylovKit.Lanczos{KrylovKit.ModifiedGramSchmidt2, Float64})
    @ KrylovKit ~/.julia/packages/KrylovKit/kWdb6/src/eigsolve/lanczos.jl:11

It looks like the error slightly changes by changing the dimension of the MPS. In the previous example I used a 8x2 lattice while if I use a 4x2 lattice I get

ERROR: LoadError: MPIError(15): MPI_ERR_TRUNCATE: message truncated
Stacktrace:
 [1] MPI_Allreduce
   @ ~/.julia/packages/MPI/tJjHF/src/api/generated_api.jl:288 [inlined]
 [2] Allreduce!(rbuf::MPI.RBuffer{Vector{Float64}, Vector{Float64}}, op::MPI.Op, comm::MPI.Comm)
   @ MPI ~/.julia/packages/MPI/tJjHF/src/collective.jl:653
 [3] _Allreduce(sendbuf::ITensor, op::Function, comm::MPI.Comm)
   @ ITensorParallel ~/.julia/packages/ITensorParallel/63YWQ/src/mpi_projmposum.jl:22
 [4] eigsolve(A::MPISum{ProjMPO}, x₀::ITensor, howmany::Int64, which::Symbol, alg::KrylovKit.Lanczos{KrylovKit.ModifiedGramSchmidt2, Float64})
   @ KrylovKit ~/.julia/packages/KrylovKit/kWdb6/src/eigsolve/lanczos.jl:11
in expression starting at /mnt/home/nbaldelli/parheis.jl:61

threaded_blocksparse and MPI work smoothly singularly by deactivating the other and work together by turning off the QNs conservation.

I ran the code using mpirun by using the following bash script:

#!/bin/bash
#SBATCH -N2
#SBATCH --ntasks-per-node 1 
#SBATCH --cpus-per-task 8

module purge
module load slurm
module load openmpi/4
module load julia
julia --project -e 'ENV["JULIA_MPI_BINARY"]="system"; using Pkg; Pkg.build("MPI"; verbose=true)'
mpirun julia -t 8 <name_file_here>

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.