seemps.register.mpo_weighted_shifts#

seemps.register.mpo_weighted_shifts(L: int, weights: VectorLike, shifts: tuple[int, int] | list[int], periodic: bool = False, base: int = 2) MPO[source]#

Return an MPO that implements a linear combination of arithmetic displacements.

This function creates a matrix product operator that implements

\[O |s\rangle \to \sum_i w_i |s + i\rangle\]

The operator is very useful to implement finite difference approximations.

Parameters:
Lint

Number of qubits in the quantum register

weightsVectorLike

List or array of weights to apply to each displacement

shiftslist[int] | tuple[int,int]

Range of displacements to be applied

periodicbool, default = False

Whether to wrap around integers when shifting.

baseint, default = 2

Encoding of the quantum register elements. By default base=2 meaning we work with qubits.

Returns:
MPO

Matrix product operator for O above.