qml.utils

Warning

Unless you are a PennyLane or plugin developer, you likely do not need to use these utility functions.

This module contains utilities and auxiliary functions which are shared across the PennyLane submodules.

Functions

decompose_hamiltonian(H[, hide_identity])

Decomposes a Hermitian matrix into a linear combination of Pauli operators.

expand(matrix, original_wires, expanded_wires)

Expand a an operator matrix to more wires.

expand_vector(vector, original_wires, …)

Expand a vector to more wires.

frobenius_inner_product(A, B[, normalize])

Frobenius inner product between two matrices.

inv(operation_list)

Invert a list of operations or a template.

pauli_eigs(n)

Eigenvalues for \(A^{\otimes n}\), where \(A\) is Pauli operator, or shares its eigenvalues.

sparse_hamiltonian(H)

Computes the sparse matrix representation a Hamiltonian in the computational basis.

unflatten(flat, model)

Wrapper for _unflatten().

Contents