@@ -119,8 +119,9 @@ Constructor for an ITensor from a TensorStorage
119119and a set of indices.
120120The ITensor stores a view of the TensorStorage.
121121"""
122- ITensor (as:: AliasStyle , st:: TensorStorage , is):: ITensor =
123- ITensor (as, Tensor (as, st, Tuple (is)))
122+ ITensor (as:: AliasStyle , st:: TensorStorage , is):: ITensor = ITensor (
123+ as, Tensor (as, st, Tuple (is))
124+ )
124125ITensor (as:: AliasStyle , is, st:: TensorStorage ):: ITensor = ITensor (as, st, is)
125126
126127ITensor (st:: TensorStorage , is):: ITensor = itensor (Tensor (NeverAlias (), st, Tuple (is)))
@@ -137,8 +138,9 @@ of the input data when possible.
137138"""
138139itensor (args... ; kwargs... ):: ITensor = ITensor (AllowAlias (), args... ; kwargs... )
139140
140- ITensor (:: AliasStyle , args... ; kwargs... ):: ITensor =
141- error (" ITensor constructor with input arguments of types `$(typeof .(args)) ` not defined." )
141+ ITensor (:: AliasStyle , args... ; kwargs... ):: ITensor = error (
142+ " ITensor constructor with input arguments of types `$(typeof .(args)) ` not defined."
143+ )
142144
143145"""
144146 Tensor(::ITensor)
@@ -300,7 +302,7 @@ emptyITensor(is::Indices) = emptyITensor(EmptyNumber, is)
300302
301303emptyITensor (is... ) = emptyITensor (EmptyNumber, indices (is... ))
302304
303- function emptyITensor (:: Type{ElT} = EmptyNumber) where {ElT<: Number }
305+ function emptyITensor (( :: Type{ElT} ) = EmptyNumber) where {ElT<: Number }
304306 return itensor (EmptyTensor (ElT, ()))
305307end
306308
@@ -1092,8 +1094,9 @@ A[1, 2] # 2.0, same as: A[i => 1, i' => 2]
10921094end
10931095
10941096# Special case that handles indexing with `end` like `A[i => end, j => 3]`
1095- @propagate_inbounds getindex (T:: ITensor , I:: Union{Integer,LastVal} ...):: Any =
1096- _getindex (tensor (T), I... )
1097+ @propagate_inbounds getindex (T:: ITensor , I:: Union{Integer,LastVal} ...):: Any = _getindex (
1098+ tensor (T), I...
1099+ )
10971100
10981101# Simple version with just integer indexing, bounds checking gets done by NDTensors
10991102
@@ -1119,8 +1122,9 @@ A = ITensor(2.0, i, i')
11191122A[i => 1, i' => 2] # 2.0, same as: A[i' => 2, i => 1]
11201123```
11211124"""
1122- @propagate_inbounds (getindex (T:: ITensor , ivs:: Vararg{Any,N} ):: Any ) where {N} =
1123- _getindex (tensor (T), ivs... )
1125+ @propagate_inbounds (getindex (T:: ITensor , ivs:: Vararg{Any,N} ):: Any ) where {N} = _getindex (
1126+ tensor (T), ivs...
1127+ )
11241128
11251129# # Allowing one to get the first ITensor element if its an order 0 tensor or an order 1 tensor with a dimension of 1. Also convert GPU back to CPU
11261130@propagate_inbounds function getindex (T:: ITensor ):: Any
0 commit comments