importInitState

Line.importInitState(filename, filetype)

Imports the initial state of the quantum walk from a file.

Parameters:
  • filename (str) – path to the file containing the input state.
  • filetype (str) –

    the filetype of the imported adjacency matrix.

    • 'txt' - an \(N\) element column vector in text format.
    • 'bin' - an \(N\) element PETSc binary vector.
Returns:

: this creates a PETSc vector containing the initial state, accessed via Graph.psi0.

Return type:

petsc4py.PETSc.Vec()

Warning

The number of elements in the imported input state vector must match the number of nodes the 1P CTQW object is initialized with.