Skip to content

ITensor/BlockSparseArrays.jl

Folders and files

NameName
Last commit message
Last commit date
Apr 10, 2025
Nov 27, 2024
Apr 12, 2025
Apr 3, 2025
Apr 9, 2025
Apr 12, 2025
Apr 12, 2025
Nov 27, 2024
Nov 27, 2024
Apr 14, 2025
Mar 23, 2025
Apr 12, 2025
Mar 27, 2025

Repository files navigation

BlockSparseArrays.jl

Stable Dev Build Status Coverage Code Style: Blue Aqua

A block sparse array type in Julia based on the BlockArrays.jl interface.

Support

Flatiron Center for Computational Quantum Physics logo.

BlockSparseArrays.jl is supported by the Flatiron Institute, a division of the Simons Foundation.

Installation instructions

This package resides in the ITensor/ITensorRegistry local registry. In order to install, simply add that registry through your package manager. This step is only required once.

julia> using Pkg: Pkg

julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry")

or:

julia> Pkg.Registry.add(url="git@github.com:ITensor/ITensorRegistry.git")

if you want to use SSH credentials, which can make it so you don't have to enter your Github ursername and password when registering packages.

Then, the package can be added as usual through the package manager:

julia> Pkg.add("BlockSparseArrays")

Examples

using BlockArrays: Block
using BlockSparseArrays: BlockSparseArray, blockstoredlength
using Test: @test

a = BlockSparseArray{Float64}(undef, [2, 3], [2, 3])
a[Block(1, 2)] = randn(2, 3)
a[Block(2, 1)] = randn(3, 2)
@test blockstoredlength(a) == 2
b = a .+ 2 .* a'
@test Array(b)  Array(a) + 2 * Array(a')
@test blockstoredlength(b) == 2

This page was generated using Literate.jl.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages