Closed DaanMaertens closed 11 months ago
I think it is fine to define expectation_value(psi::FiniteMPS, H::ProjectionOperator)
, as H = |psi0><psi0|
this should just be the overlap between the two states (squared?). I'll look into actually implementing it tomorrow or later this week. I would however have to investigate if this is a useful metric to print anyways, as this arises in the context of excitations and this is not necessarily the excitation energy (I think?)
When running finite excitation it is possible to get the following error
The error details that there does not exist a method for expectation_value(::FiniteMPS,::MPSKit.LinearCombination,::MPSKit.LazyLincoCache). More precisely the error stems from this part inside dmrgexciation.jl
When the maximum amount of iterations is reached find_groundstate warns the users with a message that contains expectation_value of that state with H. In this case H= super_op is a
LinearCombination
so it tries to calculate this but fails because this method is not defined. A possible solution is to defineHowever this causes again an error when it tries to do
expectation_value(Ψ, ::MPSKit.ProjectionOperator, ::MPSKit.FinEnv)
for which there also doesn't exist any method. I don't know how expectation_value should be defined for a ProjectionOperator and at this point it seems easier to just suppress the warning that causes the error in the first place.