netket.operator.AbstractOperator#

class netket.operator.AbstractOperator[source]#

Bases: AbstractObservable

Abstract class for quantum Operators.

An operator is a general object that defines a linear transformation on vectors of the Hilbert space and their expectation value can be comptued starting from a variational state using the method expect or expect_and_grad of the variational states.

If the object is not a linear operator but some more general function, it should inherit from {class}`~netket.operator.AbstractObservable` instead.

Operators over discrete hilbert spaces that can be converted to a dense representation should instead inherit from {class}`~netket.operator.DiscreteOperator`, while operators over that only work over continuous hilbert spaces should inherit from {class}`~netket.operator.ContinuousOperator`.

This class determines the basic methods that an operator must implement to work correctly with NetKet.

Inheritance
Inheritance diagram of netket.operator.AbstractOperator
Attributes
H#

Returns the Conjugate-Transposed operator

T#

Returns the transposed operator

dtype#

The dtype of the operator’s matrix elements ⟨σ|Ô|σ’⟩.

hilbert#

The hilbert space associated to this observable.

is_hermitian#

Returns true if this operator is hermitian.

Methods
collect()[source]#

Returns a guaranteed concrete instance of an operator.

As some operations on operators return lazy wrappers (such as transpose, hermitian conjugate…), this is used to obtain a guaranteed non-lazy operator.

Return type:

AbstractOperator

conj(*, concrete=False)[source]#
Return type:

AbstractOperator

conjugate(*, concrete=False)[source]#

Returns the complex-conjugate of this operator.

Parameters:

concrete – if True returns a concrete operator and not a lazy wrapper

Return type:

AbstractOperator

Returns:

if concrete is not True, self or a lazy wrapper; the complex-conjugated operator otherwise

transpose(*, concrete=False)[source]#

Returns the transpose of this operator.

Parameters:

concrete – if True returns a concrete operator and not a lazy wrapper

Return type:

AbstractOperator

Returns:

if concrete is not True, self or a lazy wrapper; the transposed operator otherwise