Set the evolution operator.

Establishes the shift operator, coin operator, and the marked vertices. They are set using the appropriate **kwargs. If **kwargs is empty, the default arguments are used.

Subsequently, the evolution operator is constructed by multiplying the shift and coin operators. If the coin operator is given as an explicit matrix, its definition remains unaltered even in the presence of marked vertices. However, if the coin operator is defined using coin names, any marked vertices will prompt an update to the coin operator. Specifically, the coin names for each marked vertex will default to a replacement with -I, unless an alternative substitution is provided.

**kwargsdict, optional

Arguments for setting the evolution operator. Accepts any valid keywords from set_shift() set_coin(), and set_marked().


The evolution operator is given by

\[U = SC\]

where \(S\) is the shift operator, and \(C\) is the coin operator. If there are any marked vertices, the coin operator is modified accordingly [1].

When the coin operator is set as an explicit matrix, it remains unaltered by marked vertices. However, if it’s not provided in matrix form (e.g., as a list of coins), the coin for each marked vertex will be substituted based on the most recent set_marked() invocation.


Sparse matrix multipliation is not supported yet. Converting all matrices to dense. Then converting back to sparse. This uses unnecessary memory and computational time.



R. Portugal. “Quantum walks and search algorithms”, 2nd edition, Springer, 2018.