hqs_quantum_solver.evolution.observers

hqs_quantum_solver.evolution.observers#

Observer functions for the time evolution functions.

Functions

expectation(observables)

Observer for the expectation value of operators.

state()

Observer for the whole state.

Classes

Observer

Protocol for time-step observers that can be used in time evolution functions.

class Observer#

Protocol for time-step observers that can be used in time evolution functions.

__call__(t: float, state: ndarray, /) T_co#

Returns the observation for a given value of t and state.

Parameters:
  • t (float) – The integration variable.

  • state (ndarray) – The state at t.

__init__(*args, **kwargs)#
expectation(observables: Iterable[SimpleOperatorProtocol]) Observer[ndarray]#

Observer for the expectation value of operators.

Parameters:

observables (Iterable[SimpleOperatorProtocol]) – List of operators for which to compute the expectation value.

Returns:

Observer that returns a list, where each entry corresponds to the expectation value of the operators given in args.

state() Observer[ndarray]#

Observer for the whole state.

Captures the entire state during time evolution.

Returns:

The observer.