99
1010## Installation instructions
1111
12- This package resides in the ` ITensor/ITensorRegistry ` local registry.
13- In order to install, simply add that registry through your package manager.
14- This step is only required once.
15- ``` julia
16- julia> using Pkg: Pkg
17-
18- julia> Pkg. Registry. add (url= " https://github.com/ITensor/ITensorRegistry" )
19- ```
20- or:
21- ``` julia
22- julia> Pkg. Registry. add (url= " git@github.com:ITensor/ITensorRegistry.git" )
23- ```
24- 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.
25-
26- Then, the package can be added as usual through the package manager:
12+ The package can be added as usual through the package manager:
2713
2814``` julia
2915julia> Pkg. add (" ITensors" )
@@ -32,10 +18,31 @@ julia> Pkg.add("ITensors")
3218## Examples
3319
3420```` julia
35- using ITensors: ITensors
21+ using ITensors: ITensors, ITensor, Index
3622````
3723
38- Examples go here.
24+ TODO: This should be ` TensorAlgebra.qr ` .
25+
26+ ```` julia
27+ using LinearAlgebra: qr
28+ using NamedDimsArrays: NamedDimsArray, aligndims, dimnames, name, unname
29+ using Test: @test
30+ i = Index (2 )
31+ j = Index (2 )
32+ k = Index (2 )
33+ a = randn (i, j)
34+ @test a[j[2 ], i[1 ]] == a[1 , 2 ]
35+ @test a[j => 2 , i => 1 ] == a[1 , 2 ]
36+ a′ = randn (j, i)
37+ b = randn (j, k)
38+ c = a * b
39+ @test unname (c, (i, k)) ≈ unname (a, (i, j)) * unname (b, (j, k))
40+ d = a + a′
41+ @test unname (d, (i, j)) ≈ unname (a, (i, j)) + unname (a′, (i, j))
42+ @test a ≈ aligndims (a, (j, i))
43+ q, r = qr (a, (i,))
44+ @test q * r ≈ a
45+ ````
3946
4047---
4148
0 commit comments