Skip to content

Commit

Permalink
Fix doc bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
waltergu committed Dec 13, 2024
1 parent 2d84319 commit ce7f905
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ In previous pages we have introduced the essential elements in detail of a quant

Accordingly, [`OperatorGenerator`](@ref) is the type to incorporate all these elements:
```julia
OperatorGenerator(terms::Tuple{Vararg{Term}}, bonds::Vector{<:Bond}, hilbert::Hilbert)
OperatorGenerator(bonds::Vector{<:Bond}, hilbert::Hilbert, terms::OneOrMore{Term})
```
Then, the operator representation of the lattice Hamiltonian can be obtained by the [`expand`](@ref) function:
```julia
Expand All @@ -36,7 +36,7 @@ lattice = Lattice([zero(Sym)], [one(Sym)]);
hilbert = Hilbert(site=>Fock{:f}(1, 2) for site=1:length(lattice));
t = Hopping(:t, symbols("t", real=true), 1);
U = Hubbard(:U, symbols("U", real=true));
operators = expand(OperatorGenerator((t, U), bonds(lattice, 1), hilbert))
operators = expand(OperatorGenerator(bonds(lattice, 1), hilbert, (t, U)))
```
Note to run the above codes, `SymPy.Sym` and `SymPy.symbols` should be imported first.

Expand Down Expand Up @@ -67,7 +67,7 @@ julia> hilbert = Hilbert(site=>Fock{:f}(1, 2) for site=1:length(lattice));
julia> t = Hopping(:t, 1.0, 1);
julia> gen = OperatorGenerator((t,), bonds(lattice, 1), hilbert);
julia> gen = OperatorGenerator(bonds(lattice, 1), hilbert, t);
julia> Parameters(gen)
(t = 1.0,)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/unitcell description framework/Introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ t = Hopping(:t, symbols("t", real=true), 1)
U = Hubbard(:U, symbols("U", real=true))
# get the Hamiltonian
operators = expand(OperatorGenerator((t, U), bonds(lattice, 1), hilbert))
operators = expand(OperatorGenerator(bonds(lattice, 1), hilbert, (t, U)))
```
The last line displays all the generated operators in the Hamiltonian in the LaTeX format. Here, in the subscript of the electronic annihilation/creation operator, an extra orbital index is also displayed.

Expand Down

0 comments on commit ce7f905

Please sign in to comment.