diff --git a/docs/Manifest.toml b/docs/Manifest.toml index 2c48725f..4e8209b1 100644 --- a/docs/Manifest.toml +++ b/docs/Manifest.toml @@ -756,9 +756,9 @@ uuid = "6462fe0b-24de-5631-8697-dd941f90decc" [[deps.SortingAlgorithms]] deps = ["DataStructures"] -git-tree-sha1 = "c60ec5c62180f27efea3ba2908480f8055e17cee" +git-tree-sha1 = "5165dfb9fd131cf0c6957a3a7605dede376e7b63" uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" -version = "1.1.1" +version = "1.2.0" [[deps.SparseArrays]] deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] @@ -831,9 +831,9 @@ deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[deps.TranscodingStreams]] -git-tree-sha1 = "7c9196c8c83802d7b8ca7a6551a0236edd3bf731" +git-tree-sha1 = "49cbf7c74fafaed4c529d47d48c8f7da6a19eb75" uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -version = "0.10.0" +version = "0.10.1" weakdeps = ["Random", "Test"] [deps.TranscodingStreams.extensions] diff --git a/docs/make.jl b/docs/make.jl index c9039331..bf63883f 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -4,10 +4,11 @@ using QuantumLattices makedocs( format= Documenter.HTML( - prettyurls= get(ENV, "CI", "false") == "true", - canonical= "https://quantum-many-body.github.io/QuantumLattices.jl/latest/", - assets= ["assets/favicon.ico"], - analytics= "UA-89508993-1", + prettyurls = get(ENV, "CI", "false") == "true", + canonical = "https://quantum-many-body.github.io/QuantumLattices.jl/latest/", + assets = ["assets/favicon.ico"], + analytics = "UA-89508993-1", + size_threshold_warn = 204800, ), sitename= "QuantumLattices.jl", pages= [ diff --git a/docs/src/unitcell description framework/InternalDegreesOfFreedom.md b/docs/src/unitcell description framework/InternalDegreesOfFreedom.md index f22d3405..e6e06723 100644 --- a/docs/src/unitcell description framework/InternalDegreesOfFreedom.md +++ b/docs/src/unitcell description framework/InternalDegreesOfFreedom.md @@ -521,11 +521,9 @@ Operators with 2 Operator julia> another = Operator(2, FID{:f}(1, 1//2, 1)) + Operator(3, FID{:f}(1, 1//2, 2)); julia> ops * another -Operators with 4 Operator +Operators with 2 Operator Operator(6, FID{:f}(1, 1//2, 1), FID{:f}(1, 1//2, 2)) Operator(6, FID{:f}(1, 1//2, 2), FID{:f}(1, 1//2, 1)) - Operator(9, FID{:f}(1, 1//2, 2), FID{:f}(1, 1//2, 2)) - Operator(4, FID{:f}(1, 1//2, 1), FID{:f}(1, 1//2, 1)) julia> 2 * ops Operators with 2 Operator @@ -537,7 +535,7 @@ Operators with 2 Operator Operator(6, FID{:f}(1, 1//2, 2)) Operator(4, FID{:f}(1, 1//2, 1)) ``` -It is noted that in the result, the distributive law automatically applies. +It is noted that in the result, the distributive law automatically applies. Besides, the fermion operator relation $c^2=c\dagger^2=0$ is also used. As is usual, the Hermitian conjugate of an [`Operators`](@ref) can be obtained by the adjoint operator: ```jldoctest diff --git a/src/QuantumSystems.jl b/src/QuantumSystems.jl index 04b4a915..cef51a66 100644 --- a/src/QuantumSystems.jl +++ b/src/QuantumSystems.jl @@ -218,8 +218,9 @@ end Get the multiplication of two fermionic Fock operators. """ const block = quote - rank(f₁)>0 && rank(f₂)>0 && f₁[end]==f₂[1] && return 0 - return invoke(*, Tuple{OperatorProd, OperatorProd}, f₁, f₂) + result = invoke(*, Tuple{OperatorProd, OperatorProd}, f₁, f₂) + rank(f₁)>0 && rank(f₂)>0 && f₁[end]==f₂[1] && return replace(result, value=zero(valtype(result))) + return result end @eval @inline Base.:*(f₁::Operator{<:Number, <:ID{FID{:f}}}, f₂::Operator{<:Number, <:ID{FID{:f}}}) = $block @eval @inline Base.:*(f₁::Operator{<:Number, <:ID{Index{Int, <:FID{:f}}}}, f₂::Operator{<:Number, <:ID{Index{Int, <:FID{:f}}}}) = $block diff --git a/test/Manifest.toml b/test/Manifest.toml index c3c0522e..bcc9071a 100644 --- a/test/Manifest.toml +++ b/test/Manifest.toml @@ -656,9 +656,9 @@ uuid = "6462fe0b-24de-5631-8697-dd941f90decc" [[deps.SortingAlgorithms]] deps = ["DataStructures"] -git-tree-sha1 = "c60ec5c62180f27efea3ba2908480f8055e17cee" +git-tree-sha1 = "5165dfb9fd131cf0c6957a3a7605dede376e7b63" uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" -version = "1.1.1" +version = "1.2.0" [[deps.SparseArrays]] deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] @@ -722,9 +722,9 @@ deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[deps.TranscodingStreams]] -git-tree-sha1 = "7c9196c8c83802d7b8ca7a6551a0236edd3bf731" +git-tree-sha1 = "49cbf7c74fafaed4c529d47d48c8f7da6a19eb75" uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -version = "0.10.0" +version = "0.10.1" weakdeps = ["Random", "Test"] [deps.TranscodingStreams.extensions] diff --git a/test/QuantumSystems.jl b/test/QuantumSystems.jl index 00b16e9d..eec33847 100644 --- a/test/QuantumSystems.jl +++ b/test/QuantumSystems.jl @@ -103,7 +103,7 @@ end op₁ = Operator(1.5, id₁, id₂) op₂ = Operator(2.0, id₂, id₁) - @test op₁*op₂ == 0 + @test op₁*op₂ == Operator(0.0, id₁, id₂, id₂, id₁) op₁ = Operator(1.5, id₁, id₂) op₂ = Operator(2.0, id₁, id₂)