Skip to content

Commit 7964a46

Browse files
committed
More docstring improvements
1 parent 00b0b25 commit 7964a46

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

src/hubbardoperators.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ const S⁻ = S_min
323323
S_x(elt::Type{<:Number}, particle_symmetry::Type{<:Sector}, spin_symmetry::Type{<:Sector})
324324
Sˣ(elt::Type{<:Number}, particle_symmetry::Type{<:Sector}, spin_symmetry::Type{<:Sector})
325325
326-
Return the one-body spin-1/2 x-operator on the electrons (only defined for `Trivial` symmetry). .
326+
Return the one-body spin-1/2 x-operator on the electrons (only defined for `Trivial` symmetry).
327327
""" S_x
328328
function S_x(P::Type{<:Sector} = Trivial, S::Type{<:Sector} = Trivial)
329329
return S_x(ComplexF64, P, S)

src/tjoperators.jl

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,26 @@ export S⁻S⁺, S⁺S⁻
3030
export transform_slave_fermion
3131

3232
const _docs_basis_table = """
33-
| tJ basis | slave-fermion |
34-
| -------- | ------------- |
35-
| |0⟩ | h⁺|0⟩ |
36-
| u⁺|0⟩ | bꜛ⁺|0⟩ |
37-
| d⁺|0⟩ | bꜜ⁺|0⟩ |
33+
```
34+
| label | tJ basis | slave-fermion |
35+
| ----- | -------- | ------------- |
36+
| |0⟩ | |∅⟩ | h⁺|∅⟩ |
37+
| |↑⟩ | u⁺|∅⟩ | bꜛ⁺|∅⟩ |
38+
| |↓⟩ | d⁺|∅⟩ | bꜜ⁺|∅⟩ |
39+
```
3840
"""
3941

4042
@doc """
4143
tj_space(particle_symmetry::Type{<:Sector}, spin_symmetry::Type{<:Sector}; slave_fermion::Bool = false)
4244
4345
Return the local hilbert space for a t-J-type model with the given particle and spin symmetries.
44-
The basis consists of the following vectors:
46+
The basis consists of the following states:
4547
4648
$_docs_basis_table
4749
48-
where `u⁺` and `d⁺` denote fermionic spin-up and spin-down creation operators, or when `slave_fermion = true`,
49-
``h`` is the fermionic holon operator, and ``bꜛ``, ``bꜜ`` are bosonic spinon operators.
50+
- `|∅⟩` is the vacuum state;
51+
- `u` and `d` denote fermionic spin-up and spin-down operators;
52+
- in the slave-fermion representation, ``h`` is the fermionic holon operator, and ``bꜛ``, ``bꜜ`` are bosonic spinon operators.
5053
5154
The possible symmetries are:
5255
- Particle number : `Trivial`, `U1Irrep`
@@ -130,7 +133,12 @@ for (opname, alias) in zip(
130133
# compatibility with Julia 1.10 (hub_doc is a Markdown.MD object)
131134
string(hub_doc)
132135
end
133-
tJ_doc = replace(tJ_doc, "[spin_symmetry::Type{<:Sector}])" => "[spin_symmetry::Type{<:Sector}]; slave_fermion::Bool = false)") * "Use `slave_fermion = true` to switch to the slave-fermion basis.\n"
136+
tJ_doc = if occursin("[spin_symmetry::Type{<:Sector}])", tJ_doc)
137+
replace(tJ_doc, "[spin_symmetry::Type{<:Sector}])" => "[spin_symmetry::Type{<:Sector}]; slave_fermion::Bool = false)")
138+
else
139+
replace(tJ_doc, "spin_symmetry::Type{<:Sector})" => "spin_symmetry::Type{<:Sector}; slave_fermion::Bool = false)")
140+
end
141+
tJ_doc = tJ_doc * "Use `slave_fermion = true` to switch to the slave-fermion basis.\n"
134142
@doc (tJ_doc) $opname
135143
end
136144

0 commit comments

Comments
 (0)