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:
- L
int Number of qubits in the quantum register
- weights
VectorLike List or array of weights to apply to each displacement
- shifts
list[int] |tuple[int,int] Range of displacements to be applied
- periodicbool,
default=False Whether to wrap around integers when shifting.
- base
int,default= 2 Encoding of the quantum register elements. By default base=2 meaning we work with qubits.
- L
- Returns:
MPOMatrix product operator for O above.