Skip to content

Commit 32cc44f

Browse files
[ITensors] Index filtering docstring improvements (ITensor#1171)
1 parent f42bb08 commit 32cc44f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/itensor.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,12 +1406,23 @@ for find in (:commonind, :noncommonind, :uniqueind, :unionind)
14061406
end
14071407
end
14081408

1409+
function index_filter_kwargs_docstring()
1410+
return """
1411+
Optional keyword arguments:
1412+
* tags::String - a tag name or comma separated list of tag names that the returned indices must all have
1413+
* plev::Int - common prime level that the returned indices must all have
1414+
* inds - Index or collection of indices. Returned indices must come from this set of indices.
1415+
"""
1416+
end
1417+
14091418
# intersect
14101419
@doc """
14111420
commoninds(A, B; kwargs...)
14121421
14131422
Return a Vector with indices that are common between the indices of `A` and `B`
14141423
(the set intersection, similar to `Base.intersect`).
1424+
1425+
$(index_filter_kwargs_docstring())
14151426
""" commoninds
14161427

14171428
# firstintersect
@@ -1421,6 +1432,8 @@ Return a Vector with indices that are common between the indices of `A` and `B`
14211432
Return the first `Index` common between the indices of `A` and `B`.
14221433
14231434
See also [`commoninds`](@ref).
1435+
1436+
$(index_filter_kwargs_docstring())
14241437
""" commonind
14251438

14261439
# symdiff
@@ -1429,6 +1442,8 @@ See also [`commoninds`](@ref).
14291442
14301443
Return a Vector with indices that are not common between the indices of `A` and
14311444
`B` (the symmetric set difference, similar to `Base.symdiff`).
1445+
1446+
$(index_filter_kwargs_docstring())
14321447
""" noncommoninds
14331448

14341449
# firstsymdiff
@@ -1438,6 +1453,8 @@ Return a Vector with indices that are not common between the indices of `A` and
14381453
Return the first `Index` not common between the indices of `A` and `B`.
14391454
14401455
See also [`noncommoninds`](@ref).
1456+
1457+
$(index_filter_kwargs_docstring())
14411458
""" noncommonind
14421459

14431460
# setdiff
@@ -1446,6 +1463,8 @@ See also [`noncommoninds`](@ref).
14461463
14471464
Return Vector with indices that are unique to the set of indices of `A` and not
14481465
in `B` (the set difference, similar to `Base.setdiff`).
1466+
1467+
$(index_filter_kwargs_docstring())
14491468
""" uniqueinds
14501469

14511470
# firstsetdiff
@@ -1455,6 +1474,8 @@ in `B` (the set difference, similar to `Base.setdiff`).
14551474
Return the first `Index` unique to the set of indices of `A` and not in `B`.
14561475
14571476
See also [`uniqueinds`](@ref).
1477+
1478+
$(index_filter_kwargs_docstring())
14581479
""" uniqueind
14591480

14601481
# union
@@ -1463,6 +1484,8 @@ See also [`uniqueinds`](@ref).
14631484
14641485
Return a Vector with indices that are the union of the indices of `A` and `B`
14651486
(the set union, similar to `Base.union`).
1487+
1488+
$(index_filter_kwargs_docstring())
14661489
""" unioninds
14671490

14681491
# firstunion
@@ -1472,6 +1495,8 @@ Return a Vector with indices that are the union of the indices of `A` and `B`
14721495
Return the first `Index` in the union of the indices of `A` and `B`.
14731496
14741497
See also [`unioninds`](@ref).
1498+
1499+
$(index_filter_kwargs_docstring())
14751500
""" unionind
14761501

14771502
firstind(A...; kwargs...) = getfirst(map_itensor2inds(A)...; kwargs...)

0 commit comments

Comments
 (0)