createH

Line.createH(d=None, amp=None)

Generate the Hamiltonian of the graph.

Parameters:
  • d (array of ints) – an array containing integers indicating the nodes where diagonal defects are to be placed (e.g. d=[0,1,4]).
  • amp (array of floats) – an array containing floats indicating the diagonal defect amplitudes corresponding to each element in d (e.g. amp=[0.5,-1,4.2]).
Returns:

: this creates a Hamiltonian matrix, accessed via the attribute Line.H.

Return type:

pyCTQW.MPI.ctqw.Hamiltonian()

Warning

The size of amp and d must be identical

>>> amp = [0.5,-1.,4.2]
>>> len(d) == len(amp)
True