createH

Line2P.createH(d=None, amp=None, interaction=0.0)

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]).
  • interaction (float) – the amplitude of interaction between the two walkers when located on the same vertex.
Returns:

: this creates a Hamiltonian matrix, accessed via the attribute Line2P.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