importInitState

Graph2P.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\times N\) 2D array in text format.
    • 'bin' - an \(N^2\) element PETSc binary vector.
Returns:

: this creates a PETSc vector containing the initial statespace, accessed via self.psi0.

Return type:

petsc4py.PETSc.Vec()

Warning

The number of elements in the imported input statespace must equal \(N^2\) (either as a \(N\times N\) text file or a \(N^2\) PETSc binary vector), where \(N\) is the number of nodes the 2P CTQW object is initialized with.