hiperwalk.Coined.simulate#

Coined.simulate(range=None, state=None)#

Simulates the quantum walk.

The simulation propagates the quantum walk state by iteratively applying the evolution operator to the result of its previous application, starting from the specified initial state.

Parameters:
rangeint, tuple of int, default=None

Specifies the number of applitcations of the evolution operator, and the corresponding states to be saved. It can be defined in three distinct ways:

  • end

    Saves the states from the 0-th to the (end - 1)-th application of the evolution operator. The corresponding exponents of the evolution operator are all integers in the open interval [0, end), i.e. [0, 1, ..., end - 1].

  • (start, end)

    Saves the states from the start-th to the (end - 1)-th application of the evolution operator. The corresponding exponents of the evolution operator are all integers in the open interval [start, end), i.e. [start, start + 1, ..., end - 1].

  • (start, end, step)

    Saves the states from the start-th to the (end - 1)-th application of the evolution operator separated by step applications. The corresponding exponents of the evolution operator are all integers in the open interval [start, end) such that the difference between two integers is at least step, i.e. [start, start + step, ..., start + k*step] where k is the smallest integer that satisfies start + (k + 1)*step >= end.

statenumpy.array, default=None

The starting state onto which the evolution operator will be applied.

Returns:
statesnumpy.ndarray.

States retained during the simulation where states[i] is the i-th saved state.

Raises:
ValueError

Triggered if range is None or state is None.

See also

evolution_operator
state

Notes

The states computed and saved during the simulation are determined by the parameter range=(start,end,step).

The simulation of the walk is based on the expression \(|\psi(t)\rangle=U^t|\psi(0)\rangle\), where \(|\psi(0)\rangle\) denotes the initial state. The values for \(t\) progress as \(t=\text{start}\), \(\text{start} + \text{step}\), \(\text{start} + 2\cdot\text{step}, \ldots\), until reaching the highest value of \(k\) that satisfy \(\text{start} + k\cdot \text{step} < \text{end}\).

Specifically, the simulation begins from the state \(|\psi(\text{start})\rangle\) and sequentially calculates and saves states in the form of \(|\psi(\text{start}+j\cdot\text{step})\rangle\), where \(j=0,1,...\) and the maximum value of \(j\) ensures that \(\text{start}+j\cdot\text{step} < \text{end}\).

Examples

Given range=(0, 13, 3), the saved states would include: the initial state (t=0), intermediate states (t=3, 6, and 9), and the concluding state (t=12).