Skip to content

Commit 73c979f

Browse files
committed
add field description for algebras
1 parent b03f752 commit 73c979f

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

src/bitvector.jl

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,26 @@
66
`S` is the stride defined as the `log2(# of flavors)`.
77
When the number of flavors is 2, it is a `StaticBitVector`.
88
9-
Example
9+
Fields
10+
-------------------------------
11+
* `data` is a tuple of `UInt64` for storing the configuration of static elements.
12+
13+
Examples
1014
-------------------------------
1115
```jldoctest; setup=:(using GenericTensorNetworks)
1216
julia> ev = StaticElementVector(3, [1,2,0,1,2])
1317
12012
1418
1519
julia> ev[2]
1620
0x0000000000000002
21+
22+
julia> collect(Int, ev)
23+
5-element Vector{Int64}:
24+
1
25+
2
26+
0
27+
1
28+
2
1729
```
1830
"""
1931
struct StaticElementVector{N,S,C} <: AbstractVector{UInt64}
@@ -87,14 +99,22 @@ end
8799
StaticBitVector{N,C} = StaticElementVector{N,1,C}
88100
StaticBitVector(x::AbstractVector)
89101
90-
Example
102+
Examples
91103
-------------------------------
92104
```jldoctest; setup=:(using GenericTensorNetworks)
93105
julia> sb = StaticBitVector([1,0,0,1,1])
94106
10011
95107
96108
julia> sb[3]
97109
0x0000000000000000
110+
111+
julia> collect(Int, sb)
112+
5-element Vector{Int64}:
113+
1
114+
0
115+
0
116+
1
117+
1
98118
```
99119
"""
100120
const StaticBitVector{N,C} = StaticElementVector{N,1,C}

0 commit comments

Comments
 (0)