QuantumKitHub / MPSKit.jl

A Julia package dedicated to simulating quantum many-body systems using Matrix Product States (MPS)
MIT License
126 stars 28 forks source link

`expectation_value` is a number #156

Closed lkdvos closed 2 months ago

lkdvos commented 2 months ago

This PR changes the expectation_value function in order to make it consistently return a number. It also adds the following syntax:

expectation_value(state, (i, j) => local_operator)

for handling local operators acting on states.

It removes some definitions that are ill-defined, such as computing the expectation value of a global operator acting on a window mps.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 77.32558% with 39 lines in your changes missing coverage. Please review.

Files Coverage Δ
src/MPSKit.jl 100.00% <ø> (ø)
src/algorithms/excitation/dmrgexcitation.jl 100.00% <100.00%> (ø)
src/algorithms/grassmann.jl 99.13% <100.00%> (-0.87%) :arrow_down:
src/algorithms/groundstate/dmrg.jl 100.00% <100.00%> (ø)
src/algorithms/groundstate/idmrg.jl 100.00% <100.00%> (ø)
src/algorithms/statmech/vomps.jl 95.45% <100.00%> (+4.54%) :arrow_up:
src/algorithms/toolbox.jl 95.26% <100.00%> (+0.14%) :arrow_up:
src/environments/idmrgenv.jl 100.00% <ø> (ø)
src/states/abstractmps.jl 72.00% <100.00%> (+3.25%) :arrow_up:
src/states/infinitemps.jl 62.14% <100.00%> (+3.44%) :arrow_up:
... and 8 more

... and 1 file with indirect coverage changes