# pyCTQW.MPI.Line¶

class Line(N)

Performs and analyses 1 particle continuous-time quantum walks on an infinite line

Parameters: N (int) – an even number of nodes to initialize the walker with. Nodes are labeled $$j\in\{1-N/2,N/2\}$$.

Example

To create a CTQW Line object for a 10 node line,

>>> walk = pyCTQW.MPI.Line(10)


## Method Summary¶

 Line.createH([d, amp]) Generate the Hamiltonian of the graph. Line.createInitState(initState) Generate the initial state of the quantum walk. Line.destroy() Destroys the 1 particle quantum walk object, and all associated PETSc matrices/vectors. Line.exportState(filename, filetype) Exports the final state of the quantum walk to a file. Line.importInitState(filename, filetype) Imports the initial state of the quantum walk from a file. Line.plot(filename) Creates a plot of probability vs node. Line.plotNodes(filename[, t]) Creates a plot of the node probablities over time. Line.propagate(t[, method]) Propagates the quantum walk for time t. Line.psiToInit() Copies the state self.psi to self.psi0. Line.watch(nodes) Creates a handle that watches node probability during propagation.

## Attribute Summary¶

 Attribute Type Description Line.psi0 petsc4py.PETSc.Vec() $$N$$ element PETSc vector containing the initial state Line.psi petsc4py.PETSc.Vec() $$N$$ element PETSc vector containing the final state after the last propagation. Line.H pyCTQW.MPI.ctqw.Hamiltonian() Hamiltonian matrix Line.EigSolver pyCTQW.MPI.ctqw.EigSolver() The Hamiltonian eigensolver Line.handle pyCTQW.MPI.ctqw.nodeHandle() A node handle, created if nodes are being watched for probability.