Skip to content

Commit 07a49d1

Browse files
authored
Define permute as an alias for aligndims (#16)
1 parent 4cdf95c commit 07a49d1

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ITensorBase"
22
uuid = "4795dd04-0d67-49bb-8f44-b89c448a1dc7"
33
authors = ["ITensor developers <[email protected]> and contributors"]
4-
version = "0.1.4"
4+
version = "0.1.5"
55

66
[deps]
77
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"

src/quirks.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,25 @@ dag(i::Index) = i
33
# TODO: Define this properly.
44
dag(a::ITensor) = a
55
# TODO: Deprecate.
6-
dim(i::Index) = dename(length(i))
6+
# Conversion to `Int` is used in case the output is named.
7+
dim(i::Index) = Int(length(i))
78
# TODO: Deprecate.
8-
dim(a::AbstractITensor) = unname(length(a))
9+
# Conversion to `Int` is used in case the output is named.
10+
dim(a::AbstractITensor) = Int(length(a))
911
# TODO: Define this properly.
1012
hasqns(i::Index) = false
1113
# TODO: Define this properly.
1214
hasqns(i::AbstractITensor) = false
13-
# TODO: Deprecate.
15+
# TODO: Deprecate, and/or decide on aliasing behavior of `ITensor`.
1416
itensor(parent::AbstractArray, nameddimsindices) = ITensor(parent, nameddimsindices)
1517
function itensor(parent::AbstractArray, i1::Index, i_rest::Index...)
1618
return ITensor(parent, (i1, i_rest...))
1719
end
1820
# TODO: Deprecate.
1921
order(a::AbstractArray) = ndims(a)
22+
# TODO: Deprecate.
23+
using NamedDimsArrays: aligndims
24+
permute(a::AbstractITensor, dimnames) = aligndims(a, dimnames)
2025

2126
# This seems to be needed to get broadcasting working.
2227
# TODO: Investigate this and see if we can get rid of it.

0 commit comments

Comments
 (0)