You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/mar.jl
+56-5Lines changed: 56 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -124,16 +124,67 @@ end
124
124
"""
125
125
$(TYPEDSIGNATURES)
126
126
127
-
Returns the marginal probability distribution of variables.
128
-
One can use `get_vars(tn)` to get the full list of variables in this tensor network.
127
+
Query the marginals of the variables in a [`TensorNetworkModel`](@ref).
128
+
The returned value is a dictionary of variables and their marginals, where a marginal is a joint probability distribution over the associated variables.
129
+
By default, the marginals of all individual variables are returned.
130
+
The marginal variables to query can be specified when constructing [`TensorNetworkModel`](@ref) as its field `mars`.
131
+
It will affect the contraction order of the tensor network.
132
+
133
+
### Arguments
134
+
- `tn`: the [`TensorNetworkModel`](@ref) to query.
135
+
- `usecuda`: whether to use CUDA for tensor contraction.
136
+
- `rescale`: whether to rescale the tensors during contraction.
137
+
138
+
### Example
139
+
The following example is from [`examples/asia/main.jl`](@ref).
0 commit comments