Skip to content
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.

ITensor/WidenableArrays.jl

Repository files navigation

WidenableArrays.jl

Stable Dev Build Status Coverage Code Style: Blue Aqua

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="[email protected]: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("WidenableArrays")

Examples

using WidenableArrays: widenable, unwidenable
using Test: @test
a = widenable(zeros(2, 2))
@test eltype(a) === Float64
a[1, 1] = 1 + 2im
@test a[1, 1] == 1 + 2im
@test eltype(a) === Complex{Float64}

x = randn(2, 2)
a = widenable(copy(x))
a .= a .+ (1 + 2im) .* a
@test eltype(a) === Complex{Float64}
@test a == x .+ (1 + 2im) .* x

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