Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ When releasing a new version, move the "Unreleased" changes to a new version sec

### Performance

- Constructing an `MPOHamiltonian` from local operators compiles about twice as fast on
Julia 1.13 and 1.14. ([#554](https://github.com/QuantumKitHub/MPSKit.jl/pull/554))

## [0.14.1](https://github.com/QuantumKitHub/MPSKit.jl/compare/v0.14.0...v0.14.1) - 2026-11-02

### Added
Expand Down
9 changes: 6 additions & 3 deletions src/operators/mpohamiltonian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,12 @@ of two proportional operators need not be related by that same scalar.
"""
function _instantiate_operators(lattice, local_operators)
representatives = Tuple{Any, Any, Any}[]
return map(collect(local_operators)) do term
return instantiate_operator(lattice, _decompose_once!(representatives, term))
end
# A comprehension rather than `map`: all of the work happens in here, and type inference
# limits `map` calls that are nested within another `map` (JuliaLang/julia#64862).
return [
instantiate_operator(lattice, _decompose_once!(representatives, term))
for term in collect(local_operators)
]
end

# terms that are not supplied as an `inds => operator` pair -- e.g. a `LocalOperator` -- and
Expand Down
Loading