hiperwalk.Coined.probability#

Coined.probability(states, vertices)[source]#

Computes the sum of probabilities for the specified vertices.

Computes the probability of the walker being located on a vertex within the set of provided vertices, given that the walk is on specified states.

Parameters:
statesnumpy.ndarray

The state(s) used to compute the probability. states can be a single state or a list of states.

vertices: list of int

The subset of vertices.

Returns:
probabilitiesfloat or numpy.ndarray
float:

If states is a single state.

numpy.ndarray:

If states is a list of states, probabilities[i] is the probability corresponding to the i-th state.

See also

simulate

Notes

The probability of finding the walker on vertex \(v\), given the state of the walk \(|\psi \rangle\), is calculated as

\[\begin{split}\sum_{\substack{a\in{\mathcal{A}}\\ \operatorname{tail}(a)=v}} \, \left|{\langle a} | {\psi \rangle}\right|^2,\end{split}\]

where \(\mathcal{A}\) denotes the set of arcs.