Skip to content
This repository was archived by the owner on Mar 20, 2025. It is now read-only.

Commit b3cc17c

Browse files
authored
Better handling of scalar type preservation in expand (#82)
1 parent 065d6d7 commit b3cc17c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ITensorTDVP"
22
uuid = "25707e16-a4db-4a07-99d9-4d67b7af0342"
33
authors = ["Matthew Fishman <mfishman@flatironinstitute.org> and contributors"]
4-
version = "0.4.3"
4+
version = "0.4.4"
55

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

2121
[compat]
2222
Compat = "4"
23-
ITensors = "0.3.58, 0.4, 0.5, 0.6"
23+
ITensors = "0.6.10"
2424
KrylovKit = "0.6, 0.7"
2525
Observers = "0.2"
2626
PackageExtensionCompat = "1"

src/expand.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ function expand(
9090
projectorⱼ = idⱼ - prime(basisⱼ, rinds) * dag(basisⱼ)
9191
# Sum reference density matrices
9292
ρⱼ = sum(reference -> prime(reference[j], rinds) * dag(reference[j]), references)
93-
# TODO: Fix bug that `tr` isn't preserving the element type.
94-
ρⱼ /= scalartype(state)(tr(ρⱼ))
93+
ρⱼ /= tr(ρⱼ)
9594
# Apply projectorⱼ
9695
ρⱼ_projected = apply(apply(projectorⱼ, ρⱼ), projectorⱼ)
9796
expanded_basisⱼ = basisⱼ

0 commit comments

Comments
 (0)