diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 509bf2b..c007aca 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.11.2","generation_timestamp":"2024-12-19T04:24:21","documenter_version":"1.8.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.11.2","generation_timestamp":"2024-12-19T14:16:56","documenter_version":"1.8.0"}} \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index 6233743..3987c4f 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,17 +1,7 @@ -Home · NamedDimsArrays.jl

NamedDimsArrays.jl

Stable Dev Build Status Coverage Code Style: Blue Aqua

Installation instructions

julia> using Pkg: Pkg
+Home · NamedDimsArrays.jl

NamedDimsArrays.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.add(url="https://github.com/ITensor/BroadcastMapConversion.jl")
-
-julia> Pkg.add(url="https://github.com/ITensor/NestedPermutedDimsArrays.jl")
-
-julia> Pkg.add(url="https://github.com/ITensor/TypeParameterAccessors.jl")
-
-julia> Pkg.add(url="https://github.com/ITensor/SparseArraysBase.jl")
-
-julia> Pkg.add(url="https://github.com/ITensor/TensorAlgebra.jl")
-
-julia> Pkg.add(url="https://github.com/ITensor/NamedDimsArrays.jl")

Examples

using NamedDimsArrays: align, dimnames, named, unname
+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("NamedDimsArrays")

Examples

using NamedDimsArrays: align, dimnames, named, unname
 using TensorAlgebra: contract
 
 # Named dimensions
@@ -37,4 +27,4 @@
 
 # Permute dimensions (like `ITensors.permute`)
 na1 = align(na1, (j, i))
-@show na1[i => 1, j => 2] == na1[2, 1]
true

This page was generated using Literate.jl.

+@show na1[i => 1, j => 2] == na1[2, 1]
true

This page was generated using Literate.jl.

diff --git a/dev/search_index.js b/dev/search_index.js index 36f6e4e..48da14c 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"","page":"Home","title":"Home","text":"EditURL = \"../../examples/README.jl\"","category":"page"},{"location":"#NamedDimsArrays.jl","page":"Home","title":"NamedDimsArrays.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"(Image: Stable) (Image: Dev) (Image: Build Status) (Image: Coverage) (Image: Code Style: Blue) (Image: Aqua)","category":"page"},{"location":"#Installation-instructions","page":"Home","title":"Installation instructions","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"julia> using Pkg: Pkg\n\njulia> Pkg.add(url=\"https://github.com/ITensor/BroadcastMapConversion.jl\")\n\njulia> Pkg.add(url=\"https://github.com/ITensor/NestedPermutedDimsArrays.jl\")\n\njulia> Pkg.add(url=\"https://github.com/ITensor/TypeParameterAccessors.jl\")\n\njulia> Pkg.add(url=\"https://github.com/ITensor/SparseArraysBase.jl\")\n\njulia> Pkg.add(url=\"https://github.com/ITensor/TensorAlgebra.jl\")\n\njulia> Pkg.add(url=\"https://github.com/ITensor/NamedDimsArrays.jl\")","category":"page"},{"location":"#Examples","page":"Home","title":"Examples","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"using NamedDimsArrays: align, dimnames, named, unname\nusing TensorAlgebra: contract\n\n# Named dimensions\ni = named(2, \"i\")\nj = named(2, \"j\")\nk = named(2, \"k\")\n\n# Arrays with named dimensions\nna1 = randn(i, j)\nna2 = randn(j, k)\n\n@show dimnames(na1) == (\"i\", \"j\")\n\n# Indexing\n@show na1[j => 2, i => 1] == na1[1, 2]\n\n# Tensor contraction\nna_dest = contract(na1, na2)\n\n@show issetequal(dimnames(na_dest), (\"i\", \"k\"))\n# `unname` removes the names and returns an `Array`\n@show unname(na_dest, (i, k)) ≈ unname(na1) * unname(na2)\n\n# Permute dimensions (like `ITensors.permute`)\nna1 = align(na1, (j, i))\n@show na1[i => 1, j => 2] == na1[2, 1]","category":"page"},{"location":"","page":"Home","title":"Home","text":"","category":"page"},{"location":"","page":"Home","title":"Home","text":"This page was generated using Literate.jl.","category":"page"}] +[{"location":"","page":"Home","title":"Home","text":"EditURL = \"../../examples/README.jl\"","category":"page"},{"location":"#NamedDimsArrays.jl","page":"Home","title":"NamedDimsArrays.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"(Image: Stable) (Image: Dev) (Image: Build Status) (Image: Coverage) (Image: Code Style: Blue) (Image: Aqua)","category":"page"},{"location":"#Installation-instructions","page":"Home","title":"Installation instructions","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using Pkg: Pkg\n\njulia> Pkg.Registry.add(url=\"https://github.com/ITensor/ITensorRegistry\")","category":"page"},{"location":"","page":"Home","title":"Home","text":"or:","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> Pkg.Registry.add(url=\"git@github.com:ITensor/ITensorRegistry.git\")","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Then, the package can be added as usual through the package manager:","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> Pkg.add(\"NamedDimsArrays\")","category":"page"},{"location":"#Examples","page":"Home","title":"Examples","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"using NamedDimsArrays: align, dimnames, named, unname\nusing TensorAlgebra: contract\n\n# Named dimensions\ni = named(2, \"i\")\nj = named(2, \"j\")\nk = named(2, \"k\")\n\n# Arrays with named dimensions\nna1 = randn(i, j)\nna2 = randn(j, k)\n\n@show dimnames(na1) == (\"i\", \"j\")\n\n# Indexing\n@show na1[j => 2, i => 1] == na1[1, 2]\n\n# Tensor contraction\nna_dest = contract(na1, na2)\n\n@show issetequal(dimnames(na_dest), (\"i\", \"k\"))\n# `unname` removes the names and returns an `Array`\n@show unname(na_dest, (i, k)) ≈ unname(na1) * unname(na2)\n\n# Permute dimensions (like `ITensors.permute`)\nna1 = align(na1, (j, i))\n@show na1[i => 1, j => 2] == na1[2, 1]","category":"page"},{"location":"","page":"Home","title":"Home","text":"","category":"page"},{"location":"","page":"Home","title":"Home","text":"This page was generated using Literate.jl.","category":"page"}] }