qml.labs.trotter_error.AbstractState

class AbstractState[source]

Bases: ABC

Abstract class used to define a state object for product formula error estimation.

A class inheriting from AbstractState must implement the following dunder methods.

  • __add__: implements addition

  • __mul__: implements multiplication

Additionally, it requires the following methods.

  • zero_state: returns a representation of the zero state

  • dot: implments the dot product of two states

dot(other)

Compute the dot product of two states.

zero_state()

Return a representation of the zero state.

abstract dot(other)[source]

Compute the dot product of two states.

Parameters:

other (AbstractState) – the state to take the dot product with

Returns:

the dot product of self and other

Return type:

float

abstract classmethod zero_state()[source]

Return a representation of the zero state.

Returns:

an AbstractState representation of the zero state

Return type:

AbstractState