Skip to content

Commit bdd5510

Browse files
committed
Update README
1 parent 6a2b4d7 commit bdd5510

File tree

2 files changed

+25
-18
lines changed

2 files changed

+25
-18
lines changed

README.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,7 @@
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
2915
julia> 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

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[deps]
2-
ITensors = "3b3c2350-9fb7-4c22-a0c2-b3f20f86ea25"
2+
ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5"
33
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
44
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"

0 commit comments

Comments
 (0)