Skip to content

Commit

Permalink
backtrack the version of QuantumLattices.jl from 0.10 to 0.9 to fit E…
Browse files Browse the repository at this point in the history
…D, TBA etc.
  • Loading branch information
ZongYongyue committed Nov 25, 2024
1 parent bb75327 commit f84b2bc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ SharedArrays = "1a1011a3-84de-559e-8e89-a11a2f7dc383"
TensorKit = "07d1fe3e-3e46-537d-9eac-e9e13d0d4cec"

[compat]
MPSKit = "0.11.4"
MPSKit = "0.11"
MPSKitModels = "0.3"
QuantumLattices = "0.10.0"
QuantumLattices = "0.9"
TensorKit = "0.12"
julia = "1.9 - 1.11"
2 changes: 1 addition & 1 deletion src/DynamicalCorrelators.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module DynamicalCorrelators

using QuantumLattices: Hilbert, Term, Lattice, Neighbors, OperatorGenerator, Operator, CoordinatedIndex, FockIndex, Index, OperatorSet, bonds
using QuantumLattices: Hilbert, Term, Lattice, Neighbors, bonds, OperatorGenerator, Operator, CompositeIndex #CoordinatedIndex, FockIndex, Index, OperatorSet
using TensorKit: FermionParity, U1Irrep, SU2Irrep, Vect, Sector, ProductSector, AbstractTensorMap, TensorMap
using TensorKit: truncdim, truncerr, truncspace, truncbelow, , space, numout, numin, dual, fuse
using TensorKit: , , permute, domain, codomain, isomorphism, storagetype, @planar, @tensor, blocks, flip
Expand Down
12 changes: 6 additions & 6 deletions src/operators/operator2mpo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function hamiltonian(terms::Tuple{Vararg{Term}}, lattice::Lattice, hilbert::Hilb
return hamiltonian(operators, length(lattice), filling)
end

function hamiltonian(operators::OperatorSet{<:Operator}, len::Integer, filling::NTuple{2, Integer})
function hamiltonian(operators, len::Integer, filling::NTuple{2, Integer})#::OperatorSet{<:Operator}
mpos = Vector(undef, length(operators))
for (i, op) in enumerate(operators)
mpos[i] = _convert_operator(op, filling)
Expand All @@ -16,7 +16,7 @@ function hamiltonian(operators::OperatorSet{<:Operator}, len::Integer, filling::
return MPOHamiltonian(fill(pspace, len), mpos...)
end

function _convert_operator(op::Operator{<:Number, <:NTuple{2, CoordinatedIndex}}, filling::NTuple{2, Integer})
function _convert_operator(op::Operator{<:Number, <:NTuple{2, CompositeIndex}}, filling::NTuple{2, Integer})#::Operator{<:Number, <:NTuple{2, CoordinatedIndex}}
value = op.value
sites = unique([op.id[i].index.site for i in 1:2])
if length(sites) == 1
Expand All @@ -33,7 +33,7 @@ function _convert_operator(op::Operator{<:Number, <:NTuple{2, CoordinatedIndex}}
end
end

function _convert_operator(op::Operator{<:Number, <:NTuple{4, CoordinatedIndex}}, filling::NTuple{2, Integer})
function _convert_operator(op::Operator{<:Number, <:NTuple{4, CompositeIndex}}, filling::NTuple{2, Integer})#::Operator{<:Number, <:NTuple{4, CoordinatedIndex}}
value = op.value
sites = unique([op.id[i].index.site for i in 1:4])
if length(sites) == 1
Expand All @@ -50,8 +50,8 @@ function _convert_operator(op::Operator{<:Number, <:NTuple{4, CoordinatedIndex}}
end
end

function _index2tensor(elt::Type{<:Number}, ids::Index{FockIndex{:f, Int64, Rational{Int64}, Int64}, Int64}, side::Symbol, filling::NTuple{2, Integer})
ids.internal.nambu == 2 ? ten = e_plus : ten = e_min
ids.internal.spin == 1//2 ? spin = :up : spin = :down
function _index2tensor(elt::Type{<:Number}, ids, side::Symbol, filling::NTuple{2, Integer})#::Index{FockIndex{:f, Int64, Rational{Int64}, Int64}, Int64}
ids.iid.nambu == 2 ? ten = e_plus : ten = e_min#internal
ids.iid.spin == 1//2 ? spin = :up : spin = :down#internal
return ten(elt, U1Irrep, U1Irrep; side=side, spin=spin, filling=filling)
end

0 comments on commit f84b2bc

Please sign in to comment.