# netket.operator.LocalLiouvillianÂ¶

class netket.operator.LocalLiouvillian(ham, jump_ops=[], dtype=<class 'complex'>)Â¶

Bases: netket.operator.AbstractSuperOperator

LocalLiouvillian super-operator, acting on the DoubledHilbert (tensor product) space â„‹âŠ—â„‹.

Internally it uses netket.operator.LocalOperator everywhere.

The Liouvillian is defined according to the definition:

$\mathcal{L} = -i \left[ \hat{H}, \hat{\rho}\right] + \sum_i \left[ \hat{L}_i\hat{\rho}\hat{L}_i^\dagger - \left\{ \hat{L}_i^\dagger\hat{L}_i, \hat{\rho} \right\} \right]$

which generates the dynamics according to the equation

$\frac{d\hat{\rho}}{dt} = \mathcal{L}\hat{\rho}$

Internally, it stores the non-hermitian hamiltonian

$\hat{H}_{nh} = \hat{H} - \sum_i \frac{i}{2}\hat{L}_i^\dagger\hat{L}_i$

That is then composed with the jump operators in the inner kernel with the formula:

$\mathcal{L} = -i \hat{H}_{nh}\hat{\rho} +i\hat{\rho}\hat{H}_{nh}^\dagger + \sum_i \hat{L}_i\hat{\rho}\hat{L}_i^\dagger$
Inheritance
Attributes
HÂ¶

Returns the Conjugate-Transposed operator

Return type

AbstractOperator

TÂ¶

Returns the transposed operator

Return type

AbstractOperator

dtypeÂ¶
hamiltonianÂ¶

The hamiltonian of this Liouvillian

Return type

LocalOperator

hamiltonian_nhÂ¶

The non hermitian Local Operator part of the Liouvillian

Return type

LocalOperator

hilbertÂ¶

The hilbert space associated to this operator.

Return type

AbstractHilbert

hilbert_physicalÂ¶

The physical hilbert space on which this super-operator acts.

Return type

AbstractHilbert

is_hermitianÂ¶
jump_operatorsÂ¶

The list of local operators in this Liouvillian

Return type
max_conn_sizeÂ¶

The maximum number of non zero âŸ¨x|O|xâ€™âŸ© for every x.

Return type

int

sizeÂ¶

The total number number of local degrees of freedom.

Return type

int

Methods
__call__(v)Â¶

Call self as a function.

Return type

ndarray

Parameters

v (numpy.ndarray) â€“

add_jump_operator(op)[source]Â¶
add_jump_operators(ops)[source]Â¶
apply(v)Â¶
Return type

ndarray

Parameters

v (numpy.ndarray) â€“

collect()Â¶

Returns a guranteed concrete instancce of an operator.

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

Return type

AbstractOperator

conj(*, concrete=False)Â¶
Return type

AbstractOperator

conjugate(*, concrete=False)Â¶

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

get_conn(x)[source]Â¶

Finds the connected elements of the Operator. Starting from a given quantum number x, it finds all other quantum numbers xâ€™ such that the matrix element $$O(x,x')$$ is different from zero. In general there will be several different connected states xâ€™ satisfying this condition, and they are denoted here $$x'(k)$$, for $$k=0,1...N_{\mathrm{connected}}$$. :param x: An array of shape (hilbert.size) containing the quantum numbers x. :type x: array

Returns

The connected states xâ€™ of shape (N_connected,hilbert.size) array: An array containing the matrix elements $$O(x,x')$$ associated to each xâ€™.

Return type

matrix

Raises

ValueError â€“ If the given quantum number is not compatible with the hilbert space.

get_conn_flattened(x, sections, pad=False)[source]Â¶

Finds the connected elements of the Operator. Starting from a given quantum number x, it finds all other quantum numbers xâ€™ such that the matrix element $$O(x,x')$$ is different from zero. In general there will be several different connected states xâ€™ satisfying this condition, and they are denoted here $$x'(k)$$, for $$k=0,1...N_{\mathrm{connected}}$$.

This is a batched version, where x is a matrix of shape (batch_size,hilbert.size).

Parameters
• x (matrix) â€“ A matrix of shape (batch_size,hilbert.size) containing the batch of quantum numbers x.

• sections (array) â€“ An array of sections for the flattened xâ€™. See numpy.split for the meaning of sections.

Returns

The connected states xâ€™, flattened together in a single matrix. array: An array containing the matrix elements $$O(x,x')$$ associated to each xâ€™.

Return type

matrix

get_conn_padded(x)Â¶

Finds the connected elements of the Operator. Starting from a batch of quantum numbers x={x_1, â€¦ x_n} of size B x M where B size of the batch and M size of the hilbert space, finds all states y_i^1, â€¦, y_i^K connected to every x_i. Returns a matrix of size B x Kmax x M where Kmax is the maximum number of connections for every y_i. :type x: ndarray :param x: A N-tensor of shape (â€¦,hilbert.size) containing

the batch/batches of quantum numbers x.

Returns

The connected states xâ€™, in a N+1-tensor. mels: A N-tensor containing the matrix elements $$O(x,x')$$

associated to each xâ€™ for every batch.

Return type

x_primes

Parameters

x (numpy.ndarray) â€“

n_conn(x, out=None)Â¶

Return the number of states connected to x.

Parameters
• x (matrix) â€“ A matrix of shape (batch_size,hilbert.size) containing the batch of quantum numbers x.

• out (array) â€“ If None an output array is allocated.

Returns

The number of connected states xâ€™ for each x[i].

Return type

array

to_dense()Â¶

Returns the dense matrix representation of the operator. Note that, in general, the size of the matrix is exponential in the number of quantum numbers, and this operation should thus only be performed for low-dimensional Hilbert spaces or sufficiently sparse operators.

This method requires an indexable Hilbert space.

Return type

ndarray

Returns

The dense matrix representation of the operator as a Numpy array.

to_linear_operator(*, sparse=True, append_trace=False)[source]Â¶

Returns a lazy scipy linear_operator representation of the Lindblad Super-Operator.

The returned operator behaves like the M**2 x M**2 matrix obtained with to_dense/sparse, and accepts vectorised density matrices as input.

Parameters
• sparse (bool) â€“ If True internally uses sparse matrices for the hamiltonian and jump operators, dense otherwise (default=True)

• append_trace (bool) â€“ If True (default=False) the resulting operator has size M**2 + 1, and the last element of the input vector is the trace of the input density matrix. This is useful when implementing iterative methods.

Return type

LinearOperator

Returns

A linear operator taking as input vectorised density matrices and returning the product L*rho

to_qobj()[source]Â¶

Convert the operator to a qutipâ€™s liouvillian Qobj.

Return type

qutip.liouvillian

Returns

A qutip.liouvillian object.

to_sparse()Â¶

Returns the sparse matrix representation of the operator. Note that, in general, the size of the matrix is exponential in the number of quantum numbers, and this operation should thus only be performed for low-dimensional Hilbert spaces or sufficiently sparse operators.

This method requires an indexable Hilbert space.

Return type

csr_matrix

Returns

The sparse matrix representation of the operator.

transpose(*, concrete=False)Â¶

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