Skip to content

Commit b03f752

Browse files
committed
add field description for algebras
1 parent 3bc7565 commit b03f752

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

src/arithematics.jl

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ end
8282
8383
Polynomial truncated to largest `K` orders. `T` is the coefficients type and `TO` is the orders type.
8484
85-
Example
85+
Fields
86+
------------------------
87+
* `coeffs` is the largest-K coefficients of a polynomial. In `GenericTensorNetworks`, it can be the counting or enumeration of solutions.
88+
* `maxorder` is the order of a polynomial.
89+
90+
Examples
8691
------------------------
8792
```jldoctest; setup=(using GenericTensorNetworks)
8893
julia> TruncatedPoly((1,2,3), 6)
@@ -191,7 +196,11 @@ This algebra maps
191196
* `0` to set [-Inf, -Inf, ..., -Inf, -Inf]
192197
* `1` to set [-Inf, -Inf, ..., -Inf, 0]
193198
194-
Example
199+
Fields
200+
------------------------
201+
* `orders` is a vector of [`Tropical`](@ref) ([`CoutingTropical`](@ref)) numbers as the largest-K solution sizes (solutions).
202+
203+
Examples
195204
------------------------------
196205
```jldoctest; setup=(using GenericTensorNetworks)
197206
julia> x = ExtendedTropical{3}(Tropical.([1.0, 2, 3]))
@@ -376,7 +385,11 @@ Set algebra for enumerating configurations, where `N` is the length of configura
376385
`C` is the size of storage in unit of `UInt64`,
377386
`S` is the bit width to store a single element in a configuration, i.e. `log2(# of flavors)`, for bitstrings, it is `1``.
378387
379-
Example
388+
Fields
389+
------------------------
390+
* `data` is a vector of [`StaticElementVector`](@ref) as the solution set.
391+
392+
Examples
380393
----------------------
381394
```jldoctest; setup=:(using GenericTensorNetworks)
382395
julia> a = ConfigEnumerator([StaticBitVector([1,1,1,0,0]), StaticBitVector([1,0,0,0,1])])
@@ -441,7 +454,11 @@ The algebra for sampling one configuration, where `N` is the length of configura
441454
!!! note
442455
`ConfigSampler` is a **probabilistic** commutative semiring, adding two config samplers do not give you deterministic results.
443456
444-
Example
457+
Fields
458+
----------------------
459+
* `data` is a [`StaticElementVector`](@ref) as the sampled solution.
460+
461+
Examples
445462
----------------------
446463
```jldoctest; setup=:(using GenericTensorNetworks, Random; Random.seed!(2))
447464
julia> ConfigSampler(StaticBitVector([1,1,1,0,0]))
@@ -495,7 +512,7 @@ Fields
495512
* `data` is the element stored in a `LEAF` node.
496513
* `left` and `right` are two operands of a `SUM` or `PROD` node.
497514
498-
Example
515+
Examples
499516
------------------------
500517
```jldoctest; setup=:(using GenericTensorNetworks)
501518
julia> s = SumProductTree(bv"00111")
@@ -697,7 +714,7 @@ end
697714
698715
Direct sampling configurations from a [`SumProductTree`](@ref) instance.
699716
700-
Example
717+
Examples
701718
-----------------------------
702719
```jldoctest; setup=:(using GenericTensorNetworks)
703720
julia> using Graphs

0 commit comments

Comments
 (0)