Skip to content

Commit

Permalink
Better handling of scalar type preservation in expand
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfishman committed May 22, 2024
1 parent 065d6d7 commit 30ae3df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ITensorTDVP"
uuid = "25707e16-a4db-4a07-99d9-4d67b7af0342"
authors = ["Matthew Fishman <[email protected]> and contributors"]
version = "0.4.3"
version = "0.4.4"

[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Expand All @@ -20,7 +20,7 @@ ITensorTDVPObserversExt = "Observers"

[compat]
Compat = "4"
ITensors = "0.3.58, 0.4, 0.5, 0.6"
ITensors = "0.6.10"
KrylovKit = "0.6, 0.7"
Observers = "0.2"
PackageExtensionCompat = "1"
Expand Down
3 changes: 1 addition & 2 deletions src/expand.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ function expand(
projectorⱼ = idⱼ - prime(basisⱼ, rinds) * dag(basisⱼ)
# Sum reference density matrices
ρⱼ = sum(reference -> prime(reference[j], rinds) * dag(reference[j]), references)
# TODO: Fix bug that `tr` isn't preserving the element type.
ρⱼ /= scalartype(state)(tr(ρⱼ))
ρⱼ /= tr(ρⱼ)
# Apply projectorⱼ
ρⱼ_projected = apply(apply(projectorⱼ, ρⱼ), projectorⱼ)
expanded_basisⱼ = basisⱼ
Expand Down

0 comments on commit 30ae3df

Please sign in to comment.