Skip to content

Commit ad266ba

Browse files
committed
fix typo
1 parent 5f50a32 commit ad266ba

File tree

11 files changed

+96
-99
lines changed

11 files changed

+96
-99
lines changed

docs/src/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ This package implements generic tensor networks to compute *solution space prope
88
The *solution space properties* include
99
* The maximum/minimum solution sizes,
1010
* The number of solutions at certain sizes,
11-
* The enumeration of solutions at certian sizes.
12-
* The direct sampling of solutions at certian sizes.
11+
* The enumeration of solutions at certain sizes.
12+
* The direct sampling of solutions at certain sizes.
1313

1414
The solvable problems include [Independent set problem](@ref), [Maximal independent set problem](@ref), [Cutting problem (Spin-glass problem)](@ref), [Vertex matching problem](@ref), [Binary paint shop problem](@ref), [Coloring problem](@ref), [Dominating set problem](@ref), [Set packing problem](@ref) and [Set covering problem](@ref).
1515

docs/src/performancetips.md

Lines changed: 73 additions & 73 deletions
Large diffs are not rendered by default.

examples/Coloring.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ problem = Coloring{3}(graph);
2525

2626
# ### Theory (can skip)
2727
# Type [`Coloring`](@ref) can be used for constructing the tensor network with optimized contraction order for a coloring problem.
28-
# Let us use 3-colouring problem defined on vertices as an example.
28+
# Let us use 3-coloring problem defined on vertices as an example.
2929
# For a vertex ``v``, we define the degree of freedoms ``c_v\in\{1,2,3\}`` and a vertex tensor labelled by it as
3030
# ```math
3131
# W(v) = \left(\begin{matrix}
@@ -42,7 +42,7 @@ problem = Coloring{3}(graph);
4242
# x & x & 1
4343
# \end{matrix}\right).
4444
# ```
45-
# The number of possible colouring can be obtained by contracting this tensor network by setting vertex tensor elements ``r_v, g_v`` and ``b_v`` to 1.
45+
# The number of possible coloring can be obtained by contracting this tensor network by setting vertex tensor elements ``r_v, g_v`` and ``b_v`` to 1.
4646

4747
# ## Solving properties
4848
# ##### counting all possible coloring

examples/DominatingSet.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ problem = DominatingSet(graph; optimizer=TreeSA());
2828
# ### Theory (can skip)
2929
# Let ``G=(V,E)`` be the target graph that we want to solve.
3030
# The tensor network representation map a vertex ``v\in V`` to a boolean degree of freedom ``s_v\in\{0, 1\}``.
31-
# We defined the restriction on a vertex and its neighbouring vertices ``N(v)``:
31+
# We defined the restriction on a vertex and its neighboring vertices ``N(v)``:
3232
# ```math
3333
# T(x_v)_{s_1,s_2,\ldots,s_{|N(v)|},s_v} = \begin{cases}
3434
# 0 & s_1=s_2=\ldots=s_{|N(v)|}=s_v=0,\\
@@ -37,7 +37,7 @@ problem = DominatingSet(graph; optimizer=TreeSA());
3737
# \end{cases}
3838
# ```
3939
# where ``w_v`` is the weight of vertex ``v``.
40-
# This tensor means if both ``v`` and its neighbouring vertices are not in ``D``, i.e., ``s_1=s_2=\ldots=s_{|N(v)|}=s_v=0``,
40+
# This tensor means if both ``v`` and its neighboring vertices are not in ``D``, i.e., ``s_1=s_2=\ldots=s_{|N(v)|}=s_v=0``,
4141
# this configuration is forbidden because ``v`` is not adjacent to any member in the set.
4242
# otherwise, if ``v`` is in ``D``, it has a contribution ``x_v^{w_v}`` to the final result.
4343
# One can check the contraction time space complexity of a [`DominatingSet`](@ref) instance by typing:

examples/IndependentSet.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ show_graph(graph; locs=locations, vertex_colors=
123123

124124
# ##### Enumerate all solutions best several solutions
125125
# We can use bounded or unbounded [`ConfigsMax`](@ref) to find all solutions with largest-K set sizes.
126-
# In most cases, the bounded (default) version is prefered because it can reduce the memory usage significantly.
126+
# In most cases, the bounded (default) version is preferred because it can reduce the memory usage significantly.
127127
all_max_configs = solve(problem, ConfigsMax(; bounded=true))[]
128128

129129
# The return value has type [`CountingTropical`](@ref), while its counting field having type [`ConfigEnumerator`](@ref). The `data` field of a [`ConfigEnumerator`](@ref) instance contains a vector of bit strings.

examples/MaxCut.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ max_cut_size_verify = cut_size(graph, max_vertex_config)
7171
show_graph(graph; locs=locations, vertex_colors=[
7272
iszero(max_vertex_config[i]) ? "white" : "red" for i=1:nv(graph)])
7373

74-
# where red vertices and white vertices are seperated by the cut.
74+
# where red vertices and white vertices are separated by the cut.

examples/MaximalIS.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ problem = MaximalIS(graph; optimizer=TreeSA());
2727
# ### Theory (can skip)
2828
# Let ``G=(V,E)`` be the target graph that we want to solve.
2929
# The tensor network representation map a vertex ``v\in V`` to a boolean degree of freedom ``s_v\in\{0, 1\}``.
30-
# We defined the restriction on its neighbourhood ``N(v)``:
30+
# We defined the restriction on its neighborhood ``N(v)``:
3131
# ```math
3232
# T(x_v)_{s_1,s_2,\ldots,s_{|N(v)|},s_v} = \begin{cases}
3333
# s_vx_v^{w_v} & s_1=s_2=\ldots=s_{|N(v)|}=0,\\
3434
# 1-s_v& \text{otherwise}.
3535
# \end{cases}
3636
# ```
37-
# The first case corresponds to all the neighbourhood vertices of ``v`` are not in ``I_{m}``, then ``v`` must be in ``I_{m}`` and contribute a factor ``x_{v}^{w_v}``,
37+
# The first case corresponds to all the neighborhood vertices of ``v`` are not in ``I_{m}``, then ``v`` must be in ``I_{m}`` and contribute a factor ``x_{v}^{w_v}``,
3838
# where ``w_v`` is the weight of vertex ``v``.
39-
# Otherwise, if any of the neighbouring vertices of ``v`` is in ``I_{m}``, ``v`` must not be in ``I_{m}`` by the independence requirement.
39+
# Otherwise, if any of the neighboring vertices of ``v`` is in ``I_{m}``, ``v`` must not be in ``I_{m}`` by the independence requirement.
4040

4141
# Its contraction time space complexity of a [`MaximalIS`](@ref) instance is no longer determined by the tree-width of the original graph ``G``.
4242
# It is often harder to contract this tensor network than to contract the one for regular independent set problem.

examples/PaintShop.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ show_graph(graph; locs=locations, texts=string.(sequence), edge_colors=
3434
# and the goal becomes a min-cut problem defined on black edges.
3535

3636
# ## Generic tensor network representation
37-
# Let us contruct the problem instance as bellow.
37+
# Let us construct the problem instance as bellow.
3838
problem = PaintShop(sequence);
3939

4040
# ### Theory (can skip)
4141
# Type [`PaintShop`](@ref) can be used for constructing the tensor network with optimized contraction order for solving a binary paint shop problem.
4242
# To obtain its tensor network representation, we associating car ``c_i`` (the ``i``-th character in our example) with a degree of freedom ``s_{c_i} \in \{0, 1\}``,
4343
# where we use ``0`` to denote the first appearance of a car is colored red and ``1`` to denote the first appearance of a car is colored blue.
44-
# For each black edges ``(i, i+1)``, we define an edge tensor labeld by ``(s_{c_i}, s_{c_{i+1}})`` as follows:
44+
# For each black edges ``(i, i+1)``, we define an edge tensor labeled by ``(s_{c_i}, s_{c_{i+1}})`` as follows:
4545
# If both cars on this edge are their first or second appearance
4646
# ```math
4747
# B^{\rm parallel} = \left(\begin{matrix}
@@ -75,7 +75,7 @@ max_config = solve(problem, GraphPolynomial())[]
7575

7676
# ### Counting properties
7777
# ##### graph polynomial
78-
# The graph polynomial of the binary paint shop problem in our convension is defined as
78+
# The graph polynomial of the binary paint shop problem in our convention is defined as
7979
# ```math
8080
# P(G, x) = \sum_{k=0}^{\delta(G)} p_k x^k
8181
# ```
@@ -96,5 +96,5 @@ show_graph(graph; locs=locations, texts=string.(sequence),
9696

9797
# Since we have different choices of initial color, the number of best solution is 2.
9898

99-
# The following function will check the solution and return you the number of color switchs
99+
# The following function will check the solution and return you the number of color switches
100100
num_paint_shop_color_switch(sequence, painting1)

examples/Satisfiability.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# ## Problem definition
77
# In logic and computer science, the [boolean satisfiability problem](https://en.wikipedia.org/wiki/Boolean_satisfiability_problem) is the problem of determining if there exists an interpretation that satisfies a given boolean formula.
8-
# One can specify a satisfiable problem in the [conjuctive normal form](https://en.wikipedia.org/wiki/Conjunctive_normal_form).
8+
# One can specify a satisfiable problem in the [conjunctive normal form](https://en.wikipedia.org/wiki/Conjunctive_normal_form).
99
# In boolean logic, a formula is in conjunctive normal form (CNF) if it is a conjunction (∧) of one or more clauses,
1010
# where a clause is a disjunction (∨) of literals.
1111
using GenericTensorNetworks
@@ -26,7 +26,7 @@ satisfiable(cnf, assignment)
2626
problem = Satisfiability(cnf);
2727

2828
# ### Theory (can skip)
29-
# We can contruct a [`Satisfiability`](@ref) problem to solve the above problem.
29+
# We can construct a [`Satisfiability`](@ref) problem to solve the above problem.
3030
# To generate a tensor network, we map a boolean variable ``x`` and its negation ``\neg x`` to a degree of freedom (label) ``s_x \in \{0, 1\}``,
3131
# where 0 stands for variable ``x`` having value `false` while 1 stands for having value `true`.
3232
# Then we map a clause to a tensor. For example, a clause ``¬x ∨ y ∨ ¬z`` can be mapped to a tensor labeled by ``(s_x, s_y, s_z)``.

examples/open.jl

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# # Open degree of freedoms
1+
# # Open degrees of freedom
2+
# Open degrees of freedom is useful when the graph under consideration is an induced subgraph of another graph.
3+
# The vertices connected to the rest part of the parent graph can not be summed over directly, which can be specified with the `openvertices` keyword argument in the graph problem constructor.
24
# Let us use the maximum independent set problem on Petersen graph as an example.
35
#
46
using GenericTensorNetworks, Graphs
@@ -10,10 +12,5 @@ problem = IndependentSet(graph; openvertices=[1,2,3])
1012

1113
mis_tropical_tensor = solve(problem, SizeMax())
1214

13-
# The MIS tropical tensor shows the MIS size under different configuration of open vertices.
14-
# It is useful in MIS tropical tensor analysis.
15-
# We can compatify (reference to be added) this MIS-Tropical tensor by typing
16-
17-
mis_compactify!(mis_tropical_tensor)
18-
19-
# It will eliminate some entries having no contribution to the MIS size when embeding this local graph into a larger one.
15+
# The return value is a rank-3 tensor, with its elements being the MIS sizes under different configuration of open vertices.
16+
# For the maximum independent set problem, this tensor is also called the MIS tropical tensor, which can be useful in the MIS tropical tensor analysis (reference to be added).

0 commit comments

Comments
 (0)