Skip to content

Commit d5b3804

Browse files
authored
Update compats and fix charge shift convention (#52)
* update `bose_hubbard_hamiltonian` charge shift convention * Bump MPSKit v0.13 compat * Make `potts_field` an actual alias * Update documenter to v1 * Bump MPSKit compat
1 parent dadd066 commit d5b3804

File tree

9 files changed

+47
-22
lines changed

9 files changed

+47
-22
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MPSKitModels"
22
uuid = "ca635005-6f8c-4cd1-b51d-8491250ef2ab"
33
authors = ["Maarten Van Damme", "Lukas Devos", "Gertian Roose", "Klaas Gunst"]
4-
version = "0.4.1"
4+
version = "0.4.2"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
@@ -13,7 +13,7 @@ TensorOperations = "6aa20fa7-93e2-5fca-9bc0-fbd0db3c71a2"
1313
TupleTools = "9d95972d-f1c8-5527-a6e0-b4b365fa01f6"
1414

1515
[compat]
16-
MPSKit = "0.12"
16+
MPSKit = "0.13.1"
1717
MacroTools = "0.5"
1818
PrecompileTools = "1"
1919
QuadGK = "2.11.1"

docs/Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
MPSKit = "bb1c41ca-d63c-52ed-829e-0820dda26502"
4+
MPSKitModels = "ca635005-6f8c-4cd1-b51d-8491250ef2ab"
35

46
[compat]
5-
Documenter = "0.25 - 0.30"
7+
Documenter = "1"

docs/make.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# if examples is not the current active environment, switch to it
2+
if Base.active_project() != joinpath(@__DIR__, "Project.toml")
3+
using Pkg
4+
Pkg.activate(@__DIR__)
5+
Pkg.develop(PackageSpec(; path=(@__DIR__) * "/../"))
6+
Pkg.resolve()
7+
Pkg.instantiate()
8+
end
9+
110
using Documenter
211
using MPSKitModels
312

@@ -13,6 +22,7 @@ makedocs(;
1322
"man/mpoham.md",
1423
"man/lattices.md",
1524
"man/models.md"],
16-
"Index" => "package_index.md"])
25+
"Index" => "package_index.md"],
26+
checkdocs=:public)
1727

1828
deploydocs(; repo="github.com/QuantumKitHub/MPSKitModels.jl.git")

docs/src/man/lattices.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ In order to facilitate this mapping, the combination of the `@mpoham` macro and
1010
```@docs
1111
AbstractLattice
1212
FiniteChain
13+
FiniteCylinder
14+
FiniteStrip
1315
InfiniteChain
1416
InfiniteCylinder
1517
InfiniteHelix
@@ -26,6 +28,7 @@ LatticePoint
2628
linearize_index
2729
vertices
2830
nearest_neighbours
31+
next_nearest_neighbours
2932
bipartition
3033
```
3134

@@ -39,4 +42,4 @@ Any mapping of linear indices can be used, but the following patterns can be hel
3942
```@docs
4043
backandforth_pattern
4144
frontandback_pattern
42-
```
45+
```

docs/src/man/models.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ CurrentModule = MPSKitModels
99
```@docs
1010
transverse_field_ising
1111
kitaev_model
12+
quantum_potts
1213
heisenberg_XXX
1314
heisenberg_XXZ
1415
heisenberg_XYZ
1516
bilinear_biquadratic_model
17+
tj_model
1618
hubbard_model
1719
bose_hubbard_model
1820
quantum_chemistry_hamiltonian
@@ -25,4 +27,4 @@ classical_ising
2527
sixvertex
2628
hard_hexagon
2729
qstate_clock
28-
```
30+
```

docs/src/man/mpoham.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The `@mpoham` macro
22

33
```@meta
4-
CurrentModule = TensorKit
4+
CurrentModule = MPSKitModels
55
```
66

77
When dealing with (quasi-) one-dimensional systems that are defined by a sum of local operators, a convenient representation exists in terms of a sparse matrix product operator with an upper diagonal structure (`MPOHamiltonian`).
@@ -10,3 +10,10 @@ The generation of such an object starting from a sum of local operators is facil
1010
```@docs
1111
@mpoham
1212
```
13+
14+
Internally, the macro generates operators that have some knowledge of the lattice structure, through the following structures:
15+
16+
```@docs
17+
LocalOperator
18+
SumOfLocalOperators
19+
```

docs/src/man/operators.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ S_zz
3434
S_plusmin
3535
S_minplus
3636
S_exchange
37+
spinmatrices
3738
```
3839

3940
For convenience, the Pauli matrices can also be recovered as ``σⁱ = 2 Sⁱ``.
@@ -62,6 +63,8 @@ Supported values of `symmetry` for the `X` operator are `Trivial` and `ZNIrrep{Q
6263
potts_X
6364
potts_Z
6465
potts_ZZ
66+
potts_field
67+
weyl_heisenberg_matrices
6568
```
6669

6770
## Bosonic operators
@@ -102,8 +105,12 @@ c_number
102105

103106
Spinful fermions.
104107

105-
```@docs
106-
e_plus
107-
e_min
108-
e_number
109-
```
108+
```@autodocs
109+
Modules = [MPSKitModels.HubbardOperators]
110+
```
111+
112+
TJ-model operators.
113+
114+
```@autodocs
115+
Modules = [MPSKitModels.TJOperators]
116+
```

src/models/hamiltonians.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ function bose_hubbard_model(elt::Type{<:Number}=ComplexF64,
371371
elseif symmetry === U1Irrep
372372
isinteger(2n) ||
373373
throw(ArgumentError("`U₁` symmetry requires halfinteger particle number"))
374-
H = MPSKit.add_physical_charge(H, fill(U1Irrep(-n), length(H)))
374+
H = MPSKit.add_physical_charge(H, fill(U1Irrep(n), length(H)))
375375
else
376376
throw(ArgumentError("symmetry not implemented"))
377377
end

src/operators/spinoperators.jl

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -469,15 +469,6 @@ function potts_ZZ(elt::Type{<:Number}, ::Type{ZNIrrep{Q}}; q=Q) where {Q}
469469
return ZZ
470470
end
471471

472-
"""
473-
potts_field([eltype::Type{<:Number}], [symmetry::Type{<:Sector}]; q=3)
474-
475-
The Potts field operator ``X``, an alias for ``potts_X``.
476-
"""
477-
potts_field(args...; kwargs...) = potts_X(args...; kwargs...)
478-
479-
# Generalisations of Pauli matrices
480-
481472
"""
482473
weyl_heisenberg_matrices(dimension [, eltype])
483474
@@ -516,6 +507,7 @@ end
516507

517508
"""
518509
potts_X([eltype::Type{<:Number}], [symmetry::Type{<:Sector}]; Q=3)
510+
potts_field([eltype::Type{<:Number}], [symmetry::Type{<:Sector}]; Q=3)
519511
520512
The Potts X operator, also known as the shift operator, where X^q=1.
521513
"""
@@ -539,3 +531,5 @@ function potts_X(elt::Type{<:Number}, ::Type{ZNIrrep{Q}}; q=Q) where {Q}
539531
end
540532
return X
541533
end
534+
535+
const potts_field = potts_X

0 commit comments

Comments
 (0)